# haadirakhangi/imagine-hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/haadirakhangi/imagine-hackathon
- Repository: https://github.com/haadirakhangi/imagine-hackathon

## Overview

##### Main Components

A. Frontend Layer (React/TypeScript Application):
- User Interface Components
- Company Dashboard
- Student/Employee Dashboard
- Assessment Modules
- Course Creation Interface
- Interview Simulation
- State Management (Context API evident from contexts folder)
- Media Handling (Audio/Video processing for interviews)

B. Backend Layer (Python Flask Application):
- API Gateway
- Core Services
- Content Generation Service
- Skills Analysis Service
- Lesson Planning Service
- Quiz Generation Service
- RAG (Retrieval-Augmented Generation) Service
- External API Integration Layer
- Gemini API
- Tavily API
- Serper API

C. Database Layer:
- MongoDB (indicated by MONGODB_URI in environment setup)

##### Component Relationships

**[Frontend Components] ←→ [API Gateway]**
- ↓
- [Core Services] ←→ [External APIs]
- ↓
- [Database Layer]

##### Specific Implementation Details

A. Frontend Architecture:
- Separation of concerns with directories:
- components/
- pages/
- hooks/
- contexts/
- lib/

B. Backend Architecture:
- Modular structure:
- api/
- core/
- models/
- server/

##### Important Flows to Highlight

A. Course Creation Flow:
**Company Dashboard → Content Generator → RAG System → External APIs → Course Storage**

B. Assessment Flow:
**User Interface → Skills Analyzer → Evaluator → Results Storage**

C. Interview Simulation Flow:
**Interview Component → Audio/Video Processing → AI Evaluation → Feedback Generation**

##### Technical Stack Indicators

- React/TypeScript (Frontend)
- Python/Flask (Backend)
- MongoDB (Database)
- WebRTC (for video/audio)
- AI/ML Services

##### External Services Layer (Third-party APIs)

This structure will accurately represent the system's architecture while maintaining clarity and providing sufficient detail for understanding the complete flow of the application.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[User Interface Layer]
        CD[Company Dashboard]:::frontend
        SD[Student Dashboard]:::frontend
        AM[Assessment Module]:::frontend
        CCI[Course Creation Interface]:::frontend
        IS[Interview Simulation]:::frontend
        MH[Media Handling]:::frontend
        SM[State Management]:::frontend
    end

    subgraph Backend
        AG[API Gateway]
        
        subgraph CoreServices
            CGS[Content Generation Service]:::backend
            SAS[Skills Analysis Service]:::backend
            LPS[Lesson Planning Service]:::backend
            QGS[Quiz Generation Service]:::backend
            RAG[RAG Service]:::backend
        end

        subgraph Routes
            CR[Company Routes]:::backend
            UR[User Routes]:::backend
        end

        subgraph ExternalAPIs
            GA[Gemini API]:::external
            TA[Tavily API]:::external
            SA[Serper API]:::external
        end
    end

    DB[(MongoDB)]:::database

    %% Frontend Connections
    UI --> CD & SD & AM & CCI & IS
    IS --> MH
    UI --> SM

    %% Backend Connections
    AG --> CoreServices
    CoreServices --> ExternalAPIs
    AG --> Routes
    Routes --> CoreServices
    CoreServices --> DB

    %% Cross-layer Connections
    Frontend --> AG

    %% Click Events
    click CD "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/pages/company/TeacherDashboard.tsx"
    click SD "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/pages/Dashboard/Dashboard.tsx"
    click AM "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/pages/AssessmentPage.tsx"
    click CCI "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/pages/company/Coursecreate.tsx"
    click IS "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/pages/Interview.tsx"
    click MH "https://github.com/haadirakhangi/Imagine-Hackathon/tree/main/client-side/src/lib"
    click SM "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/client-side/src/contexts/LiveAPIContext.tsx"
    click CGS "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/core/content_generator.py"
    click SAS "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/core/skills_analyzer.py"
    click LPS "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/core/lesson_planner.py"
    click QGS "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/core/quiz_generator.py"
    click RAG "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/core/rag.py"
    click GA "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/api/gemini_client.py"
    click TA "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/api/tavily_client.py"
    click SA "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/api/serper_client.py"
    click CR "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/server/company/routes.py"
    click UR "https://github.com/haadirakhangi/Imagine-Hackathon/blob/main/server-side/server/user/routes.py"

    classDef frontend fill:#2374ab
    classDef backend fill:#2a9d8f
    classDef external fill:#e9c46a
    classDef database fill:#8338ec

    %% Legend
    subgraph Legend
        F[Frontend Component]:::frontend
        B[Backend Service]:::backend
        E[External API]:::external
        D[(Database)]:::database
    end
```
