How suryakumar2408/brainhire works
BrainHire is an interview-preparation web application. Users register or sign in, provide a resume or self-description and a job description, then review generated interview reports and can download a resume PDF. The frontend also supports report history and report detail views. The graph captures the documented routing and sampled controller relationships; frontend API-to-backend transport and the AI service’s external provider are not shown in the excerpts, so those links are omitted.
Main entry points: app.routes.jsx App routes · interview.controller.js Report operations · useAuth.js Auth actions · auth.routes.js Auth routes
Components 22
Web experience
- Landing page
frontend/src/features/landing/pages/Landing.jsx - App routes
frontend/src/app.routes.jsx
Identity
- Login and register
frontend/src/features/auth/pages/Login.jsx - Auth state
frontend/src/features/auth/auth.context.jsx - Auth actions
frontend/src/features/auth/hooks/useAuth.js - Auth API client
frontend/src/features/auth/services/auth.api.js - Route protection
frontend/src/features/auth/components/Protected.jsx
Interview preparation
- Report dashboard
frontend/src/features/interview/pages/Home.jsx - Report detail
frontend/src/features/interview/pages/Interview.jsx - Report actions
frontend/src/features/interview/hooks/useInterview.js - Interview API client
frontend/src/features/interview/services/interview.api.js
Backend runtime
- API application
backend/src/app.js - Auth routes
backend/src/routes/auth.routes.js - Interview routes
backend/src/routes/interview.routes.js - Auth operations
backend/src/controllers/auth.controller.js - Token validation
backend/src/middlewares/auth.middleware.js - Report operations
backend/src/controllers/interview.controller.js - AI generation
backend/src/services/ai.service.js
Persistent data
- User records
backend/src/models/user.model.js - Token blacklist
backend/src/models/blacklist.model.js - Interview reports
backend/src/models/interviewReport.model.js
Other components
- User
Connections 29
- User → Landing page: opens
- User → Login and register: authenticates
- User → Report dashboard: reviews reports
- User → Report detail: views report
- App routes → Landing page: routes to
frontend/src/app.routes.jsx - App routes → Login and register: routes to
frontend/src/app.routes.jsx - App routes → Route protection: guards routes
frontend/src/app.routes.jsx - App routes → Report dashboard: routes to
frontend/src/app.routes.jsx - App routes → Report detail: routes to
frontend/src/app.routes.jsx - Login and register → Auth actions: uses
frontend/src/features/auth/hooks/useAuth.js - Auth actions → Auth state: updates
frontend/src/features/auth/hooks/useAuth.js - Auth actions → Auth API client: calls
frontend/src/features/auth/hooks/useAuth.js - Auth state → Auth API client: checks session
frontend/src/features/auth/auth.context.jsx - Route protection → Auth actions: checks identity
frontend/src/features/auth/components/Protected.jsx - Report dashboard → Report actions: uses
frontend/src/features/interview/hooks/useInterview.js - Report detail → Report actions: uses
frontend/src/features/interview/hooks/useInterview.js - Report actions → Interview API client: calls
frontend/src/features/interview/hooks/useInterview.js - API application → Auth routes: mounts
backend/src/app.js - API application → Interview routes: mounts
backend/src/app.js - Auth routes → Auth operations: dispatches
backend/src/routes/auth.routes.js - Auth routes → Token validation: guards session
backend/src/routes/auth.routes.js - Interview routes → Token validation: guards requests
backend/src/routes/interview.routes.js - Interview routes → Report operations: dispatches
backend/src/routes/interview.routes.js - Auth operations → User records: reads and writes
backend/src/controllers/auth.controller.js - Auth operations → Token blacklist: records logout token
backend/src/controllers/auth.controller.js - Token validation → Token blacklist: checks token
backend/src/middlewares/auth.middleware.js - Report operations → AI generation: generates report
backend/src/controllers/interview.controller.js - Report operations → Interview reports: stores and reads
backend/src/controllers/interview.controller.js - Report operations → AI generation: generates resume PDF
backend/src/controllers/interview.controller.js