Ruby on rails SaaS application where to begin, what tools to use - ruby-on-rails

I'm at the point in my application where I would like to integrate a saas solution into my application using ruby on rails. So far everything has been good except I am unsure where to begin.
My Idea:
I would create a subscription.rb and plan.rb model. A user would belong to subscription and subscription would have many users. Next subscriptions would have many plans and plans would belong to subscription. I would then add role for each plan to limit a user from certain parts of the application maybe using cancan. After setting everything up I would integrate stripe into my application to handle the payment side of things.
The above is how I am thinking of setting this up. It may truly be the wrong concept but that is why I wrote it so you could get an understanding of what I am thinking. I know I could use third party services like recurly, chargify, etc but I am opening my eyes to see if this can be done using a similar a approach.
What technologies have you used or prefer to use when creating a saas application?
Is my approach wrong? If so what is a better way to approach this?
Any tips or advice for creating a saas application such as technologies, ruby on rails tools etc.

Take a look at the open source example application for a Rails Membership/Subscription/SaaS Site from the RailsApps project. It comes with a tutorial that explains the implementation in great detail. Here's the libraries it uses:
Devise for authentication
CanCan for authorization
Stripe for recurring billing
Twitter Bootstrap for front-end CSS
Using Stripe for billing makes implementation easy and reduces security risks as Stripe handles all the automated recurring billing.
The RailsApps example puts CanCan together with Rolify and uses roles that correspond with subscription plans to manage user access. It shows how to simplify the architecture so there's no need for the complexity of a subscription.rb or plan.rb model (though you could refactor that if you wanted to).

1) I use MongoDB as the db backend for the flexibility, RSpec for TDD, HAML/SASS, and RailsAdmin for a quick admin dashboard.
2) Its not necessarily wrong, but its up to you in terms of what you plan on allowing users to do.
3) So wait, have you already developed your tool or are you asking us to plan your tool. Also, what kind of Saas application did you intend to build?

Related

Customizing Shopify Themes

E-commerce intermediate, Shopify and Ruby on Rails newbie.
How does one go about customizing Shopify files? I have a purchased a theme but want to make some changes to the .liquid files.
Do I have to I unzip, edit, re-zip and upload in the Shopify admin section? is this supported? What are best practices for customizing themes?
You can get started with the instructions here, which can be done straight from the admin interface.
Once you've gained some experience there (try some of the shopify/liquid tutorials), you can take a more comprehensive/custom approach. And btw, you don't need to know Rails, just the Ruby language. In fact, you can even hack away at the liquid codebase if you want.
Good luck!
In addition to #davidchappy s answer:
Would also recommend checking out ThemeKit and Slate so that you don't have to develop from the admin.
Would highly suggest that you sign up for a Shopify Partner account. That would allow you to create development stores. Meaning that you wouldn't have to pay an active monthly subscription before you are ready to actually receive money.
Would also give you a great dev store to work on directly with ThemeKit so you can test everything before using ThemeKit to deploy to your production (live) webshop.
All you need to do is set up a private app that allows you to read/write to theme files.

The simplest way to generate a shop without orders and payments using spree

I want to make an online catalogue like application for some stores in a shopping center so each shop can login to system and add/edit products for their shops. I'm forced to use ruby on rails.
After some searching I found spree!
But I didn't find any option to disable orders, payments, shipping and etc which are useless in a catalogue. Here are my questions:
Is spree a good starting point for my application? if not, can you give me some other open source projects?
How can I disable Payments and other useless options for my application?
I don't think you want to use Spree for this. Just because it includes the "piece" you want for your own puzzle doesn't mean it is designed to operate independently of Spree. It is incredibly easy using rails to create a simple "read only" catalog that other users can update and maintain. I would suggest spending some time to get familiar with rails and its pros and cons pertinent to your use case.
Spree is designed to be a developer orientated e-commerce platform. It has a 'catalog' as you would describe it as a requirement for its primary purpose: The exchange of goods for money. This is not your use case so spree will not help you with your goals.

Ecommerce Subscription for Rails

Have seen some conversations revolving around this, but hoping for some current input as to perhaps the best libs and services available for Rails developers at the moment who are implementing a subscription membership based website.
I'm interested in any libs or frameworks with which you may be familiar through GitHub or elsewhere as well as what service has given you the best experience so far for clients and your own sanity? I'm leaning towards paypal and perhaps also including Google Checkout, however there are certainly a lot of other options.
I'd like for it to be clean and to appear as integrated into the website as possible while carrying the trust of a larger service provider such as PayPal and Google.
Additionally, these are mostly micro payments at around $1.00 USD. Sometimes purchases go up to $15 to $30.
EDIT: Since initial post I've found SaaS Rails Kit (http://railskits.com/recurring_billing/). Has anyone had experience with this vs Recurly? Doing some research as per the first answer, it appears Recurly is the superior option at this point for our model, however this Rails Kit may be an even better option if it has met some very positive experiences in comparison with other options.
The one I prefer: Chargify (soon to be available on heroku)
Another I know but haven't used: Recurly (soon on heroku too)

Any reason why Ruby on Rails doesn't have a standard user authenticated system built in?

This question aims to understand RoR and frameworks in general. It looks like RoR never had any standard user authentication system. Was it just historical reason (just happened naturally as it did)... or could it be intentional? Because RoR is a website building tool, more often than not, user authentication is a crucial part of a website.
To put it into perspective, another question is, do other popular frameworks, Django, Symfony, CakePHP, have user authentication built in?
There is no reasonably generic way to do user authentication. Most frameworks leave it up to you to choose the plugin that most closely matches what you're trying to accomplish.
For example, consider these two situations:
a blog which has a single administrator with password-protected admin-facing tools
a site like YouTube which allows users to sign up and administer their own content
Both of these sites would require vastly different authentication systems; which of these systems should Rails cater to out-of-the-box?
The Rails core team wanted to ensure that Rails was open-ended enough to make anything you want. There is no one-size-fits-all authentication scheme, so the core team decided to leave it out. Rails is easily extendable via gems and plugins, so that is where they belong.
Some examples are Warden and the Rails Warden plugin, Devise, Authlogic, and Restful Authentication.
CakePHP has a built in Authentication component that is pretty straight forward and easy to implement.
Most of these frameworks you mentioned are toolkits, not complete products. You build these things yourself, or leverage plugins from the community. Django's admin plugin/module has authentication out of the box though. Drupal does too, as a matter of fact.
Authentication can be(and is in my opinion) a matter of taste and need. If Rails was including things like that, it would start to become a website and not a framework. The programmer has to be free to choose among various implementations. That is why gems are available.
I've been programming a little in Rails and CakePHP, and I can say that Rails doesn't need to provide a mechanism like this. The community is very very good, and there are many examples (already said, like Devise, Authlogic...) made by very good programmers. Of course, there are many tutorials online (and also, railscasts, which are simply awesome) to program a succesful set-up for your project. So, if we have all of this, why should we need something like cakePHP mechanism? It's OK, it works, but there's just a very good tutorial and that's all( and maybe enough..). So, in the end, if u have a nice community you shouldn't care about the core of the technology, there will be always someone else more experienced with your needs that will do it for you. And if you don't find it, do it by yourself and in the proccess you will find a lot of help! :)

Recommended Rails plugins for software as a service app

I am investigating potential Rails plugins or Gems to help develop a SAAS type app. Specifically I am looking for help in two areas:
Restricting access to certain areas of the app based on the account's plan. For example, a bronze account allows access to some functionality, upgrading to silver unlocks access to new features and functionality. Basically, just controlling what accounts have access to what controllers.
Managing subscriptions, invoicing and taking payments. This app will be charging on an annual or quarterly basis, there's a 30 day free trial with no payment details needed up front, and I think the intention is to use PayPal Website Payments Pro (although that is not set in stone).
Given the above, can anyone recommend any Gems or plugins? I have had a look at the SAAS Railskit and I am not opposed to spending a bit of money. However, I'd certainly want to hear good things from people who have used it first, and also how easy it is to pick appart the Railskit and apply it to my own application (as I am not starting from scratch here - needs to integrate with Authlogic too).
Thanks in advance for your help.
Bruno Bornsztein offers a Rails engine that implements a SaaS site. Look for striped_rails on GitHub.
You might want to look at the open source example application for a Rails Membership/Subscription/SaaS Site from the RailsApps project. It comes with a tutorial that explains the implementation in great detail. It does what you describe using Devise for authentication and Stripe for billing.
My SaaS Rails Kit does integrate well with pre-existing apps... many of my customers do that. And the testimonials at the site are real. :) Plus there are many other similar testimonials that I haven't published -- a lot of good things have been said about it. :)
While there are quite a few different gems out there which do different things different ways, I would definitely suggest that you start with these:
activemerchant — I would use this for payment processing. It is honestly the best (and most extensible) gem out there, and its especially well-tested for PayPal usage, although I'd look elsewhere for SaaS billing because PayPal is utter crap.
declarative_authorization — This is probably the most extensible plugin for authorization, which allows different users with different roles to do different things. For instance, you can build roles for each plan.
You should also take a look at the following Railscasts:
"Declarative Authorization" - http://railscasts.com/episodes/188-declarative-authorization
"Authorization with CanCan" - http://railscasts.com/episodes/192-authorization-with-cancan
"PayPal Express Checkout" - http://railscasts.com/episodes/146-paypal-express-checkout
"Integrating Active Merchant" - http://railscasts.com/episodes/145-integrating-active-merchant
Hope this helps!
You would also need subdomain routes, for restricting your user into its own subdomain.

Resources