Skip to content

ironbyte/remix-turso-multitenant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remix-turso-multitenant

This is not working for now, (15/04/2024):

  • [❌] trying to migrate (or even connecting) the Turso "schema" DB with drizzle gives error 500

Prerequesite

We should have a Turso gourp

turso group create multenant

You will also have a region at that point, set theses values in the .env

TURSO_APP_GROUP=multenant
APP_PRIMARY_LOCATION=sin

Create the global/service database

turso db create service-db --group multenant
turso db tokens create service-db

This will give you a token that you should put in your .env

TURSO_DB_AUTH_TOKEN=my-new-token

Display the URL by running that command

turso db show --url service-db

And store it in the .env

TURSO_DB_URL=libsql://service-db-phildl.turso.io

Migrate that db

pnpm drizzle:migrate

Create the tenant database schema db

turso db create multenant-schema-db --group multenant --type schema
turso db show --url multenant-schema-db

And store it in the .env

TURSO_SCHEMA_DB_NAME=multenant-schema-db
TURSO_SCHEMA_DB_URL=libsql://multenant-schema-db-phildl.turso.io

❌ At that point unfortunately we need to do manual migration of the schema-db

turso db shell multenant-schema-db

Then manually enter the migraitons in drizzle/migrations-tenants

Turso API

turso auth api-tokens mint multenant

And store the token in the .env

APP_NAME=multenant
TURSO_API_TOKEN=new-api-token
TURSO_API_URL=https://api.turso.tech

About

(wip) Remix Turso SaaS multi-tenant starter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.4%
  • JavaScript 2.2%
  • Other 1.4%