How akshat-acharya/ai-driven-student-company-recommendation-system works
1. This is a Next.js App Router monorepo-style web application split into three main surfaces: public marketing pages, authenticated student dashboards, and authenticated company dashboards. Route groups under app/(auth) and app/(dashboard) define the primary UI boundary, while app/api contains the backend logic.
2. The public site is lightweight and informational: landing/home, about, features, how-it-works, onboarding, and post-auth handoff pages. These pages mainly introduce the product and route users into sign-in/sign-up and role selection flows.
3. Authentication is centered on NextAuth.js with Google OAuth, exposed through app/api/auth/[...nextauth]. A separate app/api/register and app/api/user/role indicate that user creation and role assignment are handled outside the OAuth provider, likely because the system distinguishes student vs company accounts after login.
4. The dashboard layout is role-aware. app/(dashboard)/layout.tsx wraps both student and company portals, with shared chrome components such as the sidebar, navbar, logout button, theme controls, and role modal. This suggests a common authenticated shell with role-specific content inside it.
5. The student subsystem includes profile, dashboard, jobs list, job detail, recommendations, and resume pages. UI components like ApplyButton, StudentChat, resume-upload, skill-gap-card, and job-cards show that students can upload a resume, inspect parsed profile data, chat with an AI assistant, browse jobs, and apply.
6. The company subsystem mirrors that structure with dashboard, jobs list, job detail, and profile pages. Its component set is more operational: creating/editing jobs, candidate comparison, applicant review, job actions, and company chat. This is the employer-side workflow for posting roles and evaluating candidates.
7. The API layer is the main service boundary and is split by domain. Student APIs cover dashboard, jobs, profile, recommendations, chat, and apply; company APIs cover dashboard, jobs, applications, profile, compare, generate-job, re-evaluate, and chat. This clean separation makes the backend act like two coordinated domains rather than one generic CRUD surface.
8. AI functionality is isolated in lib/ai and exposed through specialized routes such as resume parsing, job generation, matching, and test endpoints. The repo explicitly uses LangChain and locally hosted Ollama models, so AI calls are treated as an internal service dependency rather than a third-party SaaS integration.
9. The AI layer is used for structured extraction and explanation, not final ranking. lib/ai/resumeParser.ts, matchScore.ts, and testModel.ts indicate three distinct concerns: turning unstructured resumes into normalized data, generating explainable match context, and validating model connectivity. The README confirms the actual recommendation score remains deterministic and rule-based.
10. The matching engine is the core product logic. It compares student profiles against job requirements using skill overlap, CGPA thresholding, experience alignment, and domain relevance. Company views also distinguish applied candidates from recommended non-applicants, so the system supports both reactive and proactive candidate discovery.
11. Persistence is handled through Prisma in prisma/schema.prisma with a long migration history, backed by Supabase PostgreSQL. This indicates the data model has evolved around auth support, role handling, student table changes, job status changes, and application workflow expansion. lib/prisma.ts is the database access boundary.
12. File upload and resume handling are separate from the main profile flow. The presence of app/api/resume/upload and app/api/resume/parse shows a staged pipeline: upload PDF, extract text, parse into structured fields, then persist into the student profile/recommendation model.
13. The app has a notable UI component library boundary. Reusable primitives live in components/ui, while domain-specific components are grouped under components/student, components/company, and components/landing. This makes the architecture easy to diagram as shared design system plus two functional portals.
14. Supporting infrastructure includes theme handling, mobile responsiveness, and route protection. providers.tsx, theme-provider, theme-toggle, use-mobile, and proxy.ts point to client-side state wrapping and request gating around authenticated routes. Static assets are minimal, so most behavior is runtime-driven through Next.js server routes and Prisma-backed persistence.
Main entry points: layout.tsx Dashboard shell · dashboard/route.ts Student API · dashboard/route.ts Company API · page.tsx Home
Components 34
Public site
Marketing and onboarding surfaces
- Home · Public landing page
app/page.tsx - About · Public information page
app/about/page.tsx - Features · Feature overview page
app/features/page.tsx - How it works · Explains product flow
app/how-it-works/page.tsx
Auth flow
Login, signup, and post-auth handoff
- Onboarding · Guides new users into the app
app/onboarding/page.tsx - Login · Sign-in surface
app/(auth)/login/page.tsx - Signup · Account creation surface
app/(auth)/signup/page.tsx - Post auth · Role selection or redirect after authentication
app/post-auth/page.tsx
Authenticated app
Role-aware student and company portals
- Dashboard shell · Shared authenticated layout for student and company portals
app/(dashboard)/layout.tsx - Student dashboard · Student overview page
app/(dashboard)/student/dashboard/page.tsx - Student jobs · Student job listing page
app/(dashboard)/student/jobs/page.tsx - Job detail · Student job detail page
app/(dashboard)/student/jobs/[jobId]/page.tsx - Recommendations · Student match recommendations
app/(dashboard)/student/recommendations/page.tsx - Resume · Resume and profile management
app/(dashboard)/student/resume/page.tsx - Company dashboard · Employer overview page
app/(dashboard)/company/dashboard/page.tsx - Company jobs · Employer job listing page
app/(dashboard)/company/jobs/page.tsx - Job detail · Employer job detail page
app/(dashboard)/company/jobs/[jobId]/page.tsx - Company profile · Employer profile page
app/(dashboard)/company/profile/page.tsx
API layer
Route handlers grouped by domain
- NextAuth · OAuth and session route
app/api/auth/[...nextauth]/route.ts - Register · User creation endpoint
app/api/register/route.ts - Role API · Role assignment endpoint
app/api/user/role/route.ts - Student API · Student dashboard, jobs, profile, recommendations, chat, and apply routes
app/api/student/dashboard/route.ts - Company API · Company dashboard, jobs, applications, profile, compare, generate, reevaluate, and chat routes
app/api/company/dashboard/route.ts - Resume API · Resume upload and parsing routes
app/api/resume/upload/route.ts - AI test · Connectivity test route for model validation
app/api/ai-test/route.ts
AI services
Local model and extraction helpers
- AI helpers · Resume parsing, matching, and model test helpers
lib/ai/matchScore.ts
Data layer
Persistence and external backend services
Shared UI
Reusable chrome, design system, and portal widgets
- Providers · Client providers and global state wrappers
app/providers.tsx - Navbar · Top navigation for authenticated areas
components/navbar.tsx - Sidebar · Primary navigation shell
components/sidebar.tsx - Role modal · Role selection dialog
components/role-modal.tsx - Student widgets · Resume upload, chat, apply, profile, and matching widgets
components/student/StudentChat.tsx
Connections 33
- Home → Login: sign in · Public entry to authentication
- Home → Signup: sign up · Public entry to account creation
- Home → Features: learn more · Marketing navigation
- Home → About: about · Marketing navigation
- Home → How it works: how it works · Explains product flow
- Signup → Register: create user · Creates the app user record after signup
- Login → NextAuth: oauth session · Google OAuth and session handling
- NextAuth → Role API: post-login role · Role resolution after authentication
- Post auth → Role modal: choose role · Role selection handoff
- Post auth → Dashboard shell: enter app · Routes into authenticated shell
- Dashboard shell → Sidebar: shell nav · Shared authenticated navigation
- Dashboard shell → Navbar: shell chrome · Shared authenticated top bar
- Dashboard shell → Providers: client state · Theme and client provider wrapping
- Dashboard shell → Student dashboard: student portal · Role-specific student surface
- Dashboard shell → Company dashboard: company portal · Role-specific company surface
- Student dashboard → Student API: load data · Fetches student dashboard data
- Student jobs → Student API: browse jobs · Uses student job endpoints
- Job detail → Student API: job detail · Loads a specific job through the student domain API
- Recommendations → Student API: recommendations · Fetches ranked job matches
- Resume → Resume API: upload parse · Uploads and parses resumes
- Resume → Student widgets: profile tools · Uses resume and profile widgets
- Company dashboard → Company API: load data · Fetches company dashboard data
- Company jobs → Company API: manage jobs · Uses company job endpoints
- Job detail → Company API: job detail · Loads employer job detail and related actions
- Company profile → Company API: edit profile · Company profile persistence and updates
- Student API → Prisma: read/write · Student domain persistence
- Company API → Prisma: read/write · Company domain persistence
- Resume API → AI helpers: parse text · Structured extraction from uploaded resumes
- Student API → AI helpers: match explain · Recommendation and chat support
- Company API → AI helpers: generate compare · Job generation, candidate comparison, and reevaluation
- AI test → AI helpers: test model · Model connectivity and validation
- AI helpers → Schema: model shapes · Uses persisted data model for matching and profiles
- Schema → Supabase: stored in · Prisma schema backed by hosted PostgreSQL