This is the backend REST API for the TODO App. This API is built using Node
, Express
and Mongoose
frameworks and deployed in Heroku and the frontend is deployed in Netlify
For development, you need to have Git Node JS and MongoDB installed on your local machine either yarn or npm package manager of your choice
-
Just go on official Node.js website and download the installer. Also, be sure to have
git
available in your PATH,npm
might need it (You can find git here). -
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node -v
v14.5.0
$ npm -v
6.14.8
- Mongodb installation steps can be found in the official MongoDB website
To update npm to its latest version run the follow command
$ npm install npm -g
After installing node, this project will need yarn too, so just run the following command.
$ npm install -g yarn
$ git clone https://github.com/nirmal1064/todo-rest-api
$ cd todo-rest-api
$ yarn install
or if you use npm
$ npm install
Create a .env
file in the root directory of the project and copy the contents of .env.example
to .env
and replace the values accordingly
The .env
is ignored, so you never commit any sensitive information and it remains only in your local machine
Once the above steps are completed we can start the api.
$ mongod # to start the local mongodb instance
$ yarn dev # to start the api in dev mode
$ yarn test # to run the test cases
$ yarn test:watch # to run the test cases in interactive mode
That's All! Feel free to raise an issue if anything goes wrong.
1. Add User authentication for creating personalized TODOs
2. Increasing code converage