# tahayparker/findmyprof architecture

> Architecture diagram of the GitHub repository tahayparker/findmyprof, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tahayparker/findmyprof
- Repository: https://github.com/tahayparker/findmyprof

## Overview

##### Main Components

A. Frontend Layer:
- Client-Side Pages (src/pages/)
- React Components (src/components/)
- Styling Modules (src/styles/)

B. Backend Layer:
- API Routes (src/pages/api/)
- Database Interface (src/lib/db.ts)
- Prisma ORM Layer

C. External Services:
- PostgreSQL Database (Neon)
- GitHub Actions Automation
- MyUOWD Timetable System

D. Data Processing:
- Python Scripts (scripts/)
- Schedule Generation
- Timetable Scraping

##### Component Relationships

**[External Data Source]**
- ↓
**[GitHub Actions Automation]**
- ↓
**[Python Scripts] → [Database]**
- ↑             ↑
**[Next.js Backend] ←→ [Prisma ORM]**
- ↑
**[Next.js Frontend]**
- ↑
**[Client Browser]**

##### Specific Implementation Details

Frontend Components:
- ProfessorsList
- Availability Checker
- Custom Graphs
- Interactive Timetable
- Professor Details View

API Routes:
- /api/professors
- /api/check-availability
- /api/schedule
- /api/professorDetails

Database Layer:
- Prisma Schema
- PostgreSQL Tables
- Data Models

Automation:
- Daily Updates (00:00 GST)
- Timetable Scraping
- Schedule Generation

##### Important Architectural Patterns to Highlight

- Next.js Pages Router Architecture
- API Routes Pattern
- Database Access Layer
- Automated Data Pipeline
- Real-time Availability Checking

##### Additional Elements

Specific elements:
- API endpoint connections
- Database relationships
- Automation workflow
- Client-server interaction paths

##### Technical Stack Indicators

- Next.js + TypeScript
- Prisma ORM
- PostgreSQL
- Python Scripts
- TailwindCSS
- GitHub Actions

This system design should emphasize the application's unique features like real-time availability checking and automated timetable updates, while clearly showing how all components work together to deliver the final user experience.

## Diagram (Mermaid)

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

    subgraph Frontend["Frontend Layer"]
        direction TB
        Pages["Next.js Pages"]:::frontend
        Components["Reusable Components"]:::frontend
        Styles["Styling System"]:::frontend

        Pages --> Components
        Pages --> Styles
        Components --> Styles
    end

    subgraph Backend["Backend Layer"]
        direction TB
        API["API Routes"]:::backend
        DBInterface["Database Interface"]:::backend
        Processing["Data Processing"]:::backend

        API --> DBInterface
        Processing --> DBInterface
    end

    subgraph External["External Services"]
        direction TB
        DB[(PostgreSQL DB)]:::database
        MyUOWD["MyUOWD Timetable"]:::external
        GHActions["GitHub Actions"]:::automation
    end

    Browser <--> Pages
    Pages <--> API
    API <--> DBInterface
    DBInterface <--> DB
    GHActions --> Processing
    Processing --> MyUOWD
    Processing --> DB

    %% Component Mappings
    click Pages "https://github.com/tahayparker/findmyprof/tree/main/src/pages/"
    click Components "https://github.com/tahayparker/findmyprof/tree/main/src/components/"
    click Styles "https://github.com/tahayparker/findmyprof/blob/main/src/styles/globals.css"
    click API "https://github.com/tahayparker/findmyprof/tree/main/src/pages/api/"
    click DBInterface "https://github.com/tahayparker/findmyprof/blob/main/src/lib/db.ts"
    click Processing "https://github.com/tahayparker/findmyprof/tree/main/scripts/"
    click GHActions "https://github.com/tahayparker/findmyprof/blob/main/.github/workflows/update-timetable.yml"

    %% Styling Classes
    classDef frontend fill:#3b82f6,color:#fff
    classDef backend fill:#22c55e,color:#fff
    classDef database fill:#eab308,color:#000
    classDef external fill:#a855f7,color:#fff
    classDef automation fill:#ef4444,color:#fff

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Component"]:::frontend
        Backend_L["Backend Component"]:::backend
        Database_L["Database"]:::database
        External_L["External Service"]:::external
        Automation_L["Automation"]:::automation
    end
```
