Feat: Add Event Booking Functionality for Users #317
Labels
enhancement
New feature or request
gssoc-ext
gssoc-extd program
hacktoberfest accepted
hacktoberfest-accepted repo
level3
for 45 points
Describe the feature
We need to implement a feature that allows users to book events displayed on the cafe website. This feature is essential to provide a seamless booking experience for users. The feature should include both frontend and backend tasks, ensuring smooth integration with the existing MERN stack setup.
Tasks:
Design & Development:
Create a responsive booking form that is associated with each event displayed on the website.
The form should include the following fields: user’s name, email, phone number, and the number of people attending.
Add client-side validation for the form (e.g., mandatory fields, valid email, etc.).
Authentication & Access Control:
Ensure the booking form is only available to authenticated users.
If the user is not logged in, prompt them to log in or register before booking an event.
User Feedback:
Provide feedback to users upon form submission (e.g., booking confirmation or errors such as missing fields, invalid data, etc.).
API Endpoints:
Create a new /api/bookings endpoint in the backend to handle event booking requests.
The endpoint should:
Validate the incoming booking data (e.g., ensure event exists, mandatory fields are filled, etc.).
Check if the user is authenticated before proceeding with the booking request.
Database Integration:
Create a bookings model in the MongoDB database to store event booking details. The model should include:
User details (name, email, etc.).
Event details (event ID, event name, date, etc.).
Booking details (number of attendees, booking date, etc.).
Error Handling:
Implement proper error handling for potential issues like double bookings, invalid event IDs, and failed database operations.
Return appropriate error messages and status codes to the frontend.
User Access & Restrictions:
Only verified users should be able to book events.
If a user tries to access the booking form without logging in, they should be redirected to the login/signup page.
Once logged in, the user should be directed back to the event booking form they were trying to access.
Testing & Quality Assurance:
Thoroughly test the booking process with various user scenarios (e.g., valid booking, missing fields, invalid email, etc.).
Add ScreenShots
Record
The text was updated successfully, but these errors were encountered: