I've been working on something like this for Ruby on Rails in case anyone is interested. It has multitenancy, billing separate for each tenant, automatic query filtering for the current tenant, etc. https://jumpstartrails.com
I 2nd https://jumpstartrails.com . I purchased the "Unlimited Site License", and it is well worth it.
Ask HN: How come there is no example code for B2B-SaaS apps?
41–50 of 94 posts
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#42http://abp.io/ is probably the best open source one I've seen. They also offer a paid product which is fairly comprehensive. I don't quite like their frontend stuff but the backend side of things is definitely what you're looking for. There are plenty of paid products in every language which are basically B2B SaaS templates. ABP, bullettrain, Laravel etc.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#43Try this https://saasstartupkit.com/ built in Golang. My company has used it for a proof of concept as it definitely is built around b2b multi-tenancy. Good starting point for us at the time.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#44Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#45In my experience, a lot of projects start off with shared tenancy (using a tenant id discriminator in the database) and eventually migrate to completely separate schema for each tenant (i.e. a separate “installation” of a single-tenancy app for each tenant) to avoid security and architectural pitfalls. Once you’ve done that, you don’t have to worry about forgetting a `WHERE tenantId = foo` somewhere and leaking data.…
And then providing enterprise service for large companies that want their own installation.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#46In my experience, a lot of projects start off with shared tenancy (using a tenant id discriminator in the database) and eventually migrate to completely separate schema for each tenant (i.e. a separate “installation” of a single-tenancy app for each tenant) to avoid security and architectural pitfalls. Once you’ve done that, you don’t have to worry about forgetting a `WHERE tenantId = foo` somewhere and leaking data.…
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#47In my experience, a lot of projects start off with shared tenancy (using a tenant id discriminator in the database) and eventually migrate to completely separate schema for each tenant (i.e. a separate “installation” of a single-tenancy app for each tenant) to avoid security and architectural pitfalls. Once you’ve done that, you don’t have to worry about forgetting a `WHERE tenantId = foo` somewhere and leaking data.…
WHERE tenantId = foo You only need to do that if you keep multiple tennants in one table. But who does this? Usually in a multi tennant application you have only one line which connects to the tennants DB and thats it. The rest of the code does not have to think about tennants.
Everyone below a certain scale. Or when it just makes more sense, like Proboards' free tier.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#48I've been working on something like this for Ruby on Rails in case anyone is interested. It has multitenancy, billing separate for each tenant, automatic query filtering for the current tenant, etc. https://jumpstartrails.com
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#49For example, in saas, if you have a serious product then you'll soon find that some of your tenants want to use SSO. So you need not only the stuff you mentioned already but also admin screens for setting up e.g saml for individual tenants. Add that to your points and you don't need sample code, you need a whole product (we use keycloak, there are plenty of other options).
As to billing, that's a whole gigantic separate area and again something where you don't want sample code, you want a complete product (I have heard jbilling talked of favorably).
In short, the problem space is too big to be addressed with some sample code.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#50If you are doing Rails by any chance this is just what you need. https://leanpub.com/multi-tenancy-rails-2