GithubHelp home page GithubHelp logo

arjunshibu / task-manager-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 202 KB

Task Manager REST API with JWT Authentication, written in Node.js and MongoDB

Home Page: http://arjun-task-manager-api.herokuapp.com

JavaScript 82.33% Dockerfile 0.80% Shell 16.87%

task-manager-api's Introduction

task-manager-api

Task Manager REST API with JWT Authentication, written in Node.js and MongoDB

Live demo is available at http://arjun-task-manager-api.herokuapp.com

Installation

Configure environments:

$ cp .env.bak .env && cp .env.bak .env.prod

Development

$ docker-compose up

Server will be up on port 4000

Production

$ docker-compose -f docker-compose.prod.yml up

Server will be up on port 80

API Endpoints

POST /users/signup
POST /users/login
POST /users/me/avatar
GET /users/verify/:token
GET /users/:id/verify
GET /users/logout
GET /users/logout/all
GET /users/me
GET /users/:id/avatar.png
PATCH /users/me
DELETE /users/me
DELETE /users/me/avatar

POST /tasks
GET /tasks
GET /tasks/:id
PATCH /tasks/:id
DELETE /tasks/:id

Example requests with cURL

$ curl -s  -H 'Content-Type: Application/json' http://localhost:4000/users/signup -X POST -d '{"name":"test", "email":"[email protected]", "password": "testpass"}' | jq
{
  "user": {
    "_id": "5f7dabc80bdc172c169e9442",
    "name": "test",
    "age": 1,
    "email": "[email protected]"
  },
  "status": "Check mail to verify your account"
}
$ curl -s -H 'Content-Type: Application/json' http://localhost:4000/tasks -X GET -H 'Authorization: Bearer YOUR_JWT_TOKEN' | jq
[
  {
    "_id": "5f7daee10bdc172c169e9447",
    "description": "my task",
    "completed": false,
    "createdAt": "2020-10-07T12:04:49.065Z",
    "updatedAt": "2020-10-07T12:04:49.065Z"
  }
]

task-manager-api's People

Contributors

arjunshibu avatar dependabot[bot] avatar

Stargazers

ANANTHAKRISHNAN 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.