GreenEcovents Front End
View the live site here.
๐ฟ Welcome to the GreenEcovents Full Stack Journey! ๐
Embark on a heartcrafted adventure through the GreenEcovents Front End repository โ a testament to passion and dedication in the realm of event management web applications.
๐ Overview
In the tapestry of digital landscapes, GreenEcovents stands as a full-stack masterpiece, woven meticulously by the hands of a solo dream-weaver. The front end, a symphony of TypeScript and Next.js, beckons users into a world of dynamic and responsive experiences.
๐ What I Poured My Soul Into
As a solitary maestro, I embraced the entire front-end development odyssey of GreenEcovents. From the initial spark of an idea to the vibrant reality of the user interface, I delicately crafted every nuance and functionality. My contributions, a love letter to this project, encompass:
โจ Enchanting Features
Dive into the magical world of GreenEcovents, where every feature is a spark of innovation and user delight! ๐
-
๐ญ Event Discovery Experience: Unleash the magic of seamless event searching and filtering. Find your perfect match effortlessly!
-
๐ Detailed Event Views: Immerse yourself in the enchanting details of each event. Every glance tells a story, waiting to be explored.
-
๐ Secure Event Booking: Elevate your event journey with the assurance of secure booking, seamlessly integrated with a trusted payment gateway.
-
๐จ Multi-Layered Dashboard: Your personalized space, crafted with layers of convenience. Navigate through your events effortlessly in a space tailored just for you.
-
๐ฌ Heartfelt User Feedback: Your voice matters! Experience a user feedback system that not only listens but understands the heartbeat of your thoughts.
-
๐ค Profile Management: Your story, your way. Tailor your profile to reflect the essence of your eventful journey within GreenEcovents.
-
๐ Responsive Design: A digital canvas that adapts to your every move. Whether on a desktop or a mobile device, the experience is consistently magical.
-
๐ Interactive Attendee Hub: Connect with fellow attendees in a vibrant hub of interaction. Share, connect, and make every event a community celebration.
-
๐ Intelligent Analytics: Uncover the magic behind the scenes with insightful analytics. Understand and enhance your events through data-driven wisdom.
๐ Empowering Magic: Technologies That Breathe Life Into GreenEcovents
Journey through the enchanting landscape of GreenEcovents, where every line of code is a spell, and every technology is a magical ingredient. โจ
-
๐ฎ TypeScript: The wizard's pen, weaving types and clarity into the code, ensuring a magical and error-free experience.
-
๐งโโ๏ธ Next.js: The enchanted gateway to dynamic and responsive front-end experiences. Every page, a portal to user delight.
-
๐ Axios: Swift as the wind, Axios communicates seamlessly, ensuring a smooth exchange of magic between client and server.
-
๐ React Hook Form: A spellbook of form sorcery, making user interactions fluid and delightful.
-
โ๏ธ React Quill: The quill of creativity, allowing users to express themselves with rich and beautiful text.
-
๐ Swiper.js: A magical scroll through events, turning every swipe into a captivating journey.
-
๐ก๏ธ Yup: The guardian of data integrity, ensuring that the spells cast are bound by the rules of validation.
-
๐ Recharts: Transforming data into visual enchantment, every chart tells a story of insights and understanding.
-
๐ณ Stripe: The wand of secure transactions, making event bookings a seamless and trustworthy experience.
-
๐ react-pdf: Unfolding the parchment of digital documents, adding a touch of elegance to every event.
-
๐จ Ant Design: The palette of design magic, crafting a visual tapestry that captivates and delights.
-
๐ GraphQL: Channeling the power of efficient queries, connecting the mystical realms of the front end and back end.
-
๐ ๏ธ Docker: The container of dreams, ensuring that the magic of GreenEcovents can be conjured anywhere.
-
๐ Serverless Architecture: Unleashing the magic of scalability and efficiency, ensuring GreenEcovents is always ready for the grandest of events.
Entity-Relationship Diagram (ERD)
+---------------------+ +------------------------+ +----------------------+
| User | | Category | | Event |
+---------------------+ +------------------------+ +----------------------+
| id | | id | | id |
| email | | name | | title |
| password | +------------------------+ | description |
| firstName | | | | startDate |
| lastName | | | | endDate |
| contactNo | | | | location |
| role | | | | price |
| gender | | | | image |
| profileImg | | | | status |
| createdAt | | | | userId |
| updatedAt | | | | categoryId |
| | | | | createdAt |
| | | | | updatedAt |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+---------------------+ | +------------------------+
| |
| |
V V
+---------------------+ +---------------------+ +---------------------+
| Booking | | Payment | | Review |
+---------------------+ +---------------------+ +---------------------+
| id | | id | | id |
| status | | amount | | review |
| startDate | | currency | | rating |
| endDate | | paymentId | | userId |
| adults | | userId | | eventId |
| childrens | | bookingId | | createdAt |
| email | | createdAt | | updatedAt |
| contactNo | | updatedAt | | |
| daysBooked | | | | |
| totalAmount | | | | |
| userId | | | | |
| eventId | | | | |
| createdAt | | | | |
| updatedAt | | | | |
| | | | | |
| | | | | |
| | | | | |
+---------------------+ +---------------------+ +---------------------+
|
|
V
+---------------------+
| Feedback |
+---------------------+
| id |
| feedback |
| userId |
| createdAt |
| updatedAt |
| |
| |
| |
+---------------------+
|
|
V
+---------------------+
| BlogPost |
+---------------------+
| id |
| title |
| content |
| image |
| userId |
| createdAt |
| updatedAt |
| |
| |
| |
+---------------------+
|
|
V
+---------------------+
| FAQ |
+---------------------+
| id |
| question |
| answer |
| userId |
| createdAt |
| updatedAt |
| |
| |
| |
+---------------------+
|
|
V
+---------------------+
| Pages |
+---------------------+
| id |
| title |
| content |
| userId |
| createdAt |
| updatedAt |
| |
| |
| |
+---------------------+
|
|
V
+---------------------+
| Subscriber |
+---------------------+
| id |
| email |
| createdAt |
| updatedAt |
| |
| |
| |
+---------------------+
GreenEcovents API Endpoints
Main Route
- /api/v1: Root route to include all sub-routes.
Auth Routes
- POST /signup: Register a new user.
- POST /login: Log in a user.
- POST /refresh-token: Refresh the authentication token.
- PATCH /change-password: Change the password of a user.
- POST /logout: Log out a user.
Admin Routes
- POST /make-admin: Make a user an admin (requires SUPER_ADMIN role).
- PATCH /:id: Update admin details (requires SUPER_ADMIN role).
- GET /: Get all admins (requires SUPER_ADMIN role).
- DELETE /:id: Delete an admin (requires SUPER_ADMIN role).
Blog Routes
- POST /: Create a new blog (requires ADMIN or SUPER_ADMIN role).
- GET /user: Get blogs by user (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /: Get all blogs.
- GET /:id: Get a single blog.
- PATCH /:id: Update a blog (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a blog (requires ADMIN or SUPER_ADMIN role).
Booking Routes
- POST /create-payment-intents: Create payment intents for booking (requires ADMIN, SUPER_ADMIN, or USER role).
- POST /: Create a new booking (requires ADMIN, SUPER_ADMIN, or USER role).
- POST /confirm: Confirm a booking (requires ADMIN, SUPER_ADMIN, or USER role).
- POST /get-data: Get booking data (requires ADMIN or SUPER_ADMIN role).
- GET /payment-details/:id: Get payment details for a booking (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /: Get all bookings (requires ADMIN or SUPER_ADMIN role).
- GET /user: Get bookings by user (requires USER role).
- GET /:id: Get a single booking (requires ADMIN, SUPER_ADMIN, or USER role).
- PATCH /:id: Update a booking (requires ADMIN or SUPER_ADMIN role).
- PATCH /user/:id: Cancel a booking (requires USER role).
- DELETE /:id: Delete a booking (requires ADMIN, SUPER_ADMIN, or USER role).
Category Routes
- POST /: Create or update a category (requires ADMIN or SUPER_ADMIN role).
- GET /: Get all categories.
- GET /:id: Get a single category.
- PATCH /:id: Update a category (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a category (requires ADMIN or SUPER_ADMIN role).
Event Routes
- POST /: Create a new event (requires ADMIN or SUPER_ADMIN role).
- GET /: Get all events.
- GET /:id: Get a single event.
- PATCH /:id: Update an event (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete an event (requires ADMIN or SUPER_ADMIN role).
FAQ Routes
- POST /: Create a new FAQ (requires ADMIN or SUPER_ADMIN role).
- GET /user: Get FAQs by user (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /: Get all FAQs.
- GET /:id: Get a single FAQ.
- PATCH /:id: Update a FAQ (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a FAQ (requires ADMIN or SUPER_ADMIN role).
Feedback Routes
- POST /: Create new feedback (requires USER role).
- GET /user: Get feedbacks by user (requires USER role).
- GET /: Get all feedbacks (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /:id: Get a single feedback (requires ADMIN, SUPER_ADMIN, or USER role).
- PATCH /:id: Update feedback (requires ADMIN, SUPER_ADMIN, or USER role).
- DELETE /:id: Delete feedback (requires ADMIN or SUPER_ADMIN role).
Mail Routes
- POST /: Send an email.
Page Routes
- POST /: Create a new page (requires ADMIN or SUPER_ADMIN role).
- GET /user: Get pages by user (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /: Get all pages.
- GET /:id: Get a single page.
- PATCH /:id: Update a page (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a page (requires ADMIN or SUPER_ADMIN role).
Review Routes
- POST /: Create a new review (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /user: Get reviews by user (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /: Get all reviews.
- GET /:id: Get a single review.
- PATCH /:id: Update a review (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a review (requires ADMIN or SUPER_ADMIN role).
- GET /events/:eventId: Get reviews by event ID (requires ADMIN, SUPER_ADMIN, or USER role).
Subscriber Routes
- POST /: Add a new subscriber.
- POST /send: Send an email to subscribers (requires ADMIN or SUPER_ADMIN role).
- GET /: Get all subscribers (requires ADMIN or SUPER_ADMIN role).
- DELETE /:id: Delete a subscriber (requires ADMIN or SUPER_ADMIN role).
User Routes
- GET /profile: Get user profile details (requires ADMIN, SUPER_ADMIN, or USER role).
- GET /get-all: Get all users (requires ADMIN or SUPER_ADMIN role).
- GET /:id: Get a user by ID.
- PATCH /profile: Update user profile (requires ADMIN, SUPER_ADMIN, or USER role).
- PATCH /:id: Update a user (requires ADMIN, SUPER_ADMIN, or USER role).
- DELETE /:id: Delete a user (requires ADMIN or SUPER_ADMIN role).
API ENDPOINTS & DATA
Authentication Endpoints (AuthRoutes)
-
POST /api/v1/auth/signup
- Request:
{ "email": "[email protected]", "password": "password123", "firstName": "John", "lastName": "Doe", "contactNo": "1234567890", "gender": "male" }
- Response:
{ "id": "generated_user_id", "email": "[email protected]", "firstName": "John", "lastName": "Doe", "contactNo": "1234567890", "role": "USER", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] }
- Request:
-
POST /api/v1/auth/login
- Request:
{ "email": "[email protected]", "password": "password123" }
- Response:
{ "accessToken": "jwt_access_token", "refreshToken": "jwt_refresh_token" }
- Request:
-
POST /api/v1/auth/refresh-token
- Request:
{ "refreshToken": "jwt_refresh_token" }
- Response:
{ "accessToken": "new_jwt_access_token" }
- Request:
-
PATCH /api/v1/auth/change-password
- Request:
{ "newPassword": "new_password123" }
- Response:
{ "message": "Password changed successfully" }
- Request:
-
POST /api/v1/auth/logout
- Response:
{ "message": "Logout successful" }
- Response:
User Endpoints (UserRoutes)
-
GET /api/v1/user/profile
- Response:
{ "id": "user_id", "email": "[email protected]", "firstName": "John", "lastName": "Doe", "contactNo": "1234567890", "role": "USER", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] }
- Response:
-
GET /api/v1/user/get-all
- Response:
[ { "id": "user_id_1", "email": "[email protected]", "firstName": "Alice", "lastName": "Smith", "contactNo": "9876543210", "role": "USER", "gender": "female", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] }, { "id": "user_id_2", "email": "[email protected]", "firstName": "Bob", "lastName": "Johnson", "contactNo": "5678901234", "role": "USER", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] } ]
- Response:
-
GET /api/v1/user/:id
- Response:
{ "id": "user_id", "email": "[email protected]", "firstName": "John", "lastName": "Doe", "contactNo": "1234567890", "role": "USER", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events":
- Response:
[] } ```
-
PATCH /api/v1/user/profile
- Request:
{ "firstName": "UpdatedJohn", "lastName": "UpdatedDoe", "contactNo": "9876543210", "gender": "female" }
- Response:
{ "id": "user_id", "email": "[email protected]", "firstName": "UpdatedJohn", "lastName": "UpdatedDoe", "contactNo": "9876543210", "role": "USER", "gender": "female", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] }
- Request:
-
PATCH /api/v1/user/:id
- Request:
{ "firstName": "UpdatedAlice", "lastName": "UpdatedSmith", "contactNo": "9876543210", "gender": "female" }
- Response:
{ "id": "user_id", "email": "[email protected]", "firstName": "UpdatedAlice", "lastName": "UpdatedSmith", "contactNo": "9876543210", "role": "USER", "gender": "female", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp", "feedbacks": [], "pages": [], "payments": [], "reviews": [], "bookings": [], "blogPosts": [], "FAQs": [], "events": [] }
- Request:
-
DELETE /api/v1/user/:id
- Response:
{ "message": "User deleted successfully" }
- Response:
Admin Endpoints (AdminRoutes)
-
POST /api/v1/admin/make-admin
- Request:
{ "userId": "user_id_to_promote" }
- Response:
{ "message": "User promoted to admin successfully" }
- Request:
-
PATCH /api/v1/admin/:id
- Request:
{ "firstName": "UpdatedAdmin", "lastName": "UpdatedLastName", "contactNo": "9876543210", "gender": "male" }
- Response:
{ "id": "admin_id", "email": "[email protected]", "firstName": "UpdatedAdmin", "lastName": "UpdatedLastName", "contactNo": "9876543210", "role": "ADMIN", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp" }
- Request:
-
GET /api/v1/admin/
- Response:
[ { "id": "admin_id_1", "email": "[email protected]", "firstName": "Admin1", "lastName": "Smith", "contactNo": "9876543210", "role": "ADMIN", "gender": "male", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "admin_id_2", "email": "[email protected]", "firstName": "Admin2", "lastName": "Johnson", "contactNo": "5678901234", "role": "ADMIN", "gender": "female", "profileImg": null, "createdAt": "timestamp", "updatedAt": "timestamp" } ]
- Response:
-
DELETE /api/v1/admin/:id
- Response:
{ "message": "Admin deleted successfully" }
- Response:
Category Endpoints (CategoryRoutes)
-
Create a Category:
- Endpoint:
POST /api/v1/categories
- Authentication: Required (Admin or Super Admin)
- Request Body:
{ "name": "CategoryName" }
- Response:
{ "id": "categoryId", "name": "CategoryName", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Get All Categories:
- Endpoint:
GET /api/v1/categories
- Authentication: Not required
- Response:
[ { "id": "categoryId1", "name": "CategoryName1", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "categoryId2", "name": "CategoryName2", "createdAt": "timestamp", "updatedAt": "timestamp" }, // ... other categories ]
- Endpoint:
-
Get a Single Category:
- Endpoint:
GET /api/v1/categories/:id
- Authentication: Not required
- Response:
{ "id": "categoryId", "name": "CategoryName", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Update a Category:
- Endpoint:
PATCH /api/v1/categories/:id
- Authentication: Required (Admin or Super Admin)
- Request Body:
{ "name": "UpdatedCategoryName" }
- Response:
{ "id": "categoryId", "name": "UpdatedCategoryName", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Delete a Category:
- Endpoint:
DELETE /api/v1/categories/:id
- Authentication: Required (Admin or Super Admin)
- Response:
{ "message": "Category deleted successfully" }
- Endpoint:
Event API Endpoints (EventRoutes)
-
Create Event:
- Endpoint:
POST /api/v1/events
- Request Body:
{ "title": "Example Event", "description": "A sample event description", "startDate": "2023-01-01T00:00:00.000Z", "endDate": "2023-01-02T00:00:00.000Z", "location": "Sample Location", "price": 25.99, "image": "event-image-url.jpg", "userId": "user-id", // Replace with the actual user ID "categoryId": "category-id" // Replace with the actual category ID }
- Response Data:
{ "id": "generated-event-id", "title": "Example Event", "description": "A sample event description", "startDate": "2023-01-01T00:00:00.000Z", "endDate": "2023-01-02T00:00:00.000Z", "location": "Sample Location", "price": 25.99, "image": "event-image-url.jpg", "status": "upcoming", "userId": "user-id", "categoryId": "category-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Get All Events:
- Endpoint:
GET /api/v1/events
- Response Data:
[ { "id": "event-id-1", "title": "Event 1", "description": "Description 1", "startDate": "2023-01-01T00:00:00.000Z", "endDate": "2023-01-02T00:00:00.000Z", "location": "Location 1", "price": 29.99, "image": "event-image-1.jpg", "status": "upcoming", "userId": "user-id-1", "categoryId": "category-id-1", "createdAt": "timestamp", "updatedAt": "timestamp" }, // ... (other events) ]
- Endpoint:
-
Get Single Event:
- Endpoint:
GET /api/v1/events/:id
(replace:id
with the actual event ID) - Response Data:
{ "id": "event-id", "title": "Example Event", "description": "A sample event description", "startDate": "2023-01-01T00:00:00.000Z", "endDate": "2023-01-02T00:00:00.000Z", "location": "Sample Location", "price": 25.99, "image": "event-image-url.jpg", "status": "upcoming", "userId": "user-id", "categoryId": "category-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Update Event:
- Endpoint:
PATCH /api/v1/events/:id
(replace:id
with the actual event ID) - Request Body:
{ "title": "Updated Event Title", "description": "Updated event description", "startDate": "2023-02-01T00:00:00.000Z", "endDate": "2023-02-02T00:00:00.000Z", "location": "Updated Location", "price": 35.99, "image": "updated-event-image.jpg" }
- Response Data:
{ "id": "event-id", "title": "Updated Event Title", "description": "Updated event description", "startDate": "2023-02-01T00:00:00.000Z", "endDate": "2023-02-02T00:00:00.000Z", "location": "Updated Location", "price": 35.99, "image": "updated-event-image.jpg", "status": "upcoming", "userId": "user-id", "categoryId": "category-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Delete Event:
- Endpoint:
DELETE /api/v1/events/:id
(replace:id
with the actual event ID) - Response Data: (No content, successful deletion)
- Endpoint:
Bookings API Endpoints (BookingsRoutes)
-
Create a Booking:
- Endpoint:
POST /api/v1/bookings/
- Request Body:
{ "status": "pending", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id" }
- Response:
{ "id": "booking-id", "status": "pending", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" }
- Endpoint:
-
Confirm Booking:
- Endpoint:
POST /api/v1/bookings/confirm
- Request Body:
{ "bookingId": "booking-id" }
- Response:
{ "message": "Booking confirmed successfully", "booking": { "id": "booking-id", "status": "confirmed", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" } }
- Endpoint:
-
Get All Bookings:
- Endpoint:
GET /api/v1/bookings/
- Response:
[ { "id": "booking-id-1", "status": "confirmed", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" }, { "id": "booking-id-2", "status": "pending", "startDate": "2023-02-01T12:00:00Z", "endDate": "2023-02-03T12:00:00Z", "adults": 1, "childrens": 0, "email": "[email protected]", "contactNo": "+987654321", "daysBooked": 2, "totalAmount": 100.0, "userId": "another-user-id", "eventId": "another-event-id", "createdAt": "2023-11-19T12:00:00Z", "updatedAt": "2023-11-19T12:00:00Z" } ]
- Endpoint:
-
Get Booking by ID:
- Endpoint:
GET /api/v1/bookings/:id
- Response:
{ "id": "booking-id", "status": "confirmed", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" }
- Endpoint:
-
Update Booking:
- Endpoint:
PATCH /api/v1/bookings/:id
- Request Body:
{ "status": "canceled" }
- Response:
{ "message": "Booking updated successfully", "booking": { "id": "booking-id", "status": "canceled", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" } }
- Endpoint:
-
Cancel Booking (User):
- Endpoint:
PATCH /api/v1/bookings/user/:id
- Response:
{ "message": "Booking canceled successfully", "booking": { "id": "booking-id", "status": "canceled", "startDate": "2023-01-01T12:00:00Z", "endDate": "2023-01-03T12:00:00Z", "adults": 2, "childrens": 1, "email": "[email protected]", "contactNo": "+123456789", "daysBooked": 3, "totalAmount": 150.0, "userId": "user-id", "eventId": "event-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" } }
- Endpoint:
-
Delete Booking:
- Endpoint:
DELETE /api/v1/bookings/:id
- Response:
{ "message": "Booking deleted successfully" }
- Endpoint:
-
Get Payment Details:
- Endpoint:
GET /api/v1/bookings/payment-details/:id
- Response:
{ "id": "payment-id", "amount": 150.0, "currency": "USD", "paymentId": "payment-stripe-id", "userId": "user-id", "bookingId": "booking-id", "createdAt": "2023-11-18T12:00:00Z", "updatedAt": "2023-11-18T12:00:00Z" }
- Endpoint:
-
Get Booking Data (Admin):
- Endpoint:
POST /api/v1/bookings/get-data
- Response:
{ "totalBookings": 100, "confirmedBookings": 80, "pendingBookings": 15, "canceledBookings": 5, "revenue": 15000.0 }
- Endpoint:
Review API Endpoints (ReviewsRoutes)
1. Create a Review
Endpoint: POST /api/v1/reviews
Request Data:
{
"review": "Great event! Enjoyed every moment.",
"rating": 4.5,
"userId": "user_id_here",
"eventId": "event_id_here"
}
Response Data:
{
"id": "review_id_here",
"review": "Great event! Enjoyed every moment.",
"rating": 4.5,
"userId": "user_id_here",
"eventId": "event_id_here",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
2. Get Reviews by User
Endpoint: GET /api/v1/reviews/user
Response Data:
[
{
"id": "review_id_1",
"review": "Awesome experience!",
"rating": 5.0,
"userId": "user_id_here",
"eventId": "event_id_1",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
},
{
"id": "review_id_2",
"review": "Enjoyed the event.",
"rating": 4.0,
"userId": "user_id_here",
"eventId": "event_id_2",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
// ... additional reviews
]
3. Get All Reviews
Endpoint: GET /api/v1/reviews
Response Data:
[
{
"id": "review_id_1",
"review": "Awesome experience!",
"rating": 5.0,
"userId": "user_id_1",
"eventId": "event_id_1",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
},
{
"id": "review_id_2",
"review": "Enjoyed the event.",
"rating": 4.0,
"userId": "user_id_2",
"eventId": "event_id_2",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
// ... additional reviews
]
4. Get Single Review
Endpoint: GET /api/v1/reviews/:id
Response Data:
{
"id": "review_id_here",
"review": "Great event! Enjoyed every moment.",
"rating": 4.5,
"userId": "user_id_here",
"eventId": "event_id_here",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
5. Update a Review
Endpoint: PATCH /api/v1/reviews/:id
Request Data:
{
"review": "Updated review text.",
"rating": 4.8
}
Response Data:
{
"id": "review_id_here",
"review": "Updated review text.",
"rating": 4.8,
"userId": "user_id_here",
"eventId": "event_id_here",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
6. Delete a Review
Endpoint: DELETE /api/v1/reviews/:id
Response Data:
{
"message": "Review deleted successfully."
}
7. Get Reviews by Event
Endpoint: GET /api/v1/reviews/events/:eventId
Response Data:
[
{
"id": "review_id_1",
"review": "Great event!",
"rating": 4.5,
"userId": "user_id_1",
"eventId": "event_id_here",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
},
{
"id": "review_id_2",
"review": "Fantastic experience!",
"rating": 5.0,
"userId": "user_id_2",
"eventId": "event_id_here",
"createdAt": "timestamp_here",
"updatedAt": "timestamp_here"
}
// ... additional reviews
]
Blog API Endpoints (BlogsRoutes)
Certainly! Below are the API endpoints along with their corresponding response data and required request details for the provided Blog
model:
-
Create Blog Post:
- Endpoint:
POST /api/v1/blogs
- Request:
- Headers:
Authorization
(with user's token) - Body:
{ "title": "Example Blog Title", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image": "example_image_url.jpg", "userId": "user_id" }
- Headers:
- Response:
{ "id": "generated_blog_id", "title": "Example Blog Title", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image": "example_image_url.jpg", "userId": "user_id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Get All Blogs:
- Endpoint:
GET /api/v1/blogs
- Response:
[ { "id": "blog_id_1", "title": "Blog Title 1", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image": "image_url_1.jpg", "userId": "user_id_1", "createdAt": "timestamp_1", "updatedAt": "timestamp_1" }, { "id": "blog_id_2", "title": "Blog Title 2", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image": "image_url_2.jpg", "userId": "user_id_2", "createdAt": "timestamp_2", "updatedAt": "timestamp_2" }, // ... More Blogs ]
- Endpoint:
-
Get Single Blog:
- Endpoint:
GET /api/v1/blogs/:id
- Response:
{ "id": "blog_id", "title": "Blog Title", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image": "image_url.jpg", "userId": "user_id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Update Blog:
- Endpoint:
PATCH /api/v1/blogs/:id
- Request:
- Headers:
Authorization
(with user's token) - Body:
{ "title": "Updated Blog Title", "content": "Updated content goes here", "image": "updated_image_url.jpg" }
- Headers:
- Response:
{ "id": "blog_id", "title": "Updated Blog Title", "content": "Updated content goes here", "image": "updated_image_url.jpg", "userId": "user_id", "createdAt": "original_timestamp", "updatedAt": "new_timestamp" }
- Endpoint:
-
Delete Blog:
- Endpoint:
DELETE /api/v1/blogs/:id
- Request:
- Headers:
Authorization
(with user's token)
- Headers:
- Response:
{ "message": "Blog with id blog_id deleted successfully." }
- Endpoint:
Faq API Endpoints (FaqRoutes)
Create FAQ
-
Endpoint:
POST /api/v1/faq
-
Request Data:
{ "question": "Your FAQ Question", "answer": "Your FAQ Answer" }
-
Response Data:
{ "id": "generated-id", "question": "Your FAQ Question", "answer": "Your FAQ Answer", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
Get FAQs for User
-
Endpoint:
GET /api/v1/faq/user
-
Response Data:
[ { "id": "faq-id", "question": "FAQ Question", "answer": "FAQ Answer", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, // Additional FAQs... ]
Get All FAQs
-
Endpoint:
GET /api/v1/faq
-
Response Data:
[ { "id": "faq-id", "question": "FAQ Question", "answer": "FAQ Answer", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, // Additional FAQs... ]
Get Single FAQ
-
Endpoint:
GET /api/v1/faq/:id
-
Response Data:
{ "id": "faq-id", "question": "FAQ Question", "answer": "FAQ Answer", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
Update FAQ
-
Endpoint:
PATCH /api/v1/faq/:id
-
Request Data:
{ "question": "Updated FAQ Question", "answer": "Updated FAQ Answer" }
-
Response Data:
{ "id": "faq-id", "question": "Updated FAQ Question", "answer": "Updated FAQ Answer", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
Delete FAQ
-
Endpoint:
DELETE /api/v1/faq/:id
-
Response Data:
{ "message": "FAQ deleted successfully" }
Feedback API Endpoints (FeedbacksRoutes)
API Endpoints:
-
Create Feedback:
- Endpoint:
POST /api/v1/feedbacks
- Request Body (JSON):
{ "feedback": "Your feedback message here" }
- Response Data (JSON):
{ "id": "generated-feedback-id", "feedback": "Your feedback message here", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Get Feedbacks by User:
- Endpoint:
GET /api/v1/feedbacks/user
- Response Data (Array of JSON):
[ { "id": "feedback-id-1", "feedback": "Feedback message 1", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "feedback-id-2", "feedback": "Feedback message 2", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, ... ]
- Endpoint:
-
Get All Feedbacks:
- Endpoint:
GET /api/v1/feedbacks
- Response Data (Array of JSON):
[ { "id": "feedback-id-1", "feedback": "Feedback message 1", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "feedback-id-2", "feedback": "Feedback message 2", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, ]
- Endpoint:
-
Get Single Feedback:
- Endpoint:
GET /api/v1/feedbacks/:id
- Response Data (JSON):
{ "id": "feedback-id", "feedback": "Your feedback message", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Update Feedback:
- Endpoint:
PATCH /api/v1/feedbacks/:id
- Request Body (JSON):
{ "feedback": "Updated feedback message" }
- Response Data (JSON):
{ "id": "feedback-id", "feedback": "Updated feedback message", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Delete Feedback:
- Endpoint:
DELETE /api/v1/feedbacks/:id
- Response Data (JSON):
{ "message": "Feedback deleted successfully" }
- Endpoint:
Page API Endpoints (PagesRoutes)
-
Create Page:
- Endpoint:
POST /api/v1/pages
- Request Body: JSON with page details
{ "title": "Sample Page", "content": "This is a sample page content." }
- Response Data: JSON with created page details
{ "id": "generated-id", "title": "Sample Page", "content": "This is a sample page content.", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Get Pages:
- Endpoint:
GET /api/v1/pages
- Response Data: JSON array with all pages
[ { "id": "page-id-1", "title": "Page 1", "content": "Content of Page 1", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "page-id-2", "title": "Page 2", "content": "Content of Page 2", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, // ... additional pages ]
- Endpoint:
-
Get Single Page:
- Endpoint:
GET /api/v1/pages/:id
- Response Data: JSON with details of the requested page
{ "id": "page-id", "title": "Sample Page", "content": "This is a sample page content.", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Update Page:
- Endpoint:
PATCH /api/v1/pages/:id
- Request Body: JSON with updated page details
{ "title": "Updated Page Title", "content": "Updated page content." }
- Response Data: JSON with updated page details
{ "id": "page-id", "title": "Updated Page Title", "content": "Updated page content.", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Delete Page:
- Endpoint:
DELETE /api/v1/pages/:id
- Response Data: JSON with a success message
{ "message": "Page deleted successfully." }
- Endpoint:
-
Get Pages by User:
- Endpoint:
GET /api/v1/pages/user
- Response Data: JSON array with pages associated with the authenticated user
[ { "id": "page-id-1", "title": "Page 1", "content": "Content of Page 1", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "page-id-2", "title": "Page 2", "content": "Content of Page 2", "userId": "user-id", "createdAt": "timestamp", "updatedAt": "timestamp" }, // ... additional pages ]
- Endpoint:
Subscriber API Endpoints (SubscribersRoutes)
-
Add a Subscriber
- Endpoint:
POST /api/v1/subscribers
- Request Data:
{ "email": "[email protected]" }
- Response Data:
{ "id": "generated-uuid", "email": "[email protected]", "createdAt": "timestamp", "updatedAt": "timestamp" }
- Endpoint:
-
Send Email to Subscribers
- Endpoint:
POST /api/v1/subscribers/send
- Request Data:
{ "subject": "Your Subject", "message": "Your Message" }
- Response Data:
{ "message": "Email sent successfully to subscribers." }
- Endpoint:
-
Get Subscribers
- Endpoint:
GET /api/v1/subscribers
- Response Data:
[ { "id": "subscriber-id-1", "email": "[email protected]", "createdAt": "timestamp", "updatedAt": "timestamp" }, { "id": "subscriber-id-2", "email": "[email protected]", "createdAt": "timestamp", "updatedAt": "timestamp" }, // ... other subscribers ]
- Endpoint:
-
Delete a Subscriber
- Endpoint:
DELETE /api/v1/subscribers/:id
- Response Data:
{ "message": "Subscriber deleted successfully." }
- Endpoint:
Getting Started
- Clone this repository:
git clone https://github.com/Hamed-Hasan/event-management-frontend.git
- Navigate to the project directory:
cd event-management-frontend
- Install dependencies:
yarn install
- Start the development server:
yarn dev
Configuration
Make sure to configure the necessary environment variables in a .env
file.
Contributing
As the sole developer behind this project, contributions are not currently accepted. However, feel free to open issues for bug reports or feature requests.
Happy coding!