ibraah88 / MENT

MENT (Mongo Express Node Typescript) - RESTful API (with JWT, Docker & Docker-Compose)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MENT

MENT (Mongo Express Node Typescript) - RESTful API (with JWT, Docker & Docker-Compose)

This is a boilerplate for building scalable and robust REST APIs using Node.js & TypeScript.


Getting Started

The easiest way to get started is to clone the repository:

Get the latest snapshot

    git clone https://github.com/isdiop/MENT.git

Change directory

    cd MENT

Copy .env file

    cp .env.example .env

Install NPM dependencies

    make install

Start up the server

    make build

Available routes

Method Resource Description
POST /register Create a new user in MongoDB. You need to specify in the body the following attributes: firstName, lastName, email & password.
POST /login Sign in with the email & password. If it's successful, then generates a token
GET /profile Returns the collection of the connected user, you need to specify the token in the header like this: Authorization: Bearer your-token
POST /products Create a new product for the current user with this body: name, description and price. and a header Authorization: Bearer your-token
GET /products Show all products for the current user, you need to specify the token in the header like this: Authorization: Bearer your-token
GET /products/:id Show the product by id for the current user, you need to specify the token in the header like this: Authorization: Bearer your-token
PUT /products/:id Update a product by id for the current user, you need to specify the token in the header like this: Authorization: Bearer your-token
DELETE /products/:id Delete a product by id for the current user, you need to specify the token in the header like this: Authorization: Bearer your-token

IN PROGRESS

  • API Register [Registration, Auth, Show User Profile]
  • API Products [CRUD User Products]
  • API Users [Update User Account, Delete User Account and products]

License

MIT © isdiop

About

MENT (Mongo Express Node Typescript) - RESTful API (with JWT, Docker & Docker-Compose)

License:MIT License


Languages

Language:TypeScript 95.6%Language:Dockerfile 2.5%Language:Makefile 1.9%