# flyingvaibhav/ai-course-generation architecture

> Architecture diagram of the GitHub repository flyingvaibhav/ai-course-generation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flyingvaibhav/ai-course-generation
- Repository: https://github.com/flyingvaibhav/ai-course-generation

## Overview

##### Project type and purpose
- This is a Turborepo monorepo hosting:
- A full-stack Next.js application called “letskraack” under `apps/letskraack`
- Shared tooling packages under `packages` (UI component library, ESLint configs, TypeScript configs)
- The “letskraack” app provides AI-powered features (interviews, coding challenges, resume analysis, course management, discussion rooms), backed by Next.js API routes, Drizzle ORM, and external AI/voice services.

##### File structure
- Top-level:
- `apps/letskraack`: Next.js app containing:
– `src/app/...`: file-based routing for pages and API routes
– `src/components/...`: domain-specific React components
– `src/services`: client wrappers for AI, coding evaluation, TTS/STT, user services
– `src/config`, `lib`, `constants`, `context`, `hooks`: configuration, utilities, and state management
– `drizzle.config.ts`: DB connection (likely PostgreSQL) using Drizzle ORM
- `packages/`: shared packages:
– `eslint-config`: monorepo lint rules
– `typescript-config`: shared tsconfig JSONs
– `ui`: shared React UI primitives
- Root files (`turbo.json`, `pnpm-workspace.yaml`): Turborepo orchestration, workspace config
- Patterns:
- Monorepo with task orchestration (build/dev/test) via Turborepo
- Full-stack Next.js with file-based routing, serverless API routes
- Modular separation: UI library vs. app code vs. tooling configs
- Service-oriented: each feature area has its own API route + client service in code

##### README for additional insights
- Confirms monorepo layout: multiple apps/packages, uses TS, ESLint, Prettier, Turbo CLI commands, remote caching

##### Detailed capture of architectural elements
- Route groups (auth, workspace, ai-interview, coding, resume, discussion)
- API function endpoints (ai-chat, coding-check, resume-analysis, etc.)
- Service modules (aiModelServices, voiceToTextService, etc.)
- Data schema/config (drizzle.config.ts, schema.ts)
- Shared UI library as a single reusable block
- Pipeline steps: lint, type-check, build, test, cache

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer and CI
    DevCI["Developer / CI"]:::actor
    DevCI -->|push & run| TurboCLI

    %% Turborepo Pipeline
    TurboCLI["Turborepo Pipeline"]:::toolchain
    click TurboCLI "https://github.com/flyingvaibhav/ai-course-generation/blob/main/turbo.json"
    click TurboCLI "https://github.com/flyingvaibhav/ai-course-generation/blob/main/pnpm-workspace.yaml"

    %% Monorepo Root
    subgraph "Monorepo"
        direction TB

        %% Apps
        subgraph "apps/letskraack (Next.js App)" 
            direction TB
            AppRoot["letskraack"]:::code
            click AppRoot "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/"

            %% UI Layer
            subgraph "UI Layer" 
                direction TB
                FileRoutes["File-based Routes"]:::code
                click FileRoutes "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/app/"
                Components["Domain Components"]:::code
                click Components "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/components/"
            end

            %% API Layer
            APILayer["API Routes"]:::runtime
            click APILayer "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/app/api/"

            %% Business Services
            subgraph "Services" 
                direction TB
                AIModel["AI Model Services"]:::runtime
                click AIModel "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/services/aiModelServices.ts"
                CodingEval["Coding Evaluator"]:::runtime
                click CodingEval "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/services/coding.ts"
                TTS["Text-to-Speech"]:::runtime
                click TTS "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/services/textToSpeechServices.ts"
                STT["Voice-to-Text"]:::runtime
                click STT "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/services/voiceToTextService.ts"
                UserSvc["User Services"]:::runtime
                click UserSvc "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/services/userServices.ts"
            end

            %% Data Layer
            subgraph "Data Layer"
                direction TB
                DrizzleCfg["drizzle.config.ts"]:::code
                click DrizzleCfg "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/drizzle.config.ts"
                DBConf["DB Connection"]:::code
                click DBConf "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/config/db.tsx"
                Schema["Schema Definitions"]:::code
                click Schema "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/config/schema.ts"
            end

            %% Config & Tooling
            subgraph "App Config & Tooling"
                direction TB
                NextCfg["next.config.ts"]:::code
                click NextCfg "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/next.config.ts"
                ESLintCfg["eslint.config.mjs"]:::code
                click ESLintCfg "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/eslint.config.mjs"
                PostCSS["postcss.config.mjs"]:::code
                click PostCSS "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/postcss.config.mjs"
                TsCfg["tsconfig.json"]:::code
                click TsCfg "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/tsconfig.json"
            end

            %% State & Utilities
            subgraph "State & Utilities"
                direction TB
                Context["Context Providers"]:::code
                click Context "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/context/"
                Hooks["Custom Hooks"]:::code
                click Hooks "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/hooks/"
                Lib["Utilities"]:::code
                click Lib "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/lib/"
                Consts["Constants"]:::code
                click Consts "https://github.com/flyingvaibhav/ai-course-generation/blob/main/apps/letskraack/src/constants/constant.ts"
                Types["Types"]:::code
                click Types "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/src/types/"
            end

            %% Public Assets
            Public["Public Assets"]:::code
            click Public "https://github.com/flyingvaibhav/ai-course-generation/tree/main/apps/letskraack/public/"
        end

        %% Packages
        subgraph "packages (Shared)" 
            direction TB
            UIPkg["@repo/ui"]:::code
            click UIPkg "https://github.com/flyingvaibhav/ai-course-generation/tree/main/packages/ui/"
            ESLintPkg["@repo/eslint-config"]:::code
            click ESLintPkg "https://github.com/flyingvaibhav/ai-course-generation/tree/main/packages/eslint-config/"
            TSPkg["@repo/typescript-config"]:::code
            click TSPkg "https://github.com/flyingvaibhav/ai-course-generation/tree/main/packages/typescript-config/"
        end
    end

    %% External Runtime
    subgraph "External Services"
        direction TB
        AIProvider["AI Provider (OpenAI)"]:::runtime
        TTSSTT["TTS / STT Services"]:::runtime
    end
    DB["PostgreSQL DB"]:::runtime

    %% Interactions
    TurboCLI -->|build/test/cache| Monorepo
    UIPkg -->|import| FileRoutes
    ESLintPkg -->|config| AppRoot
    TSPkg -->|config| AppRoot

    FileRoutes -->|fetch| APILayer
    Components -->|render| FileRoutes
    APILayer -->|invoke| AIModel
    APILayer -->|invoke| CodingEval
    APILayer -->|invoke| TTS
    APILayer -->|invoke| STT
    APILayer -->|invoke| UserSvc

    AIModel -->|query| AIProvider
    TTS -->|synthesize| TTSSTT
    STT -->|transcribe| TTSSTT

    AIModel -->|persist/retrieve| DB
    CodingEval -->|persist/retrieve| DB
    UserSvc -->|persist/retrieve| DB

    %% Styles
    classDef code fill:#E3F2FD,stroke:#90CAF9,color:#0D47A1
    classDef runtime fill:#FFF3E0,stroke:#FFB74D,color:#E65100
    classDef toolchain fill:#E0E0E0,stroke:#BDBDBD,color:#424242
    classDef actor fill:#C8E6C9,stroke:#66BB6A,color:#1B5E20
```
