Fattylee-web-services is a web application for keeping track of one's todo. which support all CRUD
operations.
You will learn so much about RESTfUL API's. Just switch to any commit to experiment and learn what is in that
commit`. have fun as ever!
Features
Technology
Installation
Testing
API Docs
Below are the features of my Fattylee-web-services app
Users can Signup on the app
Users can Login on the app
Users can create a todo
Users can Get all todos
Users can Get a todo
Users can Update a todo
Users can Delete a todo
Users with admin privilege can grant admin priviledge
Users with admin privilege can delete a user with admin priviledge
Auth user can retrieve self info
Users can logout
Modern JavaScript technologies were adopted in this project
ES2015: Also known as ES6 or ECMASCRIPT 6, is a new and widely used version of Javascript that makes it compete healthily with other languages. See here for more infromation.
NodeJS: Node.js is an open-source, cross-platform JavaScript run-time environment which allows you enjoy the features of Javascript off the web browsers and implement server-side web development. Visit here for more information.
ExressJS: This is the web application framework for Node.js Visit here for more information.
MongoDB, Mongoose ORM, Jsonwebtoken for authentication and authorization, Bcryptjs to mention a few.
- Clone this repository into your local computer:
git clone https://github.com/Fattylee/fattylee-todos-api.git
- Navigate into the cloned repository in your computer:
$ cd fattylee-todos-api
- Install dependencies by running.
$ npm install
-
Create a
.env
file and fill the credencials using the.env.sample
file sample at the root directory -
Start the application by running
$ npm run start:dev
- Install postman to test all endpoint
- run test using
npm test
Get / home page for Api Docs
HTTP VERB | ENDPOINT | FUNCTIONALITY |
---|---|---|
GET | todos | Get all todos that belongs to user |
GET | /todos/todoID | Get a todo by ID |
POST | /todos | Create a todo |
DELETE | /todos/id | Delete a todo |
DELETE | /todos | Delete all todos |
GET | /users | Get all users |
POST | /users | Create a user |
GET | todos/admin | Get all todos |
DELETE | /users | Delete all users |
DELETE | /users/id | Delete a user |
PATCH | /users/admin/id | Add admin priviledge a user |
DELETE | /users/admin/id | Revoke admin priviledge from a user |
GET | /users/auth | Get auth user |
POST | /users/login | User login |
DELETE | /users/auth/token | Logout user |