Sveltekit Multi Tenancy

screenshot of Sveltekit Multi Tenancy
svelte
vite
tailwind
drizzle-orm

Multi-tenancy demo with one database per tenant and (sub)domain routing

Overview

The Multi-Tenant SvelteKit Web App represents a modern approach to building SaaS solutions by leveraging SvelteKit for the frontend and Turso for database management. This application is designed to handle multiple tenants efficiently by utilizing a unique database and subdomain structure for each user. With a focus on scalability and ease of use, it showcases a well-integrated system that can cater to various business needs.

What stands out about this web app is its seamless integration with Cloudflare, allowing for custom tenant domains with automatic SSL certificates. This means each tenant can enjoy a dedicated space without the technical hassles typically associated with SaaS deployments. The capabilities offered make it a robust choice for developers looking to create multi-tenant applications while ensuring a smooth user experience.

Features

  • Multi-tenancy Support: Implements a unique database per tenant using Turso Multi-DB Schemas, ensuring isolated and secure data management.
  • Wildcard Subdomains: Automatic generation of subdomains for each tenant, managed efficiently through SvelteKit hooks.
  • Custom Domain Management: Tenants can set up their own unique domain with auto SSL provisioned by Cloudflare.
  • Database Dump Capability: Each tenant has the option to download their entire database, allowing for easy data management and backup.
  • Cloudflare Deployment: Fully deployed on Cloudflare Workers, providing fast and reliable hosting solutions.
  • Environment Variable Handling: Clear structure for setting up necessary environment variables, making deployment straightforward.
  • Turso Integration: Facilitates easy creation and management of databases and access tokens, streamlining the onboarding process for new tenants.
svelte
Svelte

Svelte is a modern front-end framework that compiles your code at build time, resulting in smaller and faster applications. It uses a reactive approach to update the DOM, allowing for high performance and a smoother user experience.

vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

drizzle-orm
Drizzle ORM

Drizzle ORM is a TypeScript ORM for SQL databases designed with maximum type safety in mind. It comes with a drizzle-kit CLI companion for automatic SQL migrations generation. Drizzle ORM is meant to be a library, not a framework. It stays as an opt-in solution all the time at any levels.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.