{"id":19023232,"url":"https://github.com/phildl/remix-turso-multitenant","last_synced_at":"2025-04-23T08:44:33.035Z","repository":{"id":233597136,"uuid":"786934004","full_name":"PhilDL/remix-turso-multitenant","owner":"PhilDL","description":"(wip) Remix Turso SaaS multi-tenant starter","archived":false,"fork":false,"pushed_at":"2024-05-31T14:17:34.000Z","size":934,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T22:10:22.656Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilDL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-15T15:22:28.000Z","updated_at":"2025-03-05T16:19:20.000Z","dependencies_parsed_at":"2024-04-22T03:47:16.228Z","dependency_job_id":"9793328b-6e7f-4cf1-be7b-162ab26878c3","html_url":"https://github.com/PhilDL/remix-turso-multitenant","commit_stats":null,"previous_names":["phildl/remix-turso-multitenant"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilDL%2Fremix-turso-multitenant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilDL%2Fremix-turso-multitenant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilDL%2Fremix-turso-multitenant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilDL%2Fremix-turso-multitenant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilDL","download_url":"https://codeload.github.com/PhilDL/remix-turso-multitenant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250401011,"owners_count":21424493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T20:29:10.051Z","updated_at":"2025-04-23T08:44:32.997Z","avatar_url":"https://github.com/PhilDL.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remix-turso-multitenant\n\nThis is not working for now, (15/04/2024):\n\n- [❌] trying to migrate (or even connecting) the Turso \"schema\" DB with drizzle gives error 500\n\n## Prerequesite\n\nWe should have a Turso gourp\n\n```sh\nturso group create multenant\n```\n\nYou will also have a region at that point, set theses values in the `.env`\n\n```sh\nTURSO_APP_GROUP=multenant\nAPP_PRIMARY_LOCATION=sin\n```\n\n### Create the global/service database\n\n```bash\nturso db create service-db --group multenant\nturso db tokens create service-db\n```\n\nThis will give you a token that you should put in your .env\n\n```sh\nTURSO_DB_AUTH_TOKEN=my-new-token\n```\n\nDisplay the URL by running that command\n\n```sh\nturso db show --url service-db\n```\n\nAnd store it in the .env\n\n```sh\nTURSO_DB_URL=libsql://service-db-phildl.turso.io\n```\n\nMigrate that db\n\n```\npnpm drizzle:migrate\n```\n\n### Create the tenant database schema db\n\n```bash\nturso db create multenant-schema-db --group multenant --type schema\nturso db show --url multenant-schema-db\n```\n\nAnd store it in the .env\n\n```sh\nTURSO_SCHEMA_DB_NAME=multenant-schema-db\nTURSO_SCHEMA_DB_URL=libsql://multenant-schema-db-phildl.turso.io\n```\n\n❌ At that point unfortunately we need to do manual migration of the schema-db\n\n```sh\nturso db shell multenant-schema-db\n```\n\nThen manually enter the migraitons in `drizzle/migrations-tenants`\n\n### Turso API\n\n```sh\nturso auth api-tokens mint multenant\n```\n\nAnd store the token in the .env\n\n```sh\nAPP_NAME=multenant\nTURSO_API_TOKEN=new-api-token\nTURSO_API_URL=https://api.turso.tech\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphildl%2Fremix-turso-multitenant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphildl%2Fremix-turso-multitenant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphildl%2Fremix-turso-multitenant/lists"}