We are using Supabase to host our database.
Postgres Supabase Database
Every project is a full Postgres database, the world's most trusted relational database.
- 100% portable
- Built-in Auth with RLS
- Easy to extend
- Easy to extend
Why Supabase ?
Supabase is a modern PostgreSQL database platform that provides a lot of features out of the box. It is a great choice for a saas application.
Here are our favorite features :
Feature | Description |
---|---|
✨ Row Level Security | RLS allows you to control access to your database based on the user's role. |
Api REST | Supabase provides a REST API to access and edit your database. |
Hosting | Supabase Cloud provides affordable pricing and a free tier, perfect when you are just starting. |
Open Source | If you want to host your own database, you can host it yourself as Supabase is open source. |
Web client | You can view and edit your database in a Supabase Studio, a web interface to manage your database. |
Authentication | Supabase provides a built-in authentication system with many oAuth providers. |
Much more... | Version management, test, realtime database, bucket storage, etc... |
Most of all, Supabase, is built on top of PostgreSQL, giving you a huge flexibility and efficiency to manage your data.
sql
is a language built to efficiently handle a huge amount of data.
sql
allows you to set more than tables and constraints. You can define functions, triggers, views, enums, etc...
Defining as much logic as possible using sql
, you highly simplify your application logic. As all the data checking, control access, coercing, etc... are done by the database.
Project structure
By default, we have single database by monorepo. As the core of an appplication is its data, and the web/mobile/etc applications are closer to entry points to access and edit your data.
File/Folder | Description |
---|---|
migrations | All migrations files. Do not touch, they are automatically generated using creatorem or supabase tools. |
schemas | The most important files. Contains all the data logic declaration, tables, relations, etc... |
env-schemas | That files contains examples of tables definition that you might use in your products. Can be used in dev environment to generate migrations. |
tests | Supabase test files. |
.env | The environment variables for the database. |
config.toml | The config file for the database. Allow you to configure the supabase database on environment variables. For example, you can set oAuth providers here. |
seed.sql | To seed the database with some data. |
Migration generation
To assemble the migration file, you can use the following command :
If you start with an empty project, you may want example tables to see all the kit power in action.
You can also create your migration with the example booking.sql
file in the supabase/env-schemas
folder using the following command :
Commands
Start
First, make sure that docker is running.
Stop
Test
Reset
The reset command will rebuild the migration file and recreate a new empty database instance.
If you want to reset with the example booking.sql
schema, you can use the following command :
Types generation
The previous supabase
commands where close to a ordinary supabase
cli usage. But this command also generate the drizzle declaration files and extra types.
For that reason, we do not advise to use the supabase gen types typescript
, from the supabase
cli command.
That command will :
- generate the
supabase
types in thekit/db/core/src/database.types.ts
file. - generate the
drizzle
declaration files in the@kit/drizzle/src/drizzle/
package. - create extra types in the
@kit/drizzle/src/tables.ts
file to improve a cleaner development experience.
We are using the drizzle
client in web applications because it offers better type checking and better autocompletion than the supabase
client.
We are working to use it also on native applications. But supabase
ecosystem is not fully compatible with mobile app and PostgresQL database yet.
Dump
Deploy
All the scripts commands from the the root `package.json` file.
The only authentication documentation page you need if you just want to setup the dashboard application.
How is this guide?
Last updated on 10/17/2025