Setting up Devise + Acts As Tenant + Scoped Subdomains

Recently, I decided to build a small app to support small business. It will include the basic features to start a business online. A simple website with forms and contacts, basic e-mail, basic CRM, etc. Im still thinking about the best way to do this, but for now, I'm going to start with the basics.

This app need to be multi-tenant and have subdomains scoped to each tenant (as clients).

App will be Monolit Rails, I chose Devise for authentication, subdomain scoping, Acts As Tenant for multi-tenancy.

This setup is ideal for SaaS applications where each client has their own subdomain, such as user1.domain.com and user2.domain.com.

Probably this is the fastest way to start, but I'm open to suggestions.

Here is the Github Gist