{"repo":"miloudi9/sveltekit-multi-tenancy","free":true,"listed":false,"github":"https://github.com/miloudi9/sveltekit-multi-tenancy","clone":"git clone https://github.com/miloudi9/sveltekit-multi-tenancy.git","description":"Multi-tenancy demo with one database per tenant and (sub)domain routing","language":"Svelte","stars":75,"topics":["database-per-tenant","multi-tenancy","vanity-domain","cloudflare-workers","sveltekit","turso","cloudflare-for-saas"],"license":null,"category":"databases-storage","readme_excerpt":"Multi-Tenant SvelteKit Web App This project is a SaaS web application built with SvelteKit, showcasing a multi-tenancy implementation using Turso for database management and Cloudflare for hosting and domain management. Features - Multi-tenancy with one database per tenant using Turso Multi-DB Schemas - Subdomain per tenant, achieved by wildcard subdomain and SvelteKit hooks - Custom tenant domain with auto SSL using Cloudflare for SaaS - Tenants can download their entire database dump. Reference - Deployed on Cloudflare Workers Prerequisites Before you begin, ensure you have the following: - Node.js and pnpm installed. - Turso CLI installed. Docs. - An apex domain connected to Cloudflare. Environment Variables For development copy .env.example to .env , For build and production, export the environment variables to the build environment. If that's Cloudflare Workers, add them to build environment. How to obtain the environment variables: 1. TURSO PLATFORM AUTH TOKEN : Run turso auth api-tokens mint . This token allows you to create new databases for tenants. 2. TURSO GROUP AUTH TOKEN : Run turso group tokens create . This token allows you to access all the databases in TURSO GROUP NAME . 3. TURSO CENTRAL DATABASE URL : Create a central database in Turso and use the provided URL, Command turso db create . This database manages all the tenants including their domains and subdomains. This is where you would track usage for subscription and allow/disallow/limit features if this w","default_branch":null,"files":null,"tree":[],"storefront":"/r/miloudi9","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/miloudi9/sveltekit-multi-tenancy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}