How subu-4494/interview-prep-platform works
Project type and purpose
• This is a full-stack web application named “interview-prep-platform.”
• Purpose: Allow users to sign up/log in, view and book interview time slots, join a live interview room with a built-in code editor, and manage past or upcoming sessions.
File structure
• Top level:
• Backend/ – Node.js/Express API, MVC-style controllers, routes, models, middleware, and a scheduled job to clean expired interview rooms.
• Frontend/ – React single-page application (SPA) with components, pages, and a build output.
• Backend patterns:
• controllers/ handle request logic (authcontrollers.js, slotcontroller.js)
• routes/ map HTTP endpoints to controllers
• models/ define User and Slot data schemas (likely MongoDB via Mongoose)
• middlewares/ enforce auth
• jobs/ background task for cleaning expired slots
• Frontend structure:
• public/ & build/ – static HTML, assets for production
• src/ – React entry points (index.js, app.js), components (interviewroom), page views for login, signup, slots list, room, code editor, etc.
README for additional insights
• The README is minimal, so rely primarily on the structure to infer architecture and tech stack (Node.js, Express, React, likely MongoDB or similar).
a. Main components
• Web Client (React SPA)
• API Server (Express app)
• Authentication module (routes + controllers + JWT/session store)
• Scheduling module (slot management service + background cleaner job)
• Real-time interview room (component backed by WebSocket or similar)
• Data Store (e.g., MongoDB)
• (Optional) Cache or job queue (e.g., Redis, if used)
b. Relationships & interactions
1. The React SPA served from a static host or CDN in production calls the API Server over HTTPS.
2. API Server authenticates users, issues tokens, and checks them via auth middleware.
3. API Server exposes slot-booking endpoints that read/write to the database.
4. Interview Room component uses WebSocket (or polling) to synchronize code editing in real time and persisting transcripts or code snapshots to the DB.
5. Background job (cleanexpiredjobs.js) runs on a schedule to delete expired slots/rooms.
c. Architectural patterns / design principles
• Separation of concerns: clear frontend vs backend boundaries
• MVC style in the backend (models, controllers, routes)
• Token-based auth using middleware
• A small scheduled worker process for cleanup
d. Key technologies & libraries
• Frontend: React, React Router, Axios (or fetch)
• Backend: Node.js, Express, Mongoose (or ORM), dotenv for config
• Jobs: node-cron or setInterval for cleanup
• Data Store: MongoDB (or equivalent)
• WebSockets: socket.io (if real-time)
Final guiding notes
• Be detailed: break the API Server into subcomponents (Auth service, Slot service, Room service)
• Interactions: user → React → API → DB; background job → DB; WebSocket clients ↔ WebSocket server component
• Don’t overcomplicate: focus on the key flows that power login/signup, slot management, and live interviews