How mohitsaini2028/hotel-booking-system works
Project type and purpose
• This is a full-stack hotel booking system composed of three main parts:
• An “Admin” React SPA for internal management (in /admin).
• A public “Client” React SPA for customers (in /client).
• A Node.js/Express REST API for business logic and data access (in /api).
• The README describes a booking site where users search destinations, compare prices, view rooms, and an admin panel to manage hotels, rooms, and users.
File structure
• Top-level directories:
• /admin (React, components, context, pages)
• /client (React, components, context, pages)
• /api (Express entry point, routes, controllers, models, utils)
• API uses MVC-style separation:
• routes/*.js define endpoints
• controllers/*.js implement request handlers
• models/*.js define MongoDB schemas via Mongoose
• utils/verifyToken.js and error.js provide middleware and error handling
• Frontends use Context for global state (AuthContext, darkModeContext, SearchContext), React Router (in App.js), and custom hooks (useFetch).
README for additional insights
• Features: search/filter, comparison, room listing, user authentication.
Elements
• API layers in another (e.g., green)
• Database in a third (e.g., orange)