How tejasxkoder/genai-project works
Purpose and Entry Points
This is a full-stack interview application with authentication, protected client routes, interview execution, AI-backed processing, uploaded-file handling, and persisted interview reports.
• Backend process: Backend/server.js, Backend/src/app.js
• Frontend bootstrap and root composition: Frontend/src/main.jsx, Frontend/src/App.jsx
• Client route definition: Frontend/src/app.routes.jsx
Backend HTTP Application
The Node.js backend separates application setup from process startup. Route modules expose authentication and interview APIs; controllers implement request-level orchestration.
• Application/server boundary: Backend/server.js, Backend/src/app.js
• Auth API surface: Backend/src/routes/auth.routes.js, Backend/src/controllers/auth.controller.js
• Interview API surface: Backend/src/routes/interview.routes.js, Backend/src/controllers/interview.controller.js
Primary flow is HTTP request → route → middleware where applicable → controller → model/service → HTTP response.
Identity and Access Control
Authentication is a cross-cutting backend/frontend concern. Users are persisted server-side, invalidated credentials/tokens are tracked separately, and protected frontend content is gated through auth context and a protection component.
• Server identity state: Backend/src/models/user.model.js, Backend/src/models/blacklist.model.js
• Request authorization boundary: Backend/src/middlewares/auth.middleware.js
• Client auth state and protected routes: Frontend/src/features/auth/auth.context.jsx, Frontend/src/features/auth/components/protected.jsx, Frontend/src/features/auth/hooks/useAuth.js
Client auth calls are isolated behind Frontend/src/features/auth/services/auth.api.js.
Interview Workflow and AI Boundary
Interview functionality is organized as its own frontend feature and backend route/controller pair. The backend controller is the workflow coordinator and delegates AI-specific behavior to a dedicated service, keeping external AI integration outside HTTP routing.
• Backend orchestration: Backend/src/controllers/interview.controller.js, Backend/src/routes/interview.routes.js
• AI integration boundary: Backend/src/services/ai.service.js
• Client interview screens/API boundary: Frontend/src/features/auth/pages/interview.jsx, Frontend/src/features/interview/pages/home.jsx, Frontend/src/features/interview/services/interview.api.js
Likely flow: authenticated client initiates/submits interview activity → interview API → controller invokes AI service and persistence → client renders interview/home state.
Persistence and File Handling
The backend has a centralized database configuration and three principal persistence domains: users, token/credential blacklist records, and interview reports. File upload parsing is deliberately isolated as middleware before interview controller handling.
• Database integration: Backend/src/config/database.js
• Interview-report persistence: Backend/src/models/interviewReport.model.js
• Upload boundary: Backend/src/middlewares/file.middleware.js
This establishes a material trust boundary: uploaded content should be processed only after file middleware and, for protected operations, authentication middleware.
Frontend Composition
The frontend is a React application built with Vite. Features are grouped primarily by auth and interview domain, with pages consuming feature-local API clients rather than directly coupling UI to backend endpoints.
• Vite/client runtime configuration: Frontend/vite.config.js, Frontend/package.json
• Auth pages: Frontend/src/features/auth/pages/Login.jsx, Frontend/src/features/auth/pages/Register.jsx
• Interview presentation: Frontend/src/features/interview/pages/home.jsx, Frontend/src/features/interview/style/interview.scss
The frontend’s main control flow is bootstrap → app/routes → auth provider/protected route checks → feature page → feature API service → backend HTTP API.
Main entry points: interview.routes.js Interview API · interview.controller.js Interview workflow · database.js Database connection · app.routes.jsx Client routes
Components 21
React client
- Client bootstrap
Frontend/src/main.jsx - App composition
Frontend/src/App.jsx - Client routes
Frontend/src/app.routes.jsx - Auth state
Frontend/src/features/auth/auth.context.jsx - Protected route gate
Frontend/src/features/auth/components/protected.jsx - Login and registration
Frontend/src/features/auth/pages/Login.jsx - Auth API client
Frontend/src/features/auth/services/auth.api.js - Interview UI
Frontend/src/features/interview/pages/home.jsx - Interview API client
Frontend/src/features/interview/services/interview.api.js
Node API
- Server process
Backend/server.js - HTTP application
Backend/src/app.js - Auth API
Backend/src/routes/auth.routes.js - Auth controller
Backend/src/controllers/auth.controller.js - Interview API
Backend/src/routes/interview.routes.js - Access and upload checks · Authenticates protected requests and parses uploaded files before interview handling.
Backend/src/middlewares/auth.middleware.js - Interview workflow · Coordinates interview processing, AI calls, and report persistence.
Backend/src/controllers/interview.controller.js - AI integration
Backend/src/services/ai.service.js
Persistence
- Database connection
Backend/src/config/database.js - Users
Backend/src/models/user.model.js - Invalidated tokens
Backend/src/models/blacklist.model.js - Interview reports
Backend/src/models/interviewReport.model.js
Connections 24
- Client bootstrap → App composition: mounts
- App composition → Client routes: renders
- Client routes → Auth state: uses
- Client routes → Protected route gate: guards
- Protected route gate → Interview UI: admits authenticated users
- Login and registration → Auth API client: auth requests
- Auth API client → Auth API: HTTP
- Interview UI → Interview API client: interview requests
- Interview API client → Interview API: HTTP
- Server process → HTTP application: starts
- HTTP application → Auth API: mounts
- HTTP application → Interview API: mounts
- Auth API → Auth controller: dispatches
- Interview API → Access and upload checks: runs before controller
- Access and upload checks → Interview workflow: validated request
- Interview API → Interview workflow: dispatches
- Auth controller → Users: manages identities
- Auth controller → Invalidated tokens: tracks invalidation
- Access and upload checks → Invalidated tokens: checks token state
- Interview workflow → AI integration: delegates processing
- Interview workflow → Interview reports: persists reports
- Database connection → Users: connects
- Database connection → Invalidated tokens: connects
- Database connection → Interview reports: connects