The full name of "SFBPMS" is Sports Facility Booking Platform Management System-server which is a TypeScript web app using Express.js and MongoDB with Mongoose, allowing users to register, log in, manage facilities, make bookings, and providing admin users additional management features.
- User can register as(admin and user)
- User login and authentication with JWT
- Admin can add, update, delete facility softly.
- User & Admin both can see the available facilities
- User can book facility and cancel facility
- User & Admin can check availability of facility.
- User can see the booked facility by himself only.
- Admin can check see all the booked facilities by users.
In this project I have used Zod validation to ensure data consistency and prevent malformed requests. For error handling I have used global error handling with my onw way to show the error using httpstatus code and stack to get the error place. Also handle different type of errors. For example,
- No Data Found,
- Route Not Found,
- Validate by user role
-
ADMIN: Email- admin@codermahabub.com Password- Admin222111
-
USER: Email- user@codermahabub.com Password- User222111
-
first of clone the repository
git clone https://github.com/CoderMahabub/sfbpms-server.git cd sfbpms-server
Live server link: https://sfbpms-server.vercel.app/
-
Install dependencies:
npm install
-
Create a
.env
file in the root of your project:touch .env
Add the necessary environment variables to the
.env
file. For example:NODE_ENV=development PORT= DB_URL= BCRYPT_SALT_ROUNDS= JWT_ACCESS_SECRET= JWT_REFRESH_SECRET= JWT_ACCESS_EXPIRES_IN= JWT_REFRESH_EXPIRES_IN=
To run the application in development mode with hot-reloading:
npm run start:dev
1.POST /api/auth/signup -> (Register a new user)
2.POST /api/auth/login -> (Log in a registered user)
- POST /api/facility -> (Add a new facility)
- PUT /api/facility/:id -> (Update an existing facility)
- DELETE /api/facility/:id -> (Soft delete a facility)
- GET /api/facility -> (Retrieve all facilities)
- GET /api/check-availability -> (Check availability of time slots for booking)
- POST /api/bookings -> (Create a new booking(user Only))
- GET /api/bookings -> (View all bookings (Admin Only))
- GET /api/bookings/user -> (View bookings by user (User Only))
- DELETE /api/bookings/:id -> (Cancel a booking (User Only)