Software as a Service Rails Kit
Write your app. Not billing code.
Are you starting to build a new web service with Ruby on Rails? Do you want to avoid having to write the subscription management, recurring billing, and credit card management code?
The SaaS Rails Kit gets your new software-as-a-service site off to a running start by providing you a well-tested and proven recurring billing system based on the Braintree payment gateway. Never heard of Braintree? See my blog post about Braintree.
Pricing
Choose your license based on your development needs. All licenses come with full source code. They are not limited to a set number of developers, but they are limited based on the number of sites you want to build. A “site” is one web application served from one domain, such as example.com.
The license is a one-time fee. You don’t need to pay yearly, per developer, or per server.
Not sure whether you are going to build multiple sites at this point? You can always buy the Single Site License now and get a discount equal to the cost of the Single Site License on a purchase of the Multiple Site License later.
| Single Site |
Multiple Site |
| Suitable for developers building a single hosted web service. If you’re a startup building one product, this is the license for you. You can use the SaaS Rails Kit - Single Site License as the basis for one subscription-based site. |
This license is intended for companies / developers that are building multiple subscription-based services. This would be suitable for companies offering a suite of products, like 37signals, or independent consultants and agencies building solutions for clients. You can build multiple products with the SaaS Rails Kit - Multiple Site License. |
|
$249

|
$999

|
By purchasing a license you are agreeing to the license agreement
Features
- No local credit card storage. All credit card information is stored with Braintree.
- Automated billing script runs nightly for anniversary billing.
- Configurable subscription renewal period (defaults to one month).
- Automated notification and retry of failed renewals.
- Free accounts and one-month trials are supported.
- Optionally collect payment information for paid accounts at account creation.
- Easy customization of plan levels — pricing and custom limits.
- Ability to tweak limits and fees per account.
- Self-serve account creation.
- Self-serve account upgrades and downgrades, with limit checking to prevent downgrading to a plan for which the account does not qualify, based on the plan limits.
- Account lookups by subdomain.
- Includes a module with shared controller methods written to scope all model access to the current account.
- Comes with a limit on the number of users each account can have, complete with controller code, as an example of how to implement limits.
- Integration of restful_authentication plugin, customized for a multi-tenant web service.
- SSL protection of account creation and login via the SslRequirement plugin.
- Code to Test Ratio: 1:1.3 (RSpec).
Details
Here are some details of the implementation, to give you a better idea of what you’re getting when you purchase a license to use this Rails Kit. Below are the key files that make up the guts of the Rails application:
Models
- account.rb - The center of the application. Accounts are created by your customers, and everything associated with your application — users, projects, files, etc. — hang off the Account.
- subscription.rb - This is where the limits are kept, along with how much to charge and when.
- subscription_address.rb - Tableless model for passing billing address to the payment gateway.
- subscription_notifier.rb - Emails for account creation, cancellation, up/downgrades, billing receipts, and billing failures.
- subscription_plan.rb - The plan levels (Free, Basic, Advanced, etc.) and the limits associated with each level.
- user.rb - As generated by restful_authentication, with one change in the logins and emails having the uniqueness check scoped to the account.
Controllers
- accounts_controller.rb - Account creation, up/downgrades, etc.
- sessions_controller.rb - Login
- users_controller.rb - An example of a basic CRUD controller that shows how to use the account scoping and account limits.
Misc
- lib/authenticated_system.rb - As generated by restful_authentication, but with changes to scope user authentication to the account (which is loaded by subdomain).
- lib/model_controller_methods.rb - A module of shared controller methods that make it easy to have basic CRUD actions scoped to the current account.
- script/daily_mailer - The script to be run via cron daily that sends out trial expiration notices and runs the renewals.
If you have more questions about the details of the implementation, feel free to contact me.
Demo
You can get a demo of the customer-facing functionality by creating a free account at Catch the Best, the application I created that is the source of the SaaS Rails Kit. Once you create your account, click on the Settings link at the top-right to see the account edit action, self-serve plan changing, and account cancellation. If you upgrade to a non-free plan, you’ll get access to the billing information page. Of course you can downgrade back down to a free plan if you really want to. :)
You’ll get some emails as you go through those steps, so watch out for those. Those email triggers and templates are in the Kit as well.
If you have more questions after checking out the UI, feel free to contact me.
Demo
You can get a demo of the customer-facing functionality by creating a free account at Catch the Best, the application I created that is the source of the SaaS Rails Kit. Once you create your account, click on the Settings link at the top-right to see the account edit action, self-serve plan changing, and account cancellation. If you upgrade to a non-free plan, you’ll get access to the billing information page. Of course you can downgrade back down to a free plan if you really want to. :)
You’ll get some emails as you go through those steps, so watch out for those. Those email triggers and templates are in the Kit as well.
If you have more questions after checking out the UI, feel free to contact me.
Testimonials
I purchased the kit tonight and have been going through the code the past couple of hours. Everything looks very good.
This was the last piece for my subscription based service and it couldn’t have come at a more perfect time. It’s sort of funny, because I wrote out a list of features I needed to implement in my subscription based billing 3 days ago, and then I saw this on your blog today and the feature list is almost identical. I even decided to use BrainTree, and having the payment processing section of my app being the only place where I lacked direct experience, it made buying this a no-brainer :).
— Eric Campbell
A little more than a year ago, I purchased ‘The Money Train,’ an e-book written by Benjamin Curtis. I’ve since purchased a second copy for my business partner because I thought the tips on building an e-commerce site were priceless.
We’ve been working on ‘the meat’ of our site and have been putting off the grueling task of building a recurring billing system. Even armed with the knowledge contained in Benjamin’s e-book, there’s a lot of ways to shoot yourself in the foot when it comes to billing code. Let’s face it, the last thing you want to do is write code that accidentally messes with other people’s money.
I came across Rails Kits and saw that it was from the same guy that wrote that e-book. Even better, he’d finally done what I wished he had done before: built a best-of-breed billing system using his intimate knowledge of billing systems.
I purchased the SaaS Rails Kit and have been working through the code. This really is awesome stuff!
Days and weeks of our time have been saved and we couldn’t be happier.
— Chris Grant, MacHive.com