How sovitchaudhary/aiprephub works
Project Type and Purpose
• This is a full-stack Next.js (v13+) web application that provides AI-powered job-application tooling (cover-letter generation, resume building, interview prep, user dashboards). It uses the Next.js App Router, server components, client components, server actions, API routes, Inngest for background jobs, and Prisma ORM for database access.
File Structure & Architectural Insights
• Top-level “app/” directory: defines your route hierarchy using Next.js App Router.
• app/(auth)/… – Sign-in and sign-up flows (server components plus dynamic client pages).
• app/(main)/… – Main authenticated experience:
– ai-cover-letter/, resume/, interview/, dashboard/, onboarding/.
– Each has its own layout.js, page.jsx, and nested _components subfolders.
• app/api/inngest/route.js – HTTP endpoint to accept Inngest-driven webhooks or job kicks.
• app/lib/ – Shared helper code (helper.js, schema.js).
• “actions/” folder: Next.js 13 server-action modules that encapsulate core business logic (resume.js, cover-letter.js, interview.js, dashboard.js, user.js).
• “lib/inngest/…”: Inngest client setup and function definitions (background job handlers).
• “lib/prisma.js”: Prisma client initialization for connecting to the relational database defined in prisma/schema.prisma.
• “components/”: Reusable UI components (header, hero, theme-provider) and “components/ui/” for lower-level design primitives.
• “hooks/use-fetch.js”: Client hook to wrap fetch calls.
• “prisma/”: Database schema and migration files.
External Services & Dependencies
• AI API (e.g., OpenAI) – used by server actions to generate text.
• Inngest – background job orchestration for long-running tasks (bulk generation, email events, analytics).
• Relational database (PostgreSQL or MySQL) via Prisma.
• Vercel / cloud hosting for Next.js SSR/SSG.
Key Points to Capture
• Separation of concerns: UI vs. server vs. background.
• Flow of data: User interactions trigger server actions or API routes → AI calls + DB writes → responses or job enqueues.
• Reusability: actions/ modules and components/ui.
• Scalability: Inngest decouples heavy tasks.
• Incremental rendering: App Router, Server & Client Components.