- Install docker, follow the official instructions here : https://docs.docker.com/engine/install/
- Open up your terminal or CLI
- Run this CLI command -> docker pull mongo
- Then, run this CLI command -> docker run -d --name {dbname} -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME={username} -e MONGO_INITDB_ROOT_PASSWORD={pass} mongo
- Remember to replace dbname, username, and pass with your actual dbname, username and pass. Without the curly brackets of course.
- To check if your docker container is created and is up and running, open up docker desktop or run this CLI command -> docker ps
- If the instance is running, connect to your mongodb instance using the dbname, username and pass that you have specified in step 4.
- Clone the repo to your local device.
- Check the .nvmrc file, ensure you have this version of node installed on your device.
- Run npm install to install all the dependencies of the project.
- Run npm run start to have start the express app
Nodemon is a package that allows hot reload, essentially when we make changes to our code, we don't have to stop and run the app again. Nodemon will automatically detect a change and refresh the app for us, a very nice quality of life feature to have.
Mongoose is a package to handle a mongodb database, the package allows us to :
- Connect to our mongodb database
- Define schemas for our tables / collections
- Allow us to interact with our databse via mongodb operations