-
Node.js ::: The runtime environment for running JavaScript on the server.
-
Express ::: A web application framework for routing and handling HTTP requests.
-
PostgreSQL ::: A robust, open-source relational database.
-
Prisma ::: An Object-Relational Mapping (ORM) tool for interfacing with the database.
-
JWT (JSON Web Tokens) ::: For user authentication and authorization.
-
Cookie Parser ::: To handle cookies for user sessions.
-
Husky ::: A pre-commit and pre-push hook framework for ensuring code quality.
-
SSL-Commerce ::: For payment gateway integration.
-
Node Mailer ::: For sending email with password reset and actions
The backend server is built with a focus on modularity, security, and performance. It provides comprehensive functionalities to serve the front-end of the web application, ensuring a seamless and secure user experience. The server's use of Node.js and Express, in combination with other technologies, ensures reliable performance and scalability for a wide range of applications.
- Create a New User Account
- Endpoint:
POST '/sign-up'
- Description: Allows users to create a new account with validated user data.
-
Authenticate a User
- Endpoint:
POST '/login`
- Description: Handles user authentication and generates a JSON Web Token (JWT) for further API access.
-
Change Password
- Endpoint:
PATCH '/change-password'
- Description: Enables users to change their passwords securely and is protected.
-
Retrieve User Profile
- Endpoint:
GET '/profile'
- Description: Retrieves the user's profile (protected).
-
Get All Users
- Endpoint:
GET '/allUsers'
- Description: Lists all users and is protected for admin users to prevent unauthorized access to user data.
-
Update User Profile
- Endpoint:
PATCH '/update-profile'
- Description: Allows users to securely update their profiles. It is protected and includes request validation.
-
Create Admin User
- Endpoint:
POST ' /create-admin'
- Description: Creates admin users is protected for super-admin users.
-
Delete User
- Endpoint:
DELETE '/:id'
- Description: Permits the deletion of user accounts and is protected by admin and super-admin roles to maintain data integrity.
- Get Single User Data
- Endpoint:
GET '/:id'
- Description: Allows super-admin and admin roles to retrieve the data of a single user securely.
- Create a New Blog
- Endpoint:
POST '/create'
- Description: Allows admin and super-admin users to create new blog posts.
- Get All Blogs
- Endpoint:
GET '/all-blogs'
- Description: Retrieves a list of all blog posts.
- Delete a Blog
- Endpoint:
DELETE '/:id'
- Description: Permits the deletion of a specific blog post. This endpoint is protected by admin and super-admin roles.
- Create a New Category
- Endpoint:
POST '/categories'
- Description: Allows authorized users to create new categories for blog posts.
- Get All Categories
- Endpoint:
GET '/categories'
- Description: Retrieves a list of all available categories.
- Get Single Category Data
- Endpoint:
GET '/categories/:id'
- Description: Allows users to retrieve data of a specific category.
- Update Category
- Endpoint:
PATCH /categories/:id
- Description: Permits users to update the details of a specific category.
- Delete Category
- Endpoint:
DELETE '/categories/:id'
- Description: Allows users to delete a specific category.
- Create a New Service
- Endpoint:
POST '/services'
- Description: Allows authorized users to create new services.
- Get All Services
- Endpoint:
GET '/services'
- Description: Retrieves a list of all available services.
- Get Single Service Data
- Endpoint:
GET '/services/:id'
- Description: Allows users to retrieve data of a specific service.
- Update Service
- Endpoint:
PATCH '/services/:id'
- Description: Permits users to update the details of a specific service.
- Delete Service
- Endpoint:
DELETE /services/:id
- Description: Allows users to delete a specific service.
- Create a New Cart Item
- Endpoint:
POST '/cart'
- Description: Allows users to add items to their shopping cart and is protected for user, admin, and super-admin roles.
- Get All Cart Items
- Endpoint:
GET' /cart'
- Description: Lists all items in the user's shopping cart and is protected for user, admin, and super-admin roles.
- Get Single Cart Item
- Endpoint:
GET /cart/:id
- Description: Allows users to retrieve data of a single cart item.
- Update Cart Item
- Endpoint:
PATCH '/cart/:id'
- Description: Permits users to update the details of a specific cart item and is protected for user, admin, and super-admin roles.
- Delete Cart Item
- Endpoint:
DELETE '/cart/:id'
- Description: Allows users to delete a specific cart item and is protected for user, admin, and super-admin roles.
- Get All Bookings
- Endpoint:
GET '/bookings'
- Description: Retrieves a list of all bookings, protected for admin and super-admin roles.
- Get User's Booking
- Endpoint:
GET '/bookings/userBooking'
- Description: Lists all bookings for a user.
- Get Booking by Service
- Endpoint:
GET '/bookings/:serviceId'
- Description: Retrieves user bookings for a specific service.
- Get Single Booking Data
- Endpoint:
GET '/bookings/:id'
- Description: Allows users to retrieve data of a single booking.
- Delete Booking
- Endpoint:
DELETE '/bookings/:id'
- Description: Permits users to delete a specific booking and is protected for admin, super-admin, and user roles.
- Update Booking
- Endpoint:
PATCH '/bookings/:id'
- Description: Allows users to update the details of a specific booking and is protected for super-admin and admin roles.
- Create a New Review
- Endpoint:
POST' /reviews'
- Description: Enables users to create new reviews and is protected for user, admin, and super-admin roles.
- Get All Reviews
- Endpoint:
GET '/reviews'
- Description: Retrieves a list of all reviews.
- Get User's Reviews
- Endpoint:
GET '/reviews/userReview'
- Description: Lists all reviews for a user.
- Get Reviews by Service
- Endpoint:
GET '/reviews/userReview/:serviceId'
- Description: Retrieves user reviews for a specific service.
- Get Single Review Data
- Endpoint:
GET '/reviews/:id'
- Description: Allows users to retrieve data of a single review.
- Update Review
- Endpoint:
PATCH '/reviews/:id'
- Description: Permits users to update the details of a specific review and is protected for admin, user, and super-admin roles.
- Delete Review
- Endpoint:
DELETE '/reviews/:id'
- Description: Allows users to delete a specific review and is protected for admin, user, and super-admin roles.
- Create a New FAQ
- Endpoint:
POST '/faq'
- Description: Allows authorized users to create new FAQs.
- Get All FAQs
- Endpoint:
GET '/faq'
- Description: Retrieves a list of all frequently asked questions.
- Get Single FAQ Data
- Endpoint:
GET '/faq/:id'
- Description: Allows users to retrieve data of a specific FAQ.
- Update FAQ
- Endpoint:
GET '/faq/:id'
- Description: Permits users to update the details of a specific FAQ.
- Delete FAQ
- Endpoint:
DELETE '/faq:id'
- Description: Allows users to delete a specific FAQ.
- Initialize Payment
- Endpoint:
POST '/payment'
- Description: Initiates the payment process for services.
- Handle Webhook
- Endpoint:
POST '/payment/webhook'
- Description: Handles incoming webhooks from the payment gateway.
- Get All Payments
- Endpoint:
GET '/payment'
- Description: Retrieves a list of all payments, protected for admin and super-admin roles.
- Get User's Payments
- Endpoint:
POST '/payment/userPayment'
*** -------------------------------------------Updating payment ------------------------------------***