# laxmi-narayan-87/skillforge-academy- architecture

> Architecture diagram of the GitHub repository laxmi-narayan-87/skillforge-academy-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/laxmi-narayan-87/skillforge-academy-
- Repository: https://github.com/laxmi-narayan-87/skillforge-academy-

## Overview

##### Main System Components

A. Frontend Layer (React Application)
- Main page components (Dashboard, Profile, Roadmaps, etc.)
- Three core feature modules:
- Roadmap Generator System
- Course Management System
- User Progress Tracking System

B. Integration Layer
- AI Services Integration (OpenAI/GPT-4 via Thinkstack.ai)
- Authentication System (Supabase Auth)
- Data Management (Supabase Database)

C. Backend Services
- Course Management Service
- User Progress Service
- Roadmap Generation Service

##### Component Relationships

A. User Interface Components
- Main pages (/src/pages)
- Feature components (/src/components)
- UI components (/src/components/ui)

B. Data Flow
- Data flow between:
- Frontend components → Hooks (/src/hooks)
- Hooks → Supabase Integration
- AI Integration → Roadmap Generator

##### Specific Implementation Details

Key architectural elements:

A. State Management
- How useAuth, useRoadmaps, and useUserProgress hooks interact
- Integration with Supabase client

B. Feature Modules
- Detail the Roadmap Generation System:
- CareerGoalSection
- LearningStyleSection
- SkillLevelSection
- RoadmapContent

C. AI Integration
- AI workflow:
- User Input → AI Processing → Roadmap Generation

##### Additional Elements

A. Authentication Flow
- Complete auth process from AuthForm through Supabase

B. Data Models
- Data structures from /src/types
- Relationship between user progress and roadmaps

C. External Integrations
- Integration with:
- Supabase
- OpenAI/Thinkstack.ai
- Course providers

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef client fill:#3b82f6,color:white
    classDef feature fill:#22c55e,color:white
    classDef integration fill:#f97316,color:white
    classDef data fill:#a855f7,color:white
    classDef auth fill:#ef4444,color:white
    classDef external fill:#6b7280,color:white

    %% Client Layer
    subgraph ClientLayer
        UI["UI Components"]:::client
        Pages["Pages System"]:::client
        Forms["Form Schemas"]:::client
    end
    click UI "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/components/ui/"
    click Pages "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/pages/"
    click Forms "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/schemas/"

    %% Feature Layer
    subgraph FeatureLayer
        RoadmapGen["Roadmap Generator"]:::feature
        LearningMgmt["Learning Management"]:::feature
        ChatSystem["Chat System"]:::feature
        ProgressTrack["Progress Tracking"]:::feature
    end
    click RoadmapGen "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/components/roadmap-generator/"
    click LearningMgmt "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/components/roadmap/"
    click ChatSystem "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/components/ChatBot.tsx"
    click ProgressTrack "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/hooks/useUserProgress.tsx"

    %% Integration Layer
    subgraph IntegrationLayer
        AuthSystem["Authentication System"]:::integration
        SupabaseInt["Supabase Integration"]:::integration
        AIInt["AI Integration"]:::integration
        AuthHooks["Authentication Hooks"]:::integration
        AuthErrors["Auth Error Handling"]:::integration
    end
    click AuthSystem "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/components/auth/"
    click SupabaseInt "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/integrations/supabase/"
    click AIInt "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/utils/aiUtils.ts"
    click AuthHooks "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/hooks/useAuth.tsx"
    click AuthErrors "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/utils/authErrors.ts"

    %% Data Layer
    subgraph DataLayer
        StaticData["Static Data"]:::data
        RoadmapData["Roadmap Data"]:::data
        UserTypes["User Types"]:::data
        CourseData["Course Data"]:::data
    end
    click StaticData "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/data/"
    click RoadmapData "https://github.com/laxmi-narayan-87/skillforge-academy-/tree/main/src/data/roadmaps/"
    click UserTypes "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/types/user.ts"
    click CourseData "https://github.com/laxmi-narayan-87/skillforge-academy-/blob/main/src/utils/courseData.ts"

    %% External Services
    subgraph ExternalServices
        Supabase["Supabase DB"]:::external
        OpenAI["OpenAI API"]:::external
    end

    %% Relationships
    UI --> Pages
    Forms --> UI
    Pages --> RoadmapGen
    Pages --> LearningMgmt
    Pages --> ChatSystem
    AuthSystem --> AuthHooks
    AuthSystem --> AuthErrors
    RoadmapGen --> AIInt
    AIInt --> OpenAI
    LearningMgmt --> ProgressTrack
    ProgressTrack --> SupabaseInt
    ChatSystem --> AIInt
    SupabaseInt --> Supabase
    RoadmapGen --> RoadmapData
    LearningMgmt --> CourseData
    AuthSystem --> UserTypes
    StaticData --> Pages

    %% Legend
    subgraph Legend
        Client["Client Components"]:::client
        Feature["Feature Components"]:::feature
        Integration["Integration Services"]:::integration
        Data["Data Components"]:::data
        Auth["Authentication Components"]:::auth
        External["External Services"]:::external
    end
```
