Replies: 5 comments 7 replies
-
Hi, were you able to find any answers to this? |
Beta Was this translation helpful? Give feedback.
-
Am I right that we can just use domain, an Id of the resource we need to serve? For example, if we make multi-tenant restaurant menu, we check domain in |
Beta Was this translation helpful? Give feedback.
-
How'd you go with this? I managed multi-tenancy myself, using domains. |
Beta Was this translation helpful? Give feedback.
-
Svelte itself doesn't need any special multi-tenant or multi-domain feature. Create a single data-driven SvelteKit website that services all your customers, a single database as well, and logically partition customer data by their website's hostname. In export async function load({url}: LayoutServerLoadEvent) {
// Load customer-specific website data by url.host Then all you need to do is make this horizontally scalable, which is beyond the scope of this discussion. |
Beta Was this translation helpful? Give feedback.
-
I know this is old, but here is how i did it in src/hooks.ts, so that tenant.mydomain.com reroutes to mydomain.com/subsite/[tenant] without the user seeing. Then you can catch the tenant param like you would normally in sveltekit with $page or in +page.server.ts load function: I imagine there is a simpler way (hopefullly without the regex) but this works for me
|
Beta Was this translation helpful? Give feedback.
-
As a student building his capstone project, I wanted to reach for SvelteKit as it was something I used this summer to build a co-op web app. However, this current project needs multi tenant functionality. I have no idea where to start when tackling this with SvelteKit and there is a distinct lack of information about how to do it on the web.
So far, I'm using SvelteKit, Vercel, and Supabase. If you can think of a good reason to replace Supabase, it's the only part of the stack I'm not totally set on, so feel free to give me your input.
I did stumble upon this Next.js + Vercel starter kit for multi-tenancy, however I'm not quite confident enough in my skills to say I could, myself, apply this to a SvelteKit + Vercel app. I'm wondering if anyone has done this in the past and can point me to a repo to see how it's been implemented. Or, if you have a good web resource that explains how to do it, I'm all ears.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions