This repository contains backend made using node for Hackerearth Stackathon 1.0 challenge.. It uses mongoose API to connect to MongoDB which is used as database.
- node: v10.x
- npm: 6.9.0
The frontend written in angular can be found here.
git clone https://github.com/yashgkar/todo-backend.git
cd todo-backend
npm install
node app.js
There are in total of 11 APIs. They are as follows:
- register (POST): To register new user.
- login (POST): To login and start user session.
- tasks (GET): To get all tasks associated to the current user.
- task (POST): Add a new task the current user's bucket.
- task (PUT): Update a specific task wih id.
- task (DELETE): Delete any task with id.
- completed-task (PUT): Mark task as completed.
- labels (GET): Get all labels present in collection.
- statuses (GET): Get all status types.
- logout (GET): Logout and clear session for current user.
- getUserName (GET): Get current user's name.
The request and response json formats for these APIs can be found here.