Skip to content

mb-tousif/printing_service_backend

Repository files navigation

This project is for Painting Booking and Management Service

Description

This Painting Booking and Management Service is a backend project by Node.js, Express.js, and Prisma ORM. It is a comprehensive online platform backend that allows users to book services and manage their cart, bookings, notifications, payments.

This project Live Site

Features

  • Implemented CRUD operations
  • Used Authentication and Authorization
  • Handled Pagination and Filtering
  • Process data by $transaction for logical groups of processing data in Postgres that needs to encapsulate several operations.
  • Validate data by Zod
  • Secured authentication by JWT
  • Password encrypted by Bcrypt
  • For ORM coded by Prisma
  • Typescript for type checking

Technologies Used

  • Express.js
  • Typescript
  • PostgresSQL
  • Prisma
  • Zod
  • JWT
  • Bcrypt

Entity Relationship Diagram

API Endpoints

User

  • Create User POST /api/v1/auth/signup [ Only User ]
  • Login User POST /api/v1/auth/login [ All users ]
  • Reset User Password POST /api/v1/auth/reset-password [ Public Api ]
  • User Refresh Token POST /api/v1/auth/refresh-token [ All users ]
  • Get All Users GET /api/v1/users/all-users [ Only Admin and Super Admin ]
  • Get User By Id GET /api/v1/users/profile/:id [ Only exact user ]
  • Update User By Id PATCH /api/v1/users/update-profile/:id [ Only exact user ]
  • Delete User By Id DELETE /api/v1/users/delete-profile/:id [ Only Admin and Super Admin ]

Admin

  • Create All User POST /api/v1/admins/create-all-user [ Only Super Admin ]
  • Update User By Id PATCH /api/v1/admins/update-user/:id [ Only Admin can update any user for it's permission field ]

Super Admin

  • Update User By Id PATCH /api/v1/super-admins/update-user/:id [ Super Admin can update any user data without password ]

Painting Service

  • Create Service POST /api/v1/services/create-service [ Only Admin and Super Admin ]
  • Get Service By Id GET /api/v1/services/:id [ All users ]
  • Update Service By Id PATCH /api/v1/services/update-service/:id [ Only Admin and Super Admin ]
  • Delete Service By Id DELETE /api/v1/services/delete-service/:id [ Only Admin and Super Admin ]
  • Get All Services GET /api/v1/services/all-services [ All users ]
  • Get ALL Available Services GET /api/v1/services/all-available-services [ Public Api ]
  • Get ALL Upcoming Services GET /api/v1/services/all-upcoming-services [ Public Api ]

Cart

  • Create Cart POST /api/v1/carts/create-cart [ Only User ]
  • Get All Carts GET /api/v1/carts/all-carts [ Only Admin and Super Admin ]
  • Get Cart By Id GET /api/v1/carts/:id [ All users ]
  • Update Cart By Id PATCH /api/v1/carts/update-cart/:id [ Only Admin and Super Admin ]
  • Delete Cart By Id DELETE /api/v1/carts/delete-cart/:id [ All users ]

Booking

  • Create Booking POST /api/v1/bookings/create-booking [ Only User ]
  • Get All Bookings GET /api/v1/bookings/all-bookings [ Only Admin and Super Admin ]
  • Get Booking By Id GET /api/v1/bookings/:id [ All users ]
  • Update Booking By Id PATCH /api/v1/bookings/update-booking/:id [ Only Admin and Super Admin ]
  • Delete Booking By Id DELETE /api/v1/bookings/delete-booking/:id [ All users ]
  • Update Booking Status By Id PATCH /api/v1/bookings/update-booking-status-by-user/:id [ Only User ]
  • Update Booking Status By Id PATCH /api/v1/bookings/update-booking-status-by-management/:id [ Only Admin and Super Admin ]

Schedule

  • Create Schedule POST /api/v1/schedules/create-schedule [ All users ]
  • Get All Schedules GET /api/v1/schedules/all-schedules [ Only Admin and Super Admin ]
  • Get Schedule By Id GET /api/v1/schedules/:id [ All users ]
  • Update Schedule By Id PATCH /api/v1/schedules/update-schedule/:id [ Only Admin and Super Admin ]
  • Delete Schedule By Id DELETE /api/v1/schedules/delete-schedule/:id [ Only Admin and Super Admin ]

Review and Rating

  • Create Review POST /api/v1/reviews/create-review [ Only User ]
  • Get All Reviews GET /api/v1/reviews/all-reviews [ All users ]
  • Get Review By Id GET /api/v1/reviews/:id [ Public Api ]
  • Update Review By Id PATCH /api/v1/reviews/update-review/:id [ Only Admin and Super Admin ]
  • Delete Review By Id DELETE /api/v1/reviews/delete-review/:id [ Only Admin and Super Admin ]

Notification

  • Create Notification POST /api/v1/notifications/create-notification [ Only Admin and Super Admin ]
  • Get All Notifications GET /api/v1/notifications/all-notifications [ All users ]
  • Get Notification By Id GET /api/v1/notifications/:id [ All users ]
  • Update Notification By Id PATCH /api/v1/notifications/update-notification/:id [ Only Admin and Super Admin ]
  • Delete Notification By Id DELETE /api/v1/notifications/delete-notification/:id [ Only Admin and Super Admin ]

Feedback

  • Create Feedback POST /api/v1/feedbacks/create-feedback [ Only User ]
  • Get All Feedbacks GET /api/v1/feedbacks/all-feedbacks [ Public Api ]
  • Get Feedback By Id GET /api/v1/feedbacks/:id [ All users ]
  • Update Feedback By Id PATCH /api/v1/feedbacks/update-feedback/:id [ All users ]
  • Delete Feedback By Id DELETE /api/v1/feedbacks/delete-feedback/:id [ All users ]

Blog

  • Create Blog POST /api/v1/blogs/create-blog [ Only Admin and Super Admin ]
  • Get All Blogs GET /api/v1/blogs/all-blogs [ Public Api ]
  • Get Blog By Id GET /api/v1/blogs/:id [ All users ]
  • Update Blog By Id PATCH /api/v1/blogs/update-blog/:id [ Only Admin and Super Admin ]
  • Delete Blog By Id DELETE /api/v1/blogs/delete-blog/:id [ Only Admin and Super Admin ]

Payment

  • Create Payment POST /api/v1/payments/create-payment [ Only User ]
  • Get All Payments GET /api/v1/payments/all-payments [ Only Admin and Super Admin ]
  • Get Payment By Id GET /api/v1/payments/:id [ All users ]
  • Update Payment By Id PATCH /api/v1/payments/update-payment/:id [ Only Admin and Super Admin ]
  • Delete Payment By Id DELETE /api/v1/payments/delete-payment/:id [ Only Admin and Super Admin ]

Subscription

  • Create Subscription POST /api/v1/subscribes/create-subscribe [ Public Api ]
  • Get All Subscriptions GET /api/v1/subscribes/all-subscribes [ Only Admin and Super Admin ]
  • Delete Subscription By Id DELETE /api/v1/subscribes/:id [ Only Admin and Super Admin ]

Happy coding!

Releases

No releases published

Packages

No packages published