d892b3f64f
Deploy to route.crispygoat.com / deploy (push) Failing after 9s
Phase 1 — Pattern library - Add src/lib/api.ts (typed PostgREST client, anon-key) - Add src/lib/svc-fetch.ts (service-role fetch + PostgREST client) - Add src/lib/db-types.ts (Database generic, RowOf helper) - Add src/lib/auth-admin.ts (better-auth admin wrappers: createUser, listUsers, removeUser, requestPasswordReset, validateSession) Phase 2 — Server action migration - Migrate all 67 server actions off @supabase/supabase-js to svcApi/svcRpc - Replace service.auth.admin.* with authAdmin.* (better-auth) - Replace publicApi.auth.* with authAdmin.* (better-auth) - Add typed single() null guards + nullable column fallbacks Phase 3 — Delete mock data + debug routes - Remove if(useMockData) branches from 7 files (-226 lines) - Delete src/lib/mock-data.ts (no longer referenced) - Delete 7 debug API routes (debug-admin-users, debug-auth, debug-cookie, debug-env, debug-get-admin-users, debug-hello, debug-me) Phase 4 — Hard cut - Delete src/lib/supabase.ts (orphan — no importers) - Delete src/app/api/supabase + src/app/api/supabase-test routes - Remove @supabase/ssr + @supabase/supabase-js from package.json - Rename env vars: NEXT_PUBLIC_SUPABASE_URL → NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY → NEXT_PUBLIC_API_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY → POSTGREST_SERVICE_KEY Phase 5 — Verify - npx tsc --noEmit: 0 errors - npm run lint: 0 new errors from migration (104 pre-existing errors unrelated) - npm run build: same failure mode as main worktree (PostgREST-dependent prerender), no regression Net: 158 files changed, +1640 / -1903 lines (-263 net)
35 lines
1.3 KiB
Bash
35 lines
1.3 KiB
Bash
# --- Self-hosted Postgres (Docker) ---
|
|
POSTGRES_USER=routecommerce
|
|
POSTGRES_PASSWORD=routecommerce_dev_password
|
|
POSTGRES_DB=route_commerce
|
|
# Used by the app and push-migrations.js to talk to the local DB
|
|
DATABASE_URL=postgresql://routecommerce:routecommerce_dev_password@127.0.0.1:5432/route_commerce?schema=public
|
|
|
|
# --- PostgREST (REST API) ---
|
|
# Server actions call `${NEXT_PUBLIC_API_URL}/rest/v1/rpc/...`
|
|
# Point that URL at the local PostgREST container. Anon key can be anything
|
|
# non-empty since we handle auth at the app layer (Better Auth + dev_session).
|
|
NEXT_PUBLIC_API_URL=http://localhost:3001
|
|
NEXT_PUBLIC_API_ANON_KEY=local-postgrest-anon-key
|
|
POSTGREST_SERVICE_KEY=local-postgrest-service-key
|
|
|
|
# --- MinIO (S3-compatible object storage — replaces Supabase Storage) ---
|
|
MINIO_ROOT_USER=routecommerce
|
|
MINIO_ROOT_PASSWORD=miniochangeme123
|
|
STORAGE_ENDPOINT=http://localhost:9000
|
|
STORAGE_REGION=us-east-1
|
|
STORAGE_ACCESS_KEY=routecommerce
|
|
STORAGE_SECRET_KEY=miniochangeme123
|
|
STORAGE_BUCKET_PREFIX=
|
|
# Public base URL for image rendering in <img src=...>
|
|
NEXT_PUBLIC_STORAGE_BASE_URL=http://localhost:9000
|
|
|
|
# --- Better Auth ---
|
|
BETTER_AUTH_SECRET=REPLACE_ME_WITH_OPENSSL_RAND_HEX_32
|
|
BETTER_AUTH_URL=http://localhost:3000
|
|
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
|
|
|
|
# --- App secrets ---
|
|
MINIMAX_API_KEY=
|
|
MINIMAX_BASE_URL=
|