System Design

Technology Choices Explained
1. Core Framework
next
(15.5.3)
- The backbone of your app: routing, SSR/SSG, API endpoints (server actions in
/actions
), middleware, layouts.
- Fits perfectly with your flow: onboarding, dashboard, resume, interview prep are all separate routes.
- App Router simplifies server actions (e.g., saving resume, generating insights).
react
(19.1.0) + react-dom
- Frontend rendering engine.
- Lets you build modular UI components (
components/ui/*
) like Header
, Hero
, ResumeEditor
, Chart
.
2. Authentication
@clerk/nextjs
+ @clerk/themes
- Handles sign-up, sign-in, sessions.
- Clerk is central in your flow:
- New users → onboarding.
- Returning users → dashboard (skipping onboarding).
- Provides secure user management so you don’t need to roll your own auth.
@clerk/themes
makes it easy to style login pages to match your UI theme.
3. AI & Data Layer
@google/generative-ai
- Wraps Gemini API.
- Used in your system for:
- Generating industry insights (based on Neon DB industry/user data).
- Generating interview questions dynamically.
- Improving resume content (e.g., work experience descriptions).
@prisma/client
+ prisma
- Type-safe ORM to connect Next.js → Neon Postgres.
- Manages models you defined (
User
, Assessment
, Resume
, IndustryInsight
).
- In your flow:
- Onboarding → inserts user profile.
- Dashboard → fetches industry insights.
- Interview → stores test Qs & scores.
- Resume Builder → persists resume Markdown + AI suggestions.
inngest
- Schedules and runs background jobs.
- Critical for your Sunday industry insights refresh → calls Gemini → updates
IndustryInsight
in DB.
- Offloads heavy/recurring tasks so the user-facing app stays fast.
4. Forms & Validation
react-hook-form
+ @hookform/resolvers
- Used in Onboarding and Resume Builder forms.
- Manages form state, validation, and error messages.
resolvers
integrates with Zod schemas → consistent validation rules client + server.
zod
- Schema validation + type inference.
- Enforces constraints you showed earlier (
onboardingSchema
, resumeSchema
).
- Example:
- Onboarding form must have industry & experience between 0–50.
- Resume must have at least one experience/project entry.