How to build a SaaS Rails site in one hour

22 Apr 2008

A lot of us are building web applications that we sell (or hope to sell) to customers on a subscription basis, like Catch the Best. Every time you and I build one of those applications, we need to build a billing system to go along with it. I imagine you and I would build pretty similar solutions to that problem, and if you’re like me, you’d actually rather spend your time on more interesting things than a recurring billing system. Would you like to have a shortcut that would allow you to skip writing the code for managing accounts, upgrades, renewals, etc. Would you like to have a ready-made kit that would allow you to build a software-as-a-service Rails application in one hour?

If so, then check out my latest venture, Rails Kits, and the first Rails Kit, the Software as a Service Rails Kit. This Rails Kit provides a complete recurring billing solution for Rails apps. It’s actually a Rails application that you can use as a starting point for your own Rails application. It will give you a head start on building your app, complete with logins provided by the restful_authentication plugin, SSL protection provided by the SslRequirement plugin, and credit card processing provided by ActiveMerchant.

You get account management, including self-serve upgrades and downgrades, free trials, automated billing. Right off the bat you get the ability to tier your plan levels based on user limits, and it’s very easy to define your own limits (storage space, number of projects, etc.). You get support for accounts keyed on subdomains, with scoping to help ensure customers see only their own data. Check out the features list for more info.

If you want to save yourself some time building your next Rails application, check out the SaaS Rails Kit now. You’ll be up and running with an application that can start making money in no time.



A year in the life of a Rails freelancer

19 Mar 2008

Many moons ago I wrote a quick status report on my first 100 days of Rails consulting. Now that it has been over a year since I joined the freelance world full time, I figured it was a good time to reflect again on that experience.

I said it then, and I’ll say it again—this experience has been a blast. I may go to work for someone else again at some point in the future, but for now I’m loving being independent. I’ve learned to manage the stress of worrying about where the next check is coming from, and I’ve gotten into a rhythm with the ebb and flow of client work, so life is good.

If you happen to need someone to help you build your web application, drop me a line. My schedule stays pretty full, so don’t wait until the last minute to get in touch!

I’m looking forward to seeing what the next year will bring. :)



Integrating Scribd with your Rails application

12 Mar 2008

I recently integrated the Scribd API with my resume management application, Catch the Best, so I thought I’d share a few details here about how I did that in case you are interested in using their great API.

To get started, first you need to install the rscribd gem and set up an account at Scribd to get API access.

Once you do that, it’s easy to send a document to Scribd:

require ‘rscribd’

Scribd::API.instance.key = ‘yourkey’
Scribd::API.instance.secret = ‘yoursecret’
Scribd::User.login ‘login’, ‘pass’

doc = Scribd::Document.upload(:file => ’/path/to/file’)

One thing to consider when creating documents with Scribd is that you don’t want to be uploading documents to them during the request/response cycle. It’s not that Scribd is particularly slow, but you don’t want unnecessary delays slowing down your users. To accomplish that, I move the call for Scribd::Document to a method in my Attachment class (which is using attachment_fu), and then queue the creation of the Scribd document with the excellent Bj plugin. So, my model ends up looking something like this:

class Attachment < ActiveRecord::Base
  has_attachment …
   
  after_create :send_to_scribd
 
  def scribdify
    doc = Scribd::Document.upload(:file => self.full_filename, :access => ‘private’)
    ...
  end
 
  def send_to_scribd
    Bj.submit("./script/runner ./script/scribd.rb #{self.id}")
  end
end

The scribd.rb script is itself pretty simple—it just does the setup code for Scribd and then calls scribdify on the attachments it finds from the arguments passed to Bj.

And that’s it! Easy Scribd API integration for your Rails app. You can see the finished product here: Catch the Best integrates with iPaper



Javascript database

10 Mar 2008

This is cool… TaffyDB is an in-browser javascript database. This could be really useful for doing changes to a dataset without moving page to page, and then simply sending JSON back to a Rails or Merb app to save the changes.



Sample Rails consulting contract

20 Feb 2008

I’ve had requests from time to time from other developers for the contract that I use with clients. Here’s the Terms section that I typically use. In addition to this section, I have sections that describe the work to be done, the payment schedule, and other info specific to each client.

Enjoy!

Sample Rails consulting contract

Ob. disclaimer: I am not a lawyer, and this is not legal advice—I’m just some guy on the internet.