Code Monkey home page Code Monkey logo

fancy-todo-1's Introduction

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

fancy-todo-1's People

Contributors

semmiverian avatar willyprayogo26 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.