You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -322,14 +324,7 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
322
324
1.**Deploying the Frontend**
323
325
- Click the **Frontend** button above to start the deployment process.
324
326
- During deployment, you will be prompted to set the `API_BASE_URL`. Use a placeholder value (e.g., `https://`) for now, as this will be updated with the backend URL later.
325
-
- Complete the deployment process.
326
-
327
-
2.**Post-Deployment Configuration**
328
-
- Navigate to the **Settings** page of the deployed frontend project.
329
-
- Access the **Environment Variables** section.
330
-
- Update the `API_BASE_URL` variable with the backend URL once the backend deployment is complete.
331
-
332
-
---
327
+
- Complete the deployment process [here](#post-deployment-configuration).
333
328
334
329
### Backend Deployment
335
330
@@ -346,9 +341,74 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
- You can temporarily set these secret keys as plain strings (e.g., `examplekey`) during deployment. However, you should generate secure keys and update them after the deployment in the **Post-Deployment Configuration** section.
348
343
349
-
- Complete the deployment process.
344
+
- Complete the deployment process [here](#post-deployment-configuration).
345
+
346
+
347
+
## CI (GitHub Actions) Setup for Production Deployment
348
+
349
+
### Prerequisites
350
+
1.**Create a Vercel Token**:
351
+
- Generate your [Vercel Access Token](https://vercel.com/account/tokens).
352
+
- Save the token as `VERCEL_TOKEN` in your GitHub secrets.
353
+
354
+
2.**Install Vercel CLI**:
355
+
```bash
356
+
pnpm i -g vercel@latest
357
+
```
358
+
3. Authenticate your account.
359
+
```bash
360
+
vercel login
361
+
```
362
+
### Frontend Setup
363
+
364
+
1. Link the nextjs-frontend Project
365
+
366
+
2. Navigate to the nextjs-frontend directory and run:
367
+
```bash
368
+
vercel link
369
+
```
370
+
3. Follow the prompts:
371
+
- Link to existing project? No
372
+
- Modify settings? No
373
+
374
+
4. Save Project IDs and Add GitHub Secrets:
375
+
- Open `nextjs-frontend/.vercel/project.json` and add the following to your GitHub repository secrets:
376
+
-`projectId` → `VERCEL_PROJECT_ID_FRONTEND`
377
+
-`orgId` → `VERCEL_ORG_ID`
378
+
379
+
### Backend Setup
380
+
381
+
1. Link the fastapi_backend Project
382
+
383
+
2. Navigate to the fastapi_backend directory and run:
384
+
```bash
385
+
vercel link --local-config=vercel.prod.json
386
+
```
387
+
- We have a special configuration than we need to set the --local-config value.
388
+
3. Follow the prompts:
389
+
- Link to existing project? No
390
+
- Modify settings? No
391
+
392
+
4. Save Project IDs and Add GitHub Secrets:
393
+
- Open `fastapi_backend/.vercel/project.json` and add the following to your GitHub repository secrets:
394
+
-`projectId` → `VERCEL_PROJECT_ID_BACKEND`
395
+
-`orgId` → `VERCEL_ORG_ID` (Only in case you haven't added that before)
396
+
397
+
### Notes
398
+
- Once everything is set up, simply run `git push`, and the deploy will automatically take place.
399
+
- Ensure you complete the setup for both the frontend and backend separately.
400
+
- Refer to the [Vercel CLI Documentation](https://vercel.com/docs/cli) for more details.
401
+
- You can find the project_id into the vercel web project settings.
402
+
- You can find the organization_id into the vercel web organization settings.
403
+
404
+
## **Post-Deployment Configuration**
405
+
406
+
### Frontend
407
+
- Navigate to the **Settings** page of the deployed frontend project.
408
+
- Access the **Environment Variables** section.
409
+
- Update the `API_BASE_URL` variable with the backend URL once the backend deployment is complete.
350
410
351
-
2.**Post-Deployment Configuration**
411
+
### Backend
352
412
- Access the **Settings** page of the deployed backend project.
353
413
- Navigate to the **Environment Variables** section and update the following variables with secure values:
354
414
@@ -366,7 +426,7 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
366
426
367
427
- For detailed instructions on how to set these secret keys, refer to the section on [Setting up Environment Variables](#setting-up-environment-variables).
368
428
369
-
3.**Database Connection**
429
+
### Database Connection
370
430
371
431
1.**Choosing a Database**
372
432
- You can use your own database hosted on a different service or opt for the [Neon](https://neon.tech/docs/introduction) database, which integrates seamlessly with Vercel.
0 commit comments