Ask HN: How come there is no example code for B2B-SaaS apps?
11–20 of 94 posts
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#12Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#13What is the problem just build it your self. A simple template that has a login with a todo list can be extended to have a companies table. When you have added this, you can add a n to n relation between companies and users and poof you have a B2B saas app template.
I think the request is more for guidance about how to do it right.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#14https://github.com/userdashboard/dashboard
Dashboard powers the basic 'web app with registrations' and then using modules it can be supplemented with organizations, Stripe Subscriptions and Stripe Connect to standardize / reuse the "SaaS boilerplate". It runs parallel to your application server so you can use whatever stack you like. Users browse your Dashboard server URL and it proxies your application server for content.
The software is complete but it needs niceties like useful charts and information added to the UI and I'll be prioritizing that in the coming weeks. It's got a really nice documentation site being generated with Github Actions but it's not publishing correctly unfortunately, probably tomorrow that will be resolved.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#15What is the problem just build it your self. A simple template that has a login with a todo list can be extended to have a companies table. When you have added this, you can add a n to n relation between companies and users and poof you have a B2B saas app template.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#16Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#17Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#18I'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?
#19Once you’ve done that, you don’t have to worry about forgetting a `WHERE tenantId = foo` somewhere and leaking data. The actual code is shared (i.e. not installed separately or in separate processes) and you would simply use your dependency injection or equivalent to resolve the DB connection contingent on $user’s validated claims.
“Networking” or sharing entities across tenants becomes harder this way.. but purer/cleaner. You essentially create a federation layer and communicate across instances via a hard code wall (via network requests to yourself and an API) rather than “in memory” which is less efficient and requires a lot of boiler plate, but it’s going to be what you’re going to end up doing anyway.
Re: Ask HN: How come there is no example code for B2B-SaaS apps?
#20They also have a separate repo to help you run it: https://github.com/getsentry/onpremise