How could I create a multi-tenant application with the T3 stack?

Hi, I want to build a new startup, and I am feeling a little bit lost as to where to start. I know generally what I want to build, but honestly I feel like I get stuck on some problems I want to build a product that has two main areas: 1. A SaaS shop (many apps in the marketplace that you can pay monthly via stripe to access). For this part of the application, users will be able to create "Workspaces", or teams where you can share your data with your team. You will be able to work using the software you purchased and add people to it (maybe there could be multiple prices for each product, depending on number of active users) 2. A second "space" for the application, where I can only give access for it to certain people (say a company tenant). Basically, enable me to quickly spin up a new environment, and maybe even have its separate UI for this company. I would talk to a company and build a software for them on demand. I want to make sure that only people from the company have access to it etc. This part of the website will be strictly built for companies, or for tenants (multiple people) that want to have their own personal software that I would build on demand. I could make this software as resellable as possible, for other similar users that would want this software. I could then, whenever asked by another party, spin up a separate Tenant area, where only they will have access, and maybe change a few things depending on the client's needs. Basically, I want one area of the website (main url) to be accessed by anyone. There, you may log in, create a workspace and have multiple people join your workspace. There may be a few free apps, and then, apps where you subscribe to, in a monthly manner via stripe. This area, must have nothing to do with this second area of the app, where there will be multi environments for multiple tenants
5 Replies
Gabriel
GabrielOP2y ago
I am sorry for this super long post. Building something like this would be a dream of mine accomplished. I want to basically have one auth system (preferrably NextAuth), one multi-currency system, one multi-language system, where it will be so easy to simply spin up a new software to sell to anyone, any company, any person... Build it all in typescript and react, trpc. I feel like I have a lot to study, but I want to start building. I don't know enough about multi-tenancy and I feel lost on how this could be accomplished. I love the T3 stack and would love to build it all with it (btw I am using postgresql. I've heard that some people use multiple schemas for different tenants. I am still investigating this)
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
adiguno
adiguno2y ago
So, a role based auth guard for 2 pages? I think you’ll need to break this down into more digestible, well defined pieces Start with some basic user flows and break down each component so you can prioritize Also, if you’re serious about startup, I’d also suggest talking to your target users first… otherwise, you’ll still learn
Gabriel
GabrielOP2y ago
I was thinking same db, same app I plan on doing that
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server