How amandeep-a11y-oss/timetable works
Project type and purpose
• This is a full-stack web application for managing and viewing semester schedules (timetable generator).
• Backend is a Node.js/Express service with Passport.js authentication, MongoDB persistence.
• Frontend is a React SPA built with Vite, Tailwind CSS, and local state stores for auth and timetable data.
File structure
• Top-level:
– backend/ (Express API, models, controllers, routes, middleware, config)
– frontend/ (Vite + React app, components, pages, store, utils, public assets)
– package.json files at root and frontend for separate dependency management.
• Backend follows an MVC pattern:
– config/ (passport.js)
– models/ (Mongoose schemas: user, schedule, utils)
– controllers/ (auth logic, schedule utilities)
– routes/ (auth endpoints)
– middleware/ (JWT guard)
• Frontend organizes by:
– pages/ (route targets: Login, SignUp, Dashboard, Timetable, etc.)
– components/ (reusable UI pieces)
– store/ (Pinia-like or Zustand for auth and timetable state)
– utils/ (date formatting)
• Key config/deployment files:
– backend/index.js (Express server entrypoint, DB connect)
– backend/db/connectDB.js (MongoDB connection)
– frontend/vite.config.js, tailwind.config.js
Gather insights from README
• README is empty (“hii”), so rely on directory conventions and naming.
a. Main components
– Frontend SPA (React + Vite)
– Backend API service (Express.js)
– Database (MongoDB)
– Authentication layer (Passport.js + JWT)
– State management (authStore, timetableStore)
– External dependencies (e.g., npm registry, hosting/CDN)
b. Relationships and interactions
– User browser ↔ Frontend: HTTP(S) GET/POST to load SPA and interact.
– Frontend ↔ Backend API: fetch/POST JSON via /auth, /utils, schedule endpoints.
– Backend middleware authenticates JWT on protected routes.
– Controllers handle business logic, use Mongoose models to CRUD data in MongoDB.
– DB responds with data, controllers format and send JSON back to frontend.
c. Architectural patterns
– Backend: MVC with clear separation of routes → controllers → models.
– Frontend: Component-based UI plus centralized state stores.
– Stateless JWT authentication, middleware pipeline.
d. Key technologies
– Node.js, Express.js
– Passport.js (JWT strategy)
– Mongoose (MongoDB ODM)
– React, Vite, Tailwind CSS
– JavaScript (ESModules)