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:
- 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?
- Develop a Standard Application, where the same application connects to database and render the views, where the logic will be on Models and Controllers.
- Other approach? (I think using microservices in this stage, will be cumbersome.
Based on that approaches, I've some questions.
In 1st case:
- 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?
- 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".