/NodeJS-CRUD-Project

Simple CRUD functionality

Primary LanguageTypeScript

NodeJS-CRUD-Project

Introduction:

The purpose of this project is to understand NodeJS along with express by creating a smiple CRUD functionality.

Technology stack:

typescript express mongodb nodejs

Third party libarys:

  • JWT Auth
  • JOI validation
  • http-errors
  • mongoose
  • bcrypt
  • multer

USER APIS

Deployment

  https://nodejs-crud-project.up.railway.app/

To deploy this project run

  npm install
  npm run dev

Get all users

  GET /api/user

Get user by Id

  GET /api/user/${id}
Name Type Description
id string Parameter

create signup

  POST /api/user/create
Name Type Description
name string Body
age number Body
email string Body
password string Body

Login user

  POST /api/user/login
Name Type Description
email string Body
password string Body

Delete user

  DELETE /api/user/delete/${userId}
Name Type Description
userId string Parameter
Bearer Token string Authenticaion

POST APIS

Get all posts

  GET /api/post

Create Post

  GET /api/post/create/
Name Type Description
Title string Body
ImageUrl file Body
Content string Body
Creater string Body Aka: User Id
Bearer Token string Authenticaion

Create Post

  PUT /api/post/update/${postId}
Name Type Description
Title string Body
ImageUrl file Body
Content string Body
Creater string Body Aka: User Id
Bearer Token string Authenticaion
postId string Parameter

Delete Post

  DELETE /api/post/delete/${postId}
Name Type Description
postId string Parameter
Bearer Token string Authenticaion