This is a course from Open Classroom. The goal is to learn how to use the backend framework of Node.js including Express and MangoDB.
After clonning the project you must run the frontend app:
cd frontend
npm install
npm run start
In the beginning you must set your database Mango DB:
- Create an account for free on Mango DB
- Create a cluster with free options AWS.
- When you create your login profile choose connection with password and choose the privileges: read and write to any database (
Database access
tab) - On
Network access
tab click onAdd IP Address
and authorize access from anywhere (Add access from Anywhere). - From MongoDB Atlas, on
Cluster
tab, click on theConnect
button, then click onDrivers
. - Select the Driver Node.js.
- Add your connection string in the file backend/app.js at the line 9.
- Exemple:
mongodb+srv://<username>:<db_password>@cluster0.cqynq.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
- Exemple:
- Replace
<db_password>
with your password and<useranme>
by your database user.
In the backend you need to install some packages:
cd backend
sudo npm install mongoose
sudo npm install -g nodemon
sudo npm install --save express
sudo npm install --save mongoose-unique-validator
sudo npm install --save bcrypt
sudo npm install --save jsonwebtoken
sudo npm install --save multer
Now you can start the backend server:
cd backend
nodemon server