How siddharth9300/bookit works
Project type and purpose
• This is a full-stack “Book It” hall-booking platform.
• The client folder is a React/Tailwind SPA; the server folder is a Node.js/Express API with MongoDB via Mongoose.
File structure
• Top level:
• client/ – React app (components, assets, routing, state)
• server/ – Express app (controllers, middleware, models, routes, DB connection)
• Key files:
• client/src/components – UI & auth/booking/dashboard modules
• client/src/index.js – React entry point
• server/app.js – Express setup & middleware
• server/DB/conn.js – MongoDB connection
• server/controllers/*.js – business logic
• server/router/*Routes.js – REST endpoints
• server/middleware/authenticate.js – JWT/session guard
• server/model/*.js – Mongoose schemas
Extract architectural insights from the README
• Client communicates with server via Axios HTTP calls.
• Auth flows (signup, login, password reset) using email verification (nodemailer).
• Role-based dashboards (admin, faculty, HOD).
• Real-time availability via calendar component (polling or re-fetch).
a. Main components
1. Presentation Layer (Client React App)
– Components: Navbar, BookingForm, CalendarView, Dashboards, Auth UI
– State management: useReducer hooks
– Routing: react-router-dom
2. API Layer (Express Server)
– Routes: /auth, /bookings, /halls
– Controllers: authController, bookingController, hallController
– Middleware: authenticate JWT
3. Data Layer
– MongoDB (collections: users, bookings, halls)
– Mongoose ODM
4. External Services
– Email SMTP (verification, password reset)
– Hosting/CDN for client (e.g., Netlify/Vercel)
– Cloud DB (MongoDB Atlas)
b. Relationships & interactions
• Client → Server: Axios HTTP(S) calls → JWT in headers
• Server ↔ Database: Mongoose queries over TCP
• Server → Email service: SMTP via nodemailer
• Client ←→ Calendar real-time data: periodic GET /bookings or WebSocket (if added)
c. Architectural patterns & principles
– Separation of concerns: UI vs. API vs. DB
– RESTful API design
– Role-based access control via middleware
– Environment-driven configuration (URL, secrets, feature flags)
d. Technologies & frameworks
– React, Tailwind CSS, Axios, react-router
– Node.js, Express, Mongoose, MongoDB
– Nodemailer (email)
– Environment variables for feature toggles (HOD, Admin signup)