How hitansh911/smart-counseling-system works
1. Overall shape
- This is a Next.js App Router application organized as a product site plus a logged-in workspace. The root app/ directory contains the public landing page, authentication routes, and the main authenticated application.
2. Public vs authenticated boundary
- app/(auth) holds sign-in and sign-up pages behind an auth-specific layout.
- app/(main) holds the application experience: dashboard, onboarding, resume builder, interview tools, and AI cover letters.
- middleware.js and lib/checkUser.js indicate route protection and session/user gating at the edge or request boundary.
3. Primary product domains
- The app is centered on job-search workflow features:
- dashboard for overview/status
- resume for building resumes
- interview for practice quizzes and performance tracking
- ai-cover-letter for generating and managing cover letters
- onboarding for initial user setup
- Each domain has its own route folder and local components, which keeps feature logic isolated.
4. Dashboard as the entry workspace
- app/(main)/dashboard contains a page and a dashboard-view component.
- This is likely the hub that aggregates user progress and links into the other product modules.
5. Resume workflow
- app/(main)/resume contains a resume-builder and entry-form.
- This suggests a structured form-driven creation flow where users enter resume data and the builder renders the final output.
6. Interview workflow
- app/(main)/interview is split into a mock interview page and reusable components such as quiz, quiz list, result view, stats cards, and a performance chart.
- The presence of both quiz UI and analytics components indicates a loop of practice, scoring, and performance history.
7. AI cover letter workflow
- app/(main)/ai-cover-letter includes a list page, a new/create page, a detail page by id, plus generator and preview components.
- This implies a CRUD-style content flow: create → list → inspect/edit/preview, with generated content stored and revisited later.
8. Onboarding as a required setup step
- app/(main)/onboarding contains a dedicated onboarding form.
- This likely captures user profile or job-search preferences that then influence dashboard content and generated artifacts like resumes or cover letters.
9. Shared UI and design system
- components/ui/ is a reusable component library built from common primitives such as buttons, dialogs, tabs, inputs, selects, progress, and toasts.
- components/header.jsx, components/hero.jsx, and components/theme-provider.jsx support the public marketing pages and global app shell.
- components.json suggests these UI primitives were scaffolded with a component system such as shadcn/ui.
10. Content and marketing layer
- The data/ directory contains static content collections like FAQs, features, how-it-works, industries, and testimonials.
- These files feed the homepage/marketing experience and keep presentation content separate from route logic.
11. Backend/data access layer
- lib/prisma.js and the prisma/ directory define the database layer.
- Prisma migrations show the app depends on a relational database with evolving models for users and industry-related data.
- app/lib/schema.js and app/lib/helper.js likely hold validation and shared server-side utility logic close to the App Router surface.
12. Background jobs and event processing
- lib/inngest/client.js, lib/inngest/functions.js, and app/api/inngest/route.js show an event-driven background processing path.
- This is the main asynchronous boundary in the system: the app emits events or jobs, and Inngest handles deferred processing through a Next.js API route.
13. State, fetching, and UX utilities
- hooks/use-fetch.js suggests a shared client-side data-fetching hook used by multiple features.
- components/ui/sonner.jsx indicates toast/notification handling for async actions like form submission, generation, or save flows.
- lib/utils.js likely contains formatting or class-name helpers shared across components.
14. Architectural summary
- The core architecture is: authenticated Next.js UI pages on top of a Prisma-backed database, with user access controlled by middleware/auth checks, and background work delegated to Inngest.
- The main product boundary is feature-based: dashboard, resume, interview, and AI cover letter are separate modules that share a common UI system, auth layer, and persistence layer.
Main entry points: layout.js Workspace shell · resume/page.jsx Resume · interview/page.jsx Interview · ai-cover-letter/page.jsx Cover letters
Components 34
Public site
Marketing and unauthenticated entry points
- Home · Public landing page entry
app/page.jsx - App shell · Global application layout
app/layout.js - Content data · Marketing copy and feature data
data/features.js
Auth
Sign-in and sign-up flows
- Auth layout · Dedicated layout for sign-in and sign-up
app/(auth)/layout.js - Sign in · Authentication entry page
app/(auth)/sign-in/[[...sign-in]]/page.jsx - Sign up · Account creation page
app/(auth)/sign-up/[[...sign-up]]/page.jsx
Workspace
Authenticated product experience
- Workspace shell · Authenticated app layout
app/(main)/layout.js - Dashboard · Workspace overview entry
app/(main)/dashboard/page.jsx - Dashboard view · Dashboard composition and status panels
app/(main)/dashboard/_component/dashboard-view.jsx - Onboarding · Initial setup entry
app/(main)/onboarding/page.jsx - Onboard form · Captures profile and preferences
app/(main)/onboarding/_components/onboarding-form.jsx - Resume · Resume workflow entry
app/(main)/resume/page.jsx - Builder · Renders the resume output
app/(main)/resume/_components/resume-builder.jsx - Entry form · Collects resume data
app/(main)/resume/_components/entry-form.jsx - Interview · Interview practice entry
app/(main)/interview/page.jsx - Mock interview · Practice session page
app/(main)/interview/mock/page.jsx - Quiz · Question and answer flow
app/(main)/interview/_components/quiz.jsx - Stats · Performance summaries and charts
app/(main)/interview/_components/stats-cards.jsx - Cover letters · AI cover letter workspace entry
app/(main)/ai-cover-letter/page.jsx - New letter · Create cover letter flow
app/(main)/ai-cover-letter/new/page.jsx - Letter detail · Saved cover letter detail view
app/(main)/ai-cover-letter/[id]/page.jsx - Generator · Produces cover letter content
app/(main)/ai-cover-letter/_components/cover-letter-generator.jsx - Preview · Reviews generated output
app/(main)/ai-cover-letter/_components/cover-letter-preview.jsx
Shared UI
Reusable components and client utilities
- UI kit · Reusable UI primitives and controls
components/ui/button.jsx - Site comps · Header, hero, and theme provider
components/header.jsx - Fetch hook · Shared client-side data fetching
hooks/use-fetch.js
Backend
Database, auth gating, and background processing
- User gate · Session and user access helper
lib/checkUser.js - Middleware · Route protection at the request boundary
middleware.js - Prisma client · Database client setup
lib/prisma.js - Schema · Shared validation and helper schema
app/lib/schema.js - Inngest API · Webhook and event intake endpoint
app/api/inngest/route.js - Inngest client · Background job client
lib/inngest/client.js - Job handlers · Deferred background processing functions
lib/inngest/functions.js - Actions · Feature-specific server mutations
actions/dashboard.js
Connections 31
- Home → Site comps: renders · Homepage uses shared site UI
- Home → Content data: consumes · Homepage pulls marketing content
- App shell → UI kit: wraps · Global shell depends on shared primitives
- Auth layout → Sign in: hosts · Auth layout frames sign-in
- Auth layout → Sign up: hosts · Auth layout frames sign-up
- Workspace shell → Dashboard: routes to · Workspace layout serves dashboard area
- Workspace shell → Onboarding: routes to · Workspace layout serves onboarding
- Workspace shell → Resume: routes to · Workspace layout serves resume flow
- Workspace shell → Interview: routes to · Workspace layout serves interview tools
- Workspace shell → Cover letters: routes to · Workspace layout serves cover letters
- Middleware → User gate: delegates · Request protection relies on user/session checks
- Dashboard → Dashboard view: uses · Page composes the dashboard view
- Onboarding → Onboard form: uses · Onboarding page renders the setup form
- Resume → Entry form: uses · Resume page captures input data
- Resume → Builder: uses · Resume page renders the builder
- Interview → Quiz: uses · Interview page runs the quiz experience
- Interview → Stats: uses · Interview page shows performance tracking
- Mock interview → Quiz: reuses · Mock interview reuses quiz flow
- Cover letters → Generator: uses · List/workspace entry leads into generation
- Cover letters → Preview: uses · Workspace shows generated previews
- New letter → Generator: uses · New flow is centered on generation
- Letter detail → Preview: uses · Detail page previews a saved letter
- UI kit → Site comps: supports · Shared UI primitives underpin site components
- Fetch hook → Dashboard view: supports · Dashboard may fetch data through shared hook
- Fetch hook → Generator: supports · Generator flow may use shared fetching
- Prisma client → Actions: supports · Server actions persist and query data
- Schema → Actions: validates · Shared schema constrains server input
- Inngest API → Inngest client: ingests · API route connects app to job client
- Inngest client → Job handlers: dispatches · Client triggers async handlers
- Actions → Inngest client: emits · Mutations can enqueue background work
- Prisma client → Dashboard view: feeds · Dashboard data originates from database