# shaurya1606/ai-course-generation architecture

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

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

## Overview

##### Project type and purpose
- This is a Turborepo‐powered monorepo hosting a single full-stack Next.js application called **letskraack** plus three shared packages:
– `@repo/ui` (a shared React component library)
– `@repo/eslint-config`
– `@repo/typescript-config`
- **letskraack** is an AI-driven e-learning/workspace platform with features like AI-powered interview practice, resume analysis, discussion rooms, course management, billing, etc.

##### File structure
- **Monorepo root**
– `pnpm-workspace.yaml` & `turbo.json` drive build/dev orchestration
– `packages/*` are workspace packages shared across apps
– `apps/letskraack` is a Next.js app using the App Router
- **apps/letskraack**
– `next.config.ts`, `drizzle.config.ts` configure Next.js and Drizzle ORM
– `src/app/**/*` defines page routes and serverless API routes (`src/app/api/*/route.tsx`)
– `src/components` holds reusable UI and feature-specific components
– `src/services` implements business logic / wrappers for AI, TTS, VTT, user, etc.
– `src/config/db.tsx` + `src/config/schema.ts` for database connectivity and schema definitions
– `src/context` for React contexts (user, conversation state)
– `src/lib` for utilities (e.g. PDF→image conversion)

##### README
- The README is the standard Turborepo starter template. It shows how the monorepo is built and run with `turbo`, but does not detail the **letskraack** app’s runtime architecture.

##### Elements
- **Clear labels** for: Browser, Next.js Frontend, API Routes, ORM, Database, External Services, Shared Packages, Turborepo Pipeline

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend
    Browser["Browser (User)"]:::frontend
    NextApp["Next.js App (letskraack)"]:::frontend
    Browser -->|"requests pages / API"| NextApp

    subgraph "Frontend Layer"
        direction TB
        Routes["App Router Routes"]:::frontend
        click Routes "https://github.com/shaurya1606/ai-course-generation/tree/main//apps/letskraack/src/app"
        AuthPages["Auth Pages (NextAuth)"]:::frontend
        click AuthPages "https://github.com/shaurya1606/ai-course-generation/tree/main//apps/letskraack/src/app/(auth)"
        Layout["App Layout & Global Styles"]:::frontend
        click Layout "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/app/layout.tsx"
        Components["UI Components"]:::frontend
        click Components "https://github.com/shaurya1606/ai-course-generation/tree/main//apps/letskraack/src/components"
        Contexts["React Contexts"]:::frontend
        click Contexts "https://github.com/shaurya1606/ai-course-generation/tree/main//apps/letskraack/src/context"
    end

    NextApp --> Routes
    NextApp --> AuthPages
    NextApp --> Layout
    NextApp --> Components
    NextApp --> Contexts

    %% Backend/API
    APIRoutes["Next.js API Routes"]:::backend
    click APIRoutes "https://github.com/shaurya1606/ai-course-generation/tree/main//apps/letskraack/src/app/api"
    NextApp -->|"calls"| APIRoutes

    subgraph "Service Layer"
        direction TB
        AIService["AI Model Services"]:::backend
        click AIService "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/services/aiModelServices.ts"
        TTSService["Text-to-Speech Services"]:::backend
        click TTSService "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/services/textToSpeechServices.ts"
        VTTService["Voice-to-Text Service"]:::backend
        click VTTService "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/services/voiceToTextService.ts"
        UserService["User API Wrappers"]:::backend
        click UserService "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/services/userServices.ts"
        PDFUtil["PDF→Image Utility"]:::backend
        click PDFUtil "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/lib/pdfToImage.ts"
        Utils["Misc Utilities"]:::backend
        click Utils "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/lib/utils.ts"
    end

    APIRoutes -->|"uses"| AIService
    APIRoutes -->|"uses"| TTSService
    APIRoutes -->|"uses"| VTTService
    APIRoutes -->|"uses"| UserService
    APIRoutes -->|"uses"| PDFUtil
    APIRoutes -->|"uses"| Utils

    %% ORM and Database
    DRZConfig["Drizzle ORM Config"]:::backend
    click DRZConfig "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/drizzle.config.ts"
    DBConn["DB Connectivity"]:::backend
    click DBConn "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/config/db.tsx"
    DBSchema["Schema Definitions"]:::backend
    click DBSchema "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/src/config/schema.ts"
    ORM["Drizzle ORM"]:::backend

    APIRoutes -->|"queries"| ORM
    ORM -->|"connects"| DB["PostgreSQL Database"]:::database
    ORM --> DBConn
    ORM --> DBSchema
    DBConn --> DB
    DBSchema --> DB

    %% External Services
    subgraph "External Services"
        direction TB
        OpenAI["AI API"]:::external
        TTSCloud["Text-to-Speech API"]:::external
        VTTCloud["Voice-to-Text API"]:::external
    end

    AIService -->|API Calls| OpenAI
    TTSService -->|API Calls| TTSCloud
    VTTService -->|API Calls| VTTCloud

    %% Monorepo & Pipeline
    subgraph "Monorepo Root"
        direction TB
        PNPM["pnpm-workspace.yaml"]:::pipeline
        click PNPM "https://github.com/shaurya1606/ai-course-generation/blob/main//pnpm-workspace.yaml"
        Turbo["turbo.json"]:::pipeline
        click Turbo "https://github.com/shaurya1606/ai-course-generation/blob/main//turbo.json"
        NextConfig["Next.js Config"]:::backend
        click NextConfig "https://github.com/shaurya1606/ai-course-generation/blob/main//apps/letskraack/next.config.ts"
        PackageJSON["package.json"]:::shared
        click PackageJSON "https://github.com/shaurya1606/ai-course-generation/blob/main//package.json"
        subgraph "Shared Packages"
            direction TB
            UIpkg["@repo/ui"]:::shared
            click UIpkg "https://github.com/shaurya1606/ai-course-generation/tree/main//packages/ui"
            ESLint["@repo/eslint-config"]:::shared
            click ESLint "https://github.com/shaurya1606/ai-course-generation/tree/main//packages/eslint-config"
            TSConfig["@repo/typescript-config"]:::shared
            click TSConfig "https://github.com/shaurya1606/ai-course-generation/tree/main//packages/typescript-config"
        end
    end

    %% Styles
    classDef frontend fill:#AEDFF7,stroke:#0366D6,color:#000
    classDef backend fill:#D6EAF8,stroke:#2E86C1,color:#000
    classDef database fill:#F9E79F,stroke:#B9770E,color:#000
    classDef external fill:#D5F5E3,stroke:#27AE60,color:#000
    classDef pipeline fill:#FADBD8,stroke:#C0392B,color:#000
    classDef shared fill:#E8DAEF,stroke:#8E44AD,color:#000
```
