Skip to content

Commit 9f1b97c

Browse files
authored
Added instructions to set up backend (#102)
1 parent 602ec87 commit 9f1b97c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,51 @@ git push origin <your_branch_name>
126126
- Celebrate 🥳 your success after your pull request is merged successfully.
127127
<p align="right">(<a href="#top">back to top</a>)</p>
128128

129+
# Backend Setup Instructions
130+
131+
132+
1. Ensure Node.js and npm are installed on your system. You can verify installation by running:
133+
```
134+
node -v
135+
npm -v
136+
```
137+
138+
2. Navigate to the backend directory:
139+
```
140+
cd server
141+
```
142+
143+
3. Install the required dependencies:
144+
```
145+
npm install
146+
```
147+
148+
4. Create a .env file in the backend root directory and add your environment variables. Here's an example structure:
149+
```
150+
MONGO_URI="mongodb+srv://<your_mongo_db_url>.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
151+
SECRET_KEY="THIS_IS_A_JWT_SECRET"
152+
```
153+
154+
5. Start the backend server using nodemon:
155+
```
156+
nodemon api/index.js
157+
```
158+
159+
This will start the server in development mode. By default, it will run on http://localhost:3000.
160+
161+
Test the API endpoints using tools like Postman or Thunder Client.
162+
163+
Now for vercel Deployment:
164+
1. Login into vercel account
165+
2. Click on add project
166+
3. select `server` as root directory
167+
4. add this add env vars
168+
```
169+
MONGO_URI="mongodb+srv://<your_mongo_db_url>.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
170+
SECRET_KEY="THIS_IS_A_JWT_SECRET"
171+
```
172+
And server will deployed on vercel
173+
129174
<!-------------------------------------------------->
130175

131176
<h2>Contributing Guidelines📑</h2>

0 commit comments

Comments
 (0)