Skip to content

Commit 7e2dcd3

Browse files
add script for the supabase setup
1 parent 9231072 commit 7e2dcd3

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ Then:
8181
Set the following Vercel environment variables:
8282

8383
```
84-
VITE_SUPABASE_PROJECT_URL=""
85-
VITE_SUPABASE_ANON_KEY=""
86-
VITE_ANEDYA_API_KEY=""
8784
VITE_APP_NAME=""
85+
VITE_ANEDYA_API_KEY=""
86+
VITE_SUPABASE_ANON_KEY=""
87+
VITE_SUPABASE_PROJECT_URL=""
8888
```
8989

9090
### Step 6: Run first-time setup
@@ -138,16 +138,32 @@ This repo uses Husky to run `npm run scan:secrets` before every commit.
138138

139139
### Manual Database Setup (CLI)
140140

141-
If you don't want to use GitHub Actions, you can push the automated database setup manually using the Supabase CLI:
141+
If you don't want to use GitHub Actions, you can push the database setup manually using the Supabase CLI.
142+
143+
> **Note:** Ensure you have installed the project dependencies first via `npm install`.
144+
145+
#### 1. Log in to your Supabase account
146+
147+
```bash
148+
npm run supabase:login
149+
```
150+
151+
#### 2. Link to your specific project
152+
153+
```bash
154+
npx supabase link --project-ref YOUR_SUPABASE_PROJECT_REF
155+
```
156+
157+
#### 3. Run database migrations
158+
159+
```bash
160+
npm run supabase:push
161+
```
162+
163+
#### 4. Deploy all Edge Functions (create-user, delete-user, setup-admin)
142164

143165
```bash
144-
npm install -g supabase
145-
supabase login
146-
supabase link --project-ref YOUR_SUPABASE_PROJECT_REF
147-
supabase db push
148-
supabase functions deploy create-user --no-verify-jwt
149-
supabase functions deploy delete-user --no-verify-jwt
150-
supabase functions deploy setup-admin --no-verify-jwt
166+
npm run supabase:deploy-funcs
151167
```
152168

153169
## 🛠 Tech Stack

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"scan:secrets": "node scripts/scan-staged-secrets.mjs",
1313
"test": "vitest run",
1414
"test:watch": "vitest",
15-
"prepare": "husky"
15+
"prepare": "husky",
16+
"supabase:login": "supabase login",
17+
"supabase:deploy-funcs": "supabase functions deploy create-user --no-verify-jwt && supabase functions deploy delete-user --no-verify-jwt && supabase functions deploy setup-admin --no-verify-jwt",
18+
"supabase:push": "supabase db push"
1619
},
1720
"dependencies": {
1821
"@hookform/resolvers": "^3.10.0",

0 commit comments

Comments
 (0)