To-Do App implemented using NodeJS and MongoDB based on the tutorial at https://medium.com/@diogo.fg.pinheiro/simple-to-do-list-app-with-node-js-and-mongodb-chapter-1-c645c7a27583.
Navigate to https://peaceful-dusk-53180.herokuapp.com/ in a web browser.
- Clone the repository.
- Install dependencies from NPM:
npm install
-
Create and configure the database by following the instructions in the tutorial:
- Create a MongoDB Atlas account.
- Create a cluster named
todo
on the free tier. - Add the IP address
0.0.0.0/0
to the allowlist. - Create a new username/password for the cluster.
- Get the connection string.
- Set the connection string in
./.env
, replacing the<username>
and<password>
parts:
DB_CONNECT=mongodb+srv://<username>:<password>@todo.qhddaeu.mongodb.net/?retryWrites=true&w=majority
Start the web server and connect to the database by running the following in a terminal:
npm start
- Create Heroku account
- Install Heroku CLI:
brew tap heroku/brew && brew install heroku
- Login to the CLI:
heroku login
- Run app locally:
heroku local web
- Deploy the app:
heroku create
git push heroku main
-
Add
DB_CONNECT
config variable in the Heroku dashboard for the project. -
Check the logs:
heroku logs --tail