This is a service that resembles Jira.
- User (with attributes):
{ id, name, login, password }
- Board (set of columns):
{ id, title, columns }
- Column (set of tasks):
{ id, title, order }
- Task:
{ id, title, order, description, userId /* assignee */, boardId, columnId }
-
For
User
,Board
andTask
created REST endpoints by separate router paths:/users
GET /users
- get all users (removed password from response)GET /users/:id
- get the user by id (ex. “/users/123”) (removed password from response)POST /users
- create userPUT /users/:id
- update userDELETE /users/:id
- delete user
/boards
- GET all
- GET by id
- POST
- PUT
- DELETE
/tasks
- GET all by boardId
- GET by id
- POST
- PUT
- DELETE
-
When you DELETE
Board
, all itsTasks
will be deleted as well. -
When you DELETE
User
, allTasks
where User is assignee updated to userId = null.
- There is a middleware which logs incoming requests to service.
- There is a middleware which logs all unhandled errors and return a standard message with HTTP code 500 (Internal Server Error).
- There is an errors handling to uncaughtException.
- There is a unhandledRejection listener to log errors.
MongoDB is used as a service database.
Mongoose ODM is used to store and update data.
- Clone this repository to your local machine.
- Go to folder.
- Run
npm install
.
- Run
npm start
in the first terminal - you will start the server. - Run
npm test
in the second terminal - you will see completed tests. - Open
http://localhost:4000/doc/
to see Swagger UI.
Node.js, JavaScript, Express.js, MongoDB, Mongoose ODM, Swagger and uuid were used here.
@ 2020 Diana Ivanova (@melk0sha)