# matrx007/tarkvara-project architecture

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

- Interactive diagram: https://gitdiagram.com/matrx007/tarkvara-project
- Repository: https://github.com/matrx007/tarkvara-project

## Overview

##### Main System Components

A. Frontend Layer
- Next.js Application (Client-Side)
- UI Components
- Page Components
- Client-Side Utils

B. Backend Layer
- TalTech API Integration
- Server Components
- Data Processing Services

C. External Services
- TalTech External APIs
- iCal Export Service

##### Component Relationships

**[Client Browser] ←→ [Next.js Frontend]**
- ↑               ↑

- ↓               ↓
- [Server Layer] ←→ [TalTech API Layer]
- ↑

- ↓
**[External TalTech Services]**

##### Detailed Component Breakdown

- Overview, Schedule, Search, Timetable
- Button, Dialog, Table, etc.

- Courses, Departments, Programs, Subjects
- Timetable Editor, iCal Exporter

- Server component (server.c and /server directory)
- Connection to API layer

##### Data Flow Indicators

- User interactions with the frontend
- API calls between frontend and backend
- Data flow between TalTech API and external services
- Export functionality for iCal

##### Technical Stack Indicators

- Next.js framework
- TypeScript/JavaScript
- Tailwind CSS
- Server-side components
- External API integrations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Frontend Layer"
        NextApp["Next.js Application"]
        
        subgraph "Page Components"
            Overview["Overview Page"]:::page
            Schedule["Schedule Page"]:::page
            Search["Search Page"]:::page
            Timetable["Timetable Page"]:::page
            Export["Export Page"]:::page
            AppLayout["Application Layout"]:::page
        end

        subgraph "UI Components"
            Button["Button"]:::ui
            Dialog["Dialog"]:::ui
            Table["Table"]:::ui
            Tabs["Tabs"]:::ui
        end

        subgraph "Client Utils"
            LayoutUtils["Layout Utilities"]:::util
            SearchUtils["Search Functionality"]:::util
            GeneralUtils["General Utilities"]:::util
        end
    end

    subgraph "Backend Layer"
        subgraph "TalTech API Integration"
            CourseAPI["Course API"]:::api
            DepartmentsAPI["Departments API"]:::api
            ProgramsAPI["Programs API"]:::api
            SubjectsAPI["Subjects API"]:::api
            TimetablesAPI["Timetables API"]:::api
        end

        subgraph "Special Services"
            ICalExport["iCal Export Service"]:::service
            TimetableEditor["Timetable Editor"]:::service
        end

        ServerComponent["Server Component"]:::server
    end

    subgraph "External Services"
        TalTechExternal["TalTech External APIs"]
    end

    %% Relationships
    Browser <--> NextApp
    NextApp <--> ServerComponent
    ServerComponent <--> TalTechExternal
    
    %% Component Interactions
    NextApp --> Overview & Schedule & Search & Timetable & Export
    Overview & Schedule & Search & Timetable & Export --> Button & Dialog & Table & Tabs
    SearchUtils --> Search
    LayoutUtils --> AppLayout
    
    ServerComponent --> CourseAPI & DepartmentsAPI & ProgramsAPI & SubjectsAPI & TimetablesAPI
    TimetablesAPI --> TimetableEditor
    TimetableEditor --> ICalExport
    
    %% Click Events
    click Overview "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/overview.tsx"
    click Schedule "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/schedule.tsx"
    click Search "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/search.tsx"
    click Timetable "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/timetable.tsx"
    click Export "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/export.tsx"
    click AppLayout "https://github.com/Matrx007/tarkvara-project/blob/main//src/app/layout.tsx"
    
    click Button "https://github.com/Matrx007/tarkvara-project/blob/main//src/components/ui/button.tsx"
    click Dialog "https://github.com/Matrx007/tarkvara-project/blob/main//src/components/ui/dialog.tsx"
    click Table "https://github.com/Matrx007/tarkvara-project/blob/main//src/components/ui/table.tsx"
    click Tabs "https://github.com/Matrx007/tarkvara-project/blob/main//src/components/ui/tabs.tsx"
    
    click LayoutUtils "https://github.com/Matrx007/tarkvara-project/blob/main//src/lib/layout.ts"
    click SearchUtils "https://github.com/Matrx007/tarkvara-project/blob/main//src/lib/search.js"
    click GeneralUtils "https://github.com/Matrx007/tarkvara-project/blob/main//src/lib/utils.ts"
    
    click CourseAPI "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/get_courses.js"
    click DepartmentsAPI "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/get_departments.js"
    click ProgramsAPI "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/get_program.js"
    click SubjectsAPI "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/get_subject.js"
    click TimetablesAPI "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/get_timetables.js"
    
    click ICalExport "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/ical_exporter.js"
    click TimetableEditor "https://github.com/Matrx007/tarkvara-project/blob/main//src/taltech_api/timetable_editor.js"
    click ServerComponent "https://github.com/Matrx007/tarkvara-project/tree/main//server"

    %% Styling
    classDef page fill:#e1f5fe,stroke:#01579b
    classDef ui fill:#e8f5e9,stroke:#2e7d32
    classDef util fill:#fff3e0,stroke:#ef6c00
    classDef api fill:#f3e5f5,stroke:#7b1fa2
    classDef service fill:#fce4ec,stroke:#c2185b
    classDef server fill:#ede7f6,stroke:#4527a0

    %% Legend
    subgraph Legend
        L1["Page Component"]:::page
        L2["UI Component"]:::ui
        L3["Utility"]:::util
        L4["API"]:::api
        L5["Service"]:::service
        L6["Server"]:::server
    end
```
