How arbind0011/gen_ai_resumebuilder works
Purpose and Entry Points
This is a full-stack interview application with authentication, protected client views, interview execution, AI-backed processing, and persisted interview reports.
• Backend process entry: Backend/server.js; application composition: Backend/src/app.js.
• Frontend bootstrap and route assembly: Frontend/src/main.jsx, Frontend/src/App.jsx, Frontend/src/app.route.jsx.
Backend HTTP API Layer
The backend separates endpoint definitions from request orchestration.
• Authentication endpoints are defined in Backend/src/routes/auth.routes.js and handled by Backend/src/controller/auth.controller.js.
• Interview endpoints are defined in Backend/src/routes/interview.routes.js and handled by Backend/src/controller/interview.controller.js.
• Backend/src/app.js is the likely boundary where middleware and route groups are mounted.
Control flow is route → middleware → controller → model/service → HTTP response.
Identity and Session Protection
Authentication is a cross-cutting boundary on both server and client.
• Server-side authorization middleware: Backend/src/middlewares/auth.middleware.js.
• User and invalidated-token persistence: Backend/src/models/user.model.js, Backend/src/models/blacklist.model.js.
• Client authentication state and access control: Frontend/src/Features/auth/auth.context.jsx, Frontend/src/Features/auth/components/Protected.jsx, Frontend/src/Features/auth/hooks/useAuth.js.
The blacklist model indicates logout or token-revocation behavior is intended to be enforced server-side rather than relying solely on client token deletion.
Interview Workflow and AI Boundary
Interview processing is organized as a feature domain rather than scattered across generic UI/API code.
• Backend interview orchestration: Backend/src/controller/interview.controller.js.
• AI integration boundary: Backend/src/services/ai.service.js.
• Persisted output/report model: Backend/src/models/interviewReport.model.js.
• Client interview state and API access: Frontend/src/Features/interview/interview.context.jsx, Frontend/src/Features/interview/hooks/useInterview.js, Frontend/src/Features/interview/services/interview.api.js.
The controller should remain responsible for request validation and report lifecycle, while AI-provider-specific prompting or generation belongs behind ai.service.js.
File and Data Persistence Boundaries
The backend has distinct middleware and configuration boundaries for uploaded/request files and database access.
• File handling middleware: Backend/src/middlewares/file.middleware.js.
• Database configuration: Backend/src/config/database.js.
• Primary persisted entities: Backend/src/models/user.model.js, Backend/src/models/interviewReport.model.js, Backend/src/models/blacklist.model.js.
Database implementation and AI vendor are not identifiable from the supplied tree, but both are externally integrated behind dedicated backend modules.
Frontend Feature Structure
The frontend is organized by business capability: auth and interview, each containing pages, state, hooks, and API adapters.
• Auth screens and transport layer: Frontend/src/Features/auth/pages/Login.jsx, Frontend/src/Features/auth/pages/Register.jsx, Frontend/src/Features/auth/services/auth.api.js.
• Interview screens and transport layer: Frontend/src/Features/interview/pages/Home.jsx, Frontend/src/Features/interview/pages/Interview.jsx, Frontend/src/Features/interview/services/interview.api.js.
• Feature-level contexts provide shared state above individual pages: Frontend/src/Features/auth/auth.context.jsx, Frontend/src/Features/interview/interview.context.jsx.
The frontend is Vite-based, as indicated by Frontend/vite.config.js, and communicates with the backend only through feature-specific API service modules.
Main entry points: App.jsx App and routes · interview.routes.js Interview routes · app.js API application · auth.controller.js Auth controller
Components 22
Frontend
Vite client organized by auth and interview features.
- Client bootstrap
Frontend/src/main.jsx - App and routes
Frontend/src/App.jsx - Auth state
Frontend/src/Features/auth/auth.context.jsx - Protected views
Frontend/src/Features/auth/components/Protected.jsx - Login and register
Frontend/src/Features/auth/pages/Login.jsx - Auth API client
Frontend/src/Features/auth/services/auth.api.js - Interview state
Frontend/src/Features/interview/interview.context.jsx - Interview screens
Frontend/src/Features/interview/pages/Interview.jsx - Interview API client
Frontend/src/Features/interview/services/interview.api.js
Backend
HTTP API, domain orchestration, and persistence boundaries.
- Server process
Backend/server.js - API application · Mounts middleware and route groups.
Backend/src/app.js - Auth routes
Backend/src/routes/auth.routes.js - Interview routes
Backend/src/routes/interview.routes.js - Authorization middleware · Enforces server-side session protection.
Backend/src/middlewares/auth.middleware.js - Auth controller
Backend/src/controller/auth.controller.js - Interview controller · Validates requests and manages report lifecycle.
Backend/src/controller/interview.controller.js - File middleware
Backend/src/middlewares/file.middleware.js - AI service · Isolates provider-specific generation and prompting.
Backend/src/services/ai.service.js - Database · Stores users, revoked tokens, and interview reports.
Backend/src/config/database.js - User model
Backend/src/models/user.model.js - Token blacklist · Supports logout and token revocation.
Backend/src/models/blacklist.model.js - Interview report
Backend/src/models/interviewReport.model.js
Connections 25
- Client bootstrap → App and routes: starts
- App and routes → Protected views: protects routes with
- App and routes → Login and register: routes to
- App and routes → Interview screens: routes to
- Login and register → Auth state: updates
- Auth state → Auth API client: uses
- Protected views → Auth state: reads
- Interview screens → Interview state: uses
- Interview state → Interview API client: uses
- Auth API client → Auth routes: HTTP requests
- Interview API client → Interview routes: HTTP requests
- Server process → API application: runs
- API application → Auth routes: mounts
- API application → Interview routes: mounts
- Auth routes → Auth controller: dispatches to
- Interview routes → Authorization middleware: authorizes with
- Authorization middleware → Interview controller: permits
- Interview routes → File middleware: handles files with
- Auth controller → User model: manages
- Auth controller → Token blacklist: revokes via
- Interview controller → AI service: generates through
- Interview controller → Interview report: persists
- User model → Database: stores in
- Token blacklist → Database: stores in
- Interview report → Database: stores in