Skip to content

Commit d028fb5

Browse files
Adjusted to include CI
1 parent ed1d735 commit d028fb5

File tree

1 file changed

+71
-11
lines changed

1 file changed

+71
-11
lines changed

README.md

+71-11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
* [GitHub Actions](#github-actions)
3535
* [Secrets Configuration](#secrets-configuration)
3636
* [Production Deployment](#production-deployment)
37+
* [CI (GitHub Actions) Setup for Production Deployment](#ci-github-actions-setup-for-production-deployment)
38+
* [Post-Deployment Configuration](#post-deployment-configuration)
3739
* [Makefile](#makefile)
3840
* [Important Considerations](#important-considerations)
3941
* [Contributing](#contributing)
@@ -322,14 +324,7 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
322324
1. **Deploying the Frontend**
323325
- Click the **Frontend** button above to start the deployment process.
324326
- 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).
333328

334329
### Backend Deployment
335330

@@ -346,9 +341,74 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
346341
- **ACCESS_SECRET_KEY**, **RESET_PASSWORD_SECRET_KEY**, **VERIFICATION_SECRET_KEY**
347342
- 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.
348343

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.
350410

351-
2. **Post-Deployment Configuration**
411+
### Backend
352412
- Access the **Settings** page of the deployed backend project.
353413
- Navigate to the **Environment Variables** section and update the following variables with secure values:
354414

@@ -366,7 +426,7 @@ VERIFICATION_SECRET_KEY: The secret key for email or user verification.
366426

367427
- For detailed instructions on how to set these secret keys, refer to the section on [Setting up Environment Variables](#setting-up-environment-variables).
368428

369-
3. **Database Connection**
429+
### Database Connection
370430

371431
1. **Choosing a Database**
372432
- 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

Comments
 (0)