0

The Problem

I need to develop a Software-as-a-Service application, that will be used from our clients. The application contains a lot of forms (Company Application) using a step-by-step forms. They users will fill these forms, and see some progress.

The Company (our client), can have a view of they dashboard, showing they users, products and other informations, including company information and some customizations.

One thing that I'm trying to solve, it's: I need a subdomain for each of my client, and each User in Company, need to have a subdomain in Company.

For example, using the first approach (above), for example, what I'll have: API: .myapp.com/api/v1 Client Base Page (rendered by my application): .com (CNAME to somewhere) User Base Page (rendered by my application): ..com (CNAME to somewhere)

The things I can't figure how to do are:

  1. It's better to develop a REST API, use the standards for that, and create a separate Front-end application (using Angular, Ember or other frameworks). Then I deploy the API, get the link, and setup it on my Angular application. This is a good approach?
  2. Develop a Standard Application, where the same application connects to database and render the views, where the logic will be on Models and Controllers.
  3. Other approach? (I think using microservices in this stage, will be cumbersome.

Based on that approaches, I've some questions.

In 1st case:

  1. I think the best way for the API is to use a subdomain based on my startup domain, like: .mycompany.com/api/. This way, I can buy a wildcard SSL and secure the endpoint of each client. But what I see in applications like Stripe, it's using single endpoint, like: api.stripe.com with an EV SSL. So, both approaches are good and secure?
  2. What it's a good approach to render the Front-end? Based on fact that on the front-end will be wildcard subdomains for each user.

So, what it's a good way to develop that?

Background

I'm using Rails 4, and Postgres (for multi-tenancy database), and if needed, I can develop using Angular.js or "static views".

3 Answers 3

6
+25

For my current project I had similar requirements like you. I have decided to use a backend server exposing a REST API. And for the cleints I am using a nginx server, which handles the subdomains and hosting the AngularJS Application.

The server side checks which subdomain the client is using and sends the correct data to the client.

In my opinion the advantage of this approach is, that the communication could be easily encrypted with SSL (see Stripe).

Microsoft gives good information about SAAS architecture in following article: https://msdn.microsoft.com/en-us/library/aa479069.aspx

1
  • +1 for the reference, but I won't give the bounty because isn't complete Sep 23, 2015 at 14:36
0

Have you looked at the 'apartment' gem? I've never used it but I just watched a video on gorails.com that I think might help you. There's one using the gem and another one building it out from scratch.

1
  • This does not answer the question and reads more like a comment: please read How do I write a good answer?
    – user22815
    Sep 24, 2015 at 12:57
0

If you are planning to use Python, you can use Django to build SaaS application. This video Build SaaS application in Python django will explain about getting started with SaaS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.