# blaiirytale/tkubuddy architecture

> Architecture diagram of the GitHub repository blaiirytale/tkubuddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/blaiirytale/tkubuddy
- Repository: https://github.com/blaiirytale/tkubuddy

## Overview

TKU Buddy is an Expo student companion prototype. Students enter through the app’s login and can view a home dashboard with graduation progress and general-education requirements, then browse course suggestions; profile and language settings are also available. The dashboard currently uses local mock data, while a separate Express backend exposes course lookup routes backed by PostgreSQL. The shown excerpts establish these component and data relationships, but do not show the mobile app calling the backend or completing planned features such as course planning and chat.

Main entry points: [`src/app/home.tsx`](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/home.tsx) (Home dashboard), [`src/context/ProfileContext.tsx`](https://github.com/blaiirytale/tkubuddy/blob/main/src/context/ProfileContext.tsx) (Profile state), [`src/app/suggestions.tsx`](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/suggestions.tsx) (Suggestions screen), [`backend/src/server.ts`](https://github.com/blaiirytale/tkubuddy/blob/main/backend/src/server.ts) (Course API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Student app"]
  node_login["Login screen<br/>[login.tsx]"]
  node_home["Home dashboard<br/>[home.tsx]"]
  node_quick["Quick access<br/>[QuickAccess.tsx]"]
  node_layout["App layout<br/>[_layout.tsx]"]
end

subgraph group_academic["Academic content"]
  node_progress["Graduation progress"]
  node_geview["General education"]
  node_gecard["Requirement card<br/>[GECard.tsx]"]
  node_gedata["Requirement data<br/>[geData.ts]"]
  node_suggestions["Suggestions screen<br/>[suggestions.tsx]"]
  node_suggestcard["Suggestion card<br/>[SuggestionCard.tsx]"]
  node_suggestdata["Suggestion data<br/>[suggestionsData.ts]"]
end

subgraph group_backend["Course backend"]
  node_api["Course API<br/>[server.ts]"]
  node_pool["Database connection<br/>[db.ts]"]
  node_courses[("Course database<br/>[schema.sql]")]
end

subgraph group_profile["Profile settings"]
  node_settings["Settings screen<br/>[settings.tsx]"]
  node_profile["Profile state<br/>[ProfileContext.tsx]"]
  node_avatar["Profile avatar<br/>[Avatar.tsx]"]
end

node_student(("Student"))

node_student -.->|"signs in"| node_login
node_layout -->|"provides state"| node_profile
node_home -->|"reads name"| node_profile
node_home -->|"loads categories"| node_gedata
node_home -->|"renders"| node_progress
node_home -->|"renders"| node_quick
node_home -->|"renders"| node_geview
node_home -->|"renders"| node_avatar
node_geview -->|"renders"| node_gecard
node_gecard -->|"reads types"| node_gedata
node_quick -.->|"routes on selection"| node_suggestions
node_suggestions -->|"loads suggestions"| node_suggestdata
node_suggestions -->|"renders"| node_suggestcard
node_suggestcard -->|"reads types"| node_suggestdata
node_settings -->|"reads and updates"| node_profile
node_avatar -->|"reads photo"| node_profile
node_api -->|"queries"| node_pool
node_api -->|"reads courses"| node_courses

click node_login "https://github.com/blaiirytale/tkubuddy/blob/main/src/app/login.tsx"
click node_home "https://github.com/blaiirytale/tkubuddy/blob/main/src/app/home.tsx"
click node_quick "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/QuickAccess.tsx"
click node_progress "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GraduationProgress.tsx"
click node_geview "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GeneralKnowledge.tsx"
click node_gecard "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GECard.tsx"
click node_gedata "https://github.com/blaiirytale/tkubuddy/blob/main/src/data/geData.ts"
click node_suggestions "https://github.com/blaiirytale/tkubuddy/blob/main/src/app/suggestions.tsx"
click node_suggestcard "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/SuggestionCard.tsx"
click node_suggestdata "https://github.com/blaiirytale/tkubuddy/blob/main/src/data/suggestionsData.ts"
click node_settings "https://github.com/blaiirytale/tkubuddy/blob/main/src/app/settings.tsx"
click node_profile "https://github.com/blaiirytale/tkubuddy/blob/main/src/context/ProfileContext.tsx"
click node_avatar "https://github.com/blaiirytale/tkubuddy/blob/main/src/components/Avatar.tsx"
click node_layout "https://github.com/blaiirytale/tkubuddy/blob/main/src/app/_layout.tsx"
click node_api "https://github.com/blaiirytale/tkubuddy/blob/main/backend/src/server.ts"
click node_pool "https://github.com/blaiirytale/tkubuddy/blob/main/backend/src/db.ts"
click node_courses "https://github.com/blaiirytale/tkubuddy/blob/main/backend/database/schema.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_home,node_quick,node_layout toneBlue
class node_progress,node_geview,node_gecard,node_gedata,node_suggestions,node_suggestcard,node_suggestdata toneAmber
class node_api,node_pool,node_courses toneMint
class node_settings,node_profile,node_avatar toneRose
class node_student toneIndigo
```

## Components

### Student app

- [Login screen](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/login.tsx): `src/app/login.tsx`
- [Home dashboard](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/home.tsx): `src/app/home.tsx`
- [Quick access](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/QuickAccess.tsx): `src/components/QuickAccess.tsx`
- [App layout](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`

### Academic content

- [Graduation progress](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GraduationProgress.tsx): `src/components/GraduationProgress.tsx`
- [General education](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GeneralKnowledge.tsx): `src/components/GeneralKnowledge.tsx`
- [Requirement card](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/GECard.tsx): `src/components/GECard.tsx`
- [Requirement data](https://github.com/blaiirytale/tkubuddy/blob/main/src/data/geData.ts): `src/data/geData.ts`
- [Suggestions screen](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/suggestions.tsx): `src/app/suggestions.tsx`
- [Suggestion card](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/SuggestionCard.tsx): `src/components/SuggestionCard.tsx`
- [Suggestion data](https://github.com/blaiirytale/tkubuddy/blob/main/src/data/suggestionsData.ts): `src/data/suggestionsData.ts`

### Course backend

- [Course API](https://github.com/blaiirytale/tkubuddy/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Database connection](https://github.com/blaiirytale/tkubuddy/blob/main/backend/src/db.ts): `backend/src/db.ts`
- [Course database](https://github.com/blaiirytale/tkubuddy/blob/main/backend/database/schema.sql): `backend/database/schema.sql`

### Profile settings

- [Settings screen](https://github.com/blaiirytale/tkubuddy/blob/main/src/app/settings.tsx): `src/app/settings.tsx`
- [Profile state](https://github.com/blaiirytale/tkubuddy/blob/main/src/context/ProfileContext.tsx): `src/context/ProfileContext.tsx`
- [Profile avatar](https://github.com/blaiirytale/tkubuddy/blob/main/src/components/Avatar.tsx): `src/components/Avatar.tsx`

### Other components

- **Student**

## Connections

- Student → Login screen: signs in
- App layout → Profile state: provides state (evidence: `src/app/_layout.tsx`)
- Home dashboard → Profile state: reads name (evidence: `src/app/home.tsx`)
- Home dashboard → Requirement data: loads categories (evidence: `src/app/home.tsx`)
- Home dashboard → Graduation progress: renders (evidence: `src/app/home.tsx`)
- Home dashboard → Quick access: renders (evidence: `src/app/home.tsx`)
- Home dashboard → General education: renders (evidence: `src/app/home.tsx`)
- Home dashboard → Profile avatar: renders (evidence: `src/app/home.tsx`)
- General education → Requirement card: renders (evidence: `src/components/GeneralKnowledge.tsx`)
- Requirement card → Requirement data: reads types (evidence: `src/components/GECard.tsx`)
- Quick access → Suggestions screen: routes on selection
- Suggestions screen → Suggestion data: loads suggestions (evidence: `src/app/suggestions.tsx`)
- Suggestions screen → Suggestion card: renders (evidence: `src/app/suggestions.tsx`)
- Suggestion card → Suggestion data: reads types (evidence: `src/components/SuggestionCard.tsx`)
- Settings screen → Profile state: reads and updates (evidence: `src/app/settings.tsx`)
- Profile avatar → Profile state: reads photo (evidence: `src/components/Avatar.tsx`)
- Course API → Database connection: queries (evidence: `backend/src/server.ts`)
- Course API → Course database: reads courses (evidence: `backend/src/server.ts`)
