Skip to content

Commit 12bb3fd

Browse files
committed
feat(supabase): integrate Supabase user fields and SDK
- Add supabaseUserId and supabaseUserData columns to User model and database - Create unique index on supabaseUserId for User table - Update Prisma schema and generated client to support new Supabase fields - Add @supabase/supabase-js dependency and related packages at version 2.89.0 - Include Supabase configuration variables in example.env - Update package version to 0.43.1 and synchronize lockfile accordingly - Fix import of process module in generated Prisma client code
1 parent 0cb64b2 commit 12bb3fd

File tree

22 files changed

+1008
-66
lines changed

22 files changed

+1008
-66
lines changed

web/example.env

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ MY_DASHBOARD_DATABASE_POSTGRES_URL=postgres://postgres:mydashboardpassword@local
55
MY_DASHBOARD_TELEGRAM_AUTH_BOT_NAME=
66
MY_DASHBOARD_TELEGRAM_AUTH_BOT_TOKEN=
77
MY_DASHBOARD_API_URL=http://localhost:5173
8-
MY_DASHBOARD_PRETTY_LOGS=true
8+
MY_DASHBOARD_PRETTY_LOGS=true
9+
10+
# Supabase Configuration
11+
SUPABASE_URL=
12+
SUPABASE_ANON_KEY=

web/package-lock.json

Lines changed: 107 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@picocss/pico": "^2.1.1",
5252
"@prisma/adapter-pg": "^6.18.0",
5353
"@prisma/client": "^6.19.0",
54+
"@supabase/supabase-js": "^2.89.0",
5455
"@trpc/client": "^10.45.2",
5556
"@trpc/server": "^10.45.2",
5657
"@zxing/browser": "^0.1.5",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- Add supabaseUserId and supabaseUserData columns to User table
2+
ALTER TABLE "User" ADD COLUMN "supabaseUserId" TEXT;
3+
ALTER TABLE "User" ADD COLUMN "supabaseUserData" JSONB;
4+
5+
-- Create unique index for supabaseUserId
6+
CREATE UNIQUE INDEX "UQ_USER_SUPABASE" ON "User" ("supabaseUserId");

web/prisma/schema.prisma

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ model User {
2626
anonymousId String?
2727
telegramUserId String?
2828
telegramUserData Json?
29+
supabaseUserId String?
30+
supabaseUserData Json?
2931
isBlackTheme Boolean?
3032
createdAt DateTime @default(now())
3133
updatedAt DateTime @default(now())
3234
Session Session[]
3335
Dashboard Dashboard[]
3436
35-
@@unique([telegramUserId], map: "UQ_USER")
37+
@@unique([telegramUserId], map: "UQ_USER_TELEGRAM")
38+
@@unique([supabaseUserId], map: "UQ_USER_SUPABASE")
3639
}
3740

3841
model Session {

web/src/app/generated/prisma/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* 🟢 You can import this file directly.
1111
*/
1212

13-
import * as processLocal from 'node:process'
13+
import * as process from 'node:process'
1414
import * as path from 'node:path'
1515
import { fileURLToPath } from 'node:url'
1616
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))

0 commit comments

Comments
 (0)