Deploy the backend folder as a separate project.
You need to set the following Environment Variables in Vercel for the Backend project:
| Variable | Description | Example Value |
|---|---|---|
MONGO_URI |
Connection string for your MongoDB database (e.g., MongoDB Atlas). | mongodb+srv://user:pass@cluster.mongodb.net/dbname |
JWT_SECRET |
A secret key used to sign authentication tokens. | mysecretkey123 |
- Import the repository in Vercel.
- Set Root Directory to
backend. - Add the Environment Variables listed above.
- Deploy.
- Copy the Deployment URL (e.g.,
https://primetrade-backend.vercel.app).
Deploy the frontend folder as a separate project.
You need to set the following Environment Variable in Vercel for the Frontend project:
| Variable | Description | Example Value |
|---|---|---|
VITE_API_URL |
The URL of your deployed Backend API. | https://primetrade-backend.vercel.app/api |
- Import the repository in Vercel.
- Set Root Directory to
frontend. - Add the Environment Variable
VITE_API_URLwith your backend URL. - Deploy.
- Create a free account on MongoDB Atlas.
- Create a new Cluster.
- Create a Database User (Username/Password).
- Allow Network Access (IP Address
0.0.0.0/0to allow Vercel to connect). - Get the Connection String (Driver: Node.js) and use it as
MONGO_URI.