Skip to content

willyprayogo26/fancy-todo-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Fancy Todo

List of basic routes:

Route HTTP Header(s) Body Description
/registerAdmin POST none email: String
password: String
Create a user (role auto admin)
success:
(201), example: {"_id": String, "email": String, "password": String, "role": String}
errors:
(500), error
/register POST none email: String
password: String
Create a user (role auto user)
success:
(201), example: {"_id": String, "email": String, "password": String, "role": String}
errors:
(500), error
/login POST none email: String
password: String
Login and get token based on credentials
success:
(200), example: {"_id": String, "email": String, "password": String, "role": String, "token": String}
errors:
(400), {message: 'Invalid email/password'}
(500), error
/google-login POST none email: String
password: String
Login using Oauth2 (Google)
success:
(200), example: {object}
errors:
(500), error

List of user routes:

Route HTTP Header(s) Body Description
/users GET Authenticated:
(token),
Authorized:
(role: admin)
none Get all users info (Admin only)
success:
(200), example: [{"_id": String, "name": String, "email": String, "password": String, "profilePicture": String, "role": String}, {"_id": String, "name": String, "email": String, "password": String, "profilePicture": String, "role": String}, etc]
errors:
(500), error
/users/:id GET Authenticated:
(token)
none Get a single user info (Admin and authenticated member)
success:
(200), example: {"_id": String, "name": String, "email": String, "password": String, "profilePicture": String, "role": String}
errors:
(404), example: {message: 'User not found'}
(500), error
/users/:id/:email GET Authenticated:
(token)
none Get a single user info based on Email (Admin and authenticated member)
success:
(200), example: {"_id": String, "name": String, "email": String, "password": String, "profilePicture": String, "role": String}
errors:
(404), example: {message: 'User not found'}
(500), error
/users POST Authenticated:
(token),
Authorized:
(role: admin)
email: String
password: String
role: String
Create a user (admin only)
success:
(201), example: {"_id": String, "name": String, "email": String, "password": String, "profilePicture": String, "role": String}
errors:
(500), error
/users/:id PUT Authenticated:
(token)
email: String Update a user with new info (admin and authenticated member)
success:
(200), example: {message: 'Updated'}
errors:
(404), example: {message: 'User not found'}
(500), error
/users/:id DELETE Authenticated:
(token),
Authorized:
(role: admin)
none Delete a user (admin only)
success:
(200), example: {message: 'Deleted'}
errors:
(404), example: {message: 'User not found'}
(500), error

List of project routes:

Route HTTP Header(s) Body Description
/projects GET Authenticated:
(token)
none Get all project info
success:
(200), example: [{"name": String, "createdBy": String, "members": [ObjectId]}, {"name": String, "createdBy": String, "members": [ObjectId]}, etc]
errors:
(500), error
/projects/:id GET Authenticated:
(token)
Authorized:
(check is Registered memberId)
none Get a single project info
success:
(200), example: {"name": String, "createdBy": String, "members": [ObjectId]}
errors:
(404), example: {message: 'Project not found'}
(500), error
/projects POST Authenticated:
(token),
Authorized:
(check isUser)
name: String Create a project (authorized user)
success:
(201), example: {"name": String, "createdBy": String, "members": [ObjectId]}
errors:
(500), error
/projects/:id PUT Authenticated:
(token)
Authorized:
(check is Registered memberId)
name: String Update a project name with new info (owner Project only)
success:
(200), example: {message: 'Updated'}
errors:
(404), example: {message: 'Project not found'}
(500), error
/projects/add-member/:id PATCH Authenticated:
(token)
Authorized:
(check is Registered memberId)
email: String Add a new member to the project
(200), example: {message: 'Member successfully added'}
errors:
(404), example: {message: 'User not found'}
(500), error
/projects/delete-member/:id PATCH Authenticated:
(token)
Authorized:
(check is Registered memberId)
none Delete a member (owner Project only)
success:
(200), example: {message: 'Member successfully deleted'}
errors:
(404), example: {message: 'Member not found'}
(500), error
/projects/:id DELETE Authenticated:
(token),
Authorized:
(check is Registered memberId)
none Delete a book (owner Project only)
success:
(200), example: {message: 'Project successfully deleted'}
errors:
(404), example: {message: 'Project not found'}
(500), error

List of todo routes:

Route HTTP Header(s) Body Description
/todos/project/:projectId GET Authenticated:
(token)
none Get todo that has based on projectId
success:
(200), example: [{"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: {ObjectId}}, {"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: {ObjectId}}, etc]
errors:
(500), error
/todos/:id GET Authenticated:
(token)
Authorized:
(check isUser)
none Get todo that has based on userId
success:
(200), example: [{"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: null}, {"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: null}, etc]
errors:
(500), error
/todos/:id/:todoId GET Authenticated:
(token)
Authorized:
(check isUser)
none Get a single todo info
success:
(200), example: {"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: null}
errors:
(404), example: {message: 'Todo not found'}
(500), error
/todos/:id POST Authenticated:
(token),
Authorized:
(check isUser)
name: String
description: String
due_date: String
Create a todo
success:
(201), example: {"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: null}
errors:
(400), example: {"message": String}
(500), error
/todos/:id/:todoId PUT Authenticated:
(token)
Authorized:
(check isUser)
email: String Update a todo with new info
success:
(200), example:{"name": String, "description": String, "status": String, "due_date": String, "userId": {ObjectId}, projectId: {ObjectId}}
errors:
(404), example: {message: 'Todo not found'}
(500), error
/todos/:id/:todoId DELETE Authenticated:
(token),
Authorized:
(check isUser)
none Delete a todo
success:
(200), example: {message: 'Todo successfully deleted'}
errors:
(404), example: {message: 'Todo not found'}
(500), error

Link Deploy

Server:

http://fancy-todo-server.willyprayogo26.xyz/

Client:

http://willy-fancytodo.s3-website-ap-southeast-1.amazonaws.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 73.8%
  • HTML 23.5%
  • CSS 2.7%