A back-end project that serves apis for your to-do apps. Stack: MongoDB + Node.js + Express.js
- Check the Postman api documentation here.
- You can use this to create your frontend todo applications.
- Users can signup, create tasks, update them and close them once finished. They can also maintain their profiles (including avatars).
- Authentication using JWT, so users can login from multiple devices and at any time signout from one or all devices.
- Note: On creating a user(signup) or login, you will recieve a json-web-token. All the other api-end points are subject to authorization. Add following key-value pair in your request header to make them work:
key: Authorization
value: Bearer <YOUR_AUTH_TOKEN>
- Install MongoDB
- Install Node.js
- Clone this repository, create a directory
config
at root directory. Insideconfig
, create adev.env
file with following contents:
PORT=<PORT>
MONGODB_URL= <YOUR_MONGODB_URL>/<YOUR_DB_NAME>
JWT_SECRET=<YOUR_AUTH_SECRET>
- These keys are:
- PORT: Port on which you want the local server to run. (Generally
3000
) - MONGODB_URL: By default mongodb runs at localhost:
mongodb://127.0.0.1:27017/
- JWT_SECRET: The secret string you want to use to generate json-web-tokens. Read more here.
- PORT: Port on which you want the local server to run. (Generally
- Run
npm install
to install dependencies and devDependencies. - Run
npm run dev
.