# songalobung/ahei architecture

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

- Interactive diagram: https://gitdiagram.com/songalobung/ahei
- Repository: https://github.com/songalobung/ahei

## Overview

AHEI is an Africa-first university discovery and comparison platform. Its user-facing flow presents university and regional information, rankings, and profiles; the broader Next.js app tree adds comparison, career guidance, articles, calculators, and administrative/API routes. The repository also contains two near-identical Vite UI trees, represented separately below. Source excerpts mainly establish the Vite app’s state-driven screen flow and static data; Next.js feature connections are not inferred where source was unavailable.

Main entry points: [`src/App.tsx`](https://github.com/songalobung/ahei/blob/main/src/App.tsx) (App orchestrator), [`src/data/universities.ts`](https://github.com/songalobung/ahei/blob/main/src/data/universities.ts) (University records), [`ahei-main/ahei-main/src/data/universities.ts`](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/data/universities.ts) (University records), [`ahei-main/ahei-main/src/App.tsx`](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/App.tsx) (App orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_next["Next.js product"]
  node_next_home["Home<br/>[page.tsx]"]
  node_next_rank["Rankings<br/>[page.tsx]"]
  node_next_unis["University directory<br/>[page.tsx]"]
  node_next_profile["University profile"]
  node_next_compare["Comparison<br/>[page.tsx]"]
  node_next_explore["Explore<br/>[page.tsx]"]
  node_next_careers["Careers<br/>[page.tsx]"]
  node_next_articles["Articles"]
  node_next_admin["Administration<br/>[page.tsx]"]
  node_next_api["Product API routes"]
  node_ranking_engine["Ranking engine<br/>[ranking-engine.ts]"]
end

subgraph group_root["Root Vite UI"]
  node_root_app["App orchestrator<br/>[App.tsx]"]
  node_root_home["Home screen<br/>[HomeScreen.tsx]"]
  node_root_rank["Rankings screen<br/>[RankingsScreen.tsx]"]
  node_root_profile["University profile"]
  node_root_compare["Compare screen<br/>[CompareScreen.tsx]"]
  node_root_data["University records<br/>[universities.ts]"]
  node_root_regions["Regions and insights<br/>[macroRegions.ts]"]
end

subgraph group_main["Nested Vite UI"]
  node_main_app["App orchestrator<br/>[App.tsx]"]
  node_main_home["Home screen<br/>[HomeScreen.tsx]"]
  node_main_rank["Rankings screen<br/>[RankingsScreen.tsx]"]
  node_main_profile["University profile"]
  node_main_compare["Compare screen<br/>[CompareScreen.tsx]"]
  node_main_data["University records<br/>[universities.ts]"]
  node_main_regions["Regions and insights<br/>[macroRegions.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_root_app
node_root_app -->|"renders"| node_root_home
node_root_app -->|"renders"| node_root_rank
node_root_app -->|"renders"| node_root_profile
node_root_app -->|"provides data"| node_root_data
node_root_home -->|"reads"| node_root_data
node_root_home -->|"reads"| node_root_regions
node_root_rank -->|"reads"| node_root_data
node_root_profile -->|"reads"| node_root_data
node_root_compare -->|"reads"| node_root_data
node_main_app -->|"renders"| node_main_home
node_main_app -->|"renders"| node_main_rank
node_main_app -->|"renders"| node_main_profile
node_main_app -->|"provides data"| node_main_data
node_main_home -->|"reads"| node_main_data
node_main_home -->|"reads"| node_main_regions
node_main_rank -->|"reads"| node_main_data
node_main_profile -->|"reads"| node_main_data
node_main_compare -->|"reads"| node_main_data

click node_next_home "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/page.tsx"
click node_next_rank "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/rankings/page.tsx"
click node_next_unis "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/universities/page.tsx"
click node_next_profile "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/universities/%5Bid%5D/UniversityDetailClient.tsx"
click node_next_compare "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/compare/page.tsx"
click node_next_explore "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/explore/page.tsx"
click node_next_careers "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/careers/page.tsx"
click node_next_articles "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/articles/ArticlesHubClient.tsx"
click node_next_admin "https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/admin/page.tsx"
click node_next_api "https://github.com/songalobung/ahei/tree/main/ahei-app/src/app/api"
click node_ranking_engine "https://github.com/songalobung/ahei/blob/main/ahei-app/src/domain/ranking-engine.ts"
click node_root_app "https://github.com/songalobung/ahei/blob/main/src/App.tsx"
click node_root_home "https://github.com/songalobung/ahei/blob/main/src/components/HomeScreen.tsx"
click node_root_rank "https://github.com/songalobung/ahei/blob/main/src/components/RankingsScreen.tsx"
click node_root_profile "https://github.com/songalobung/ahei/blob/main/src/components/UniversityProfileScreen.tsx"
click node_root_compare "https://github.com/songalobung/ahei/blob/main/src/components/CompareScreen.tsx"
click node_root_data "https://github.com/songalobung/ahei/blob/main/src/data/universities.ts"
click node_root_regions "https://github.com/songalobung/ahei/blob/main/src/data/macroRegions.ts"
click node_main_app "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/App.tsx"
click node_main_home "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/HomeScreen.tsx"
click node_main_rank "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/RankingsScreen.tsx"
click node_main_profile "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/UniversityProfileScreen.tsx"
click node_main_compare "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/CompareScreen.tsx"
click node_main_data "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/data/universities.ts"
click node_main_regions "https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/data/macroRegions.ts"

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_next_home,node_next_rank,node_next_unis,node_next_profile,node_next_compare,node_next_explore,node_next_careers,node_next_articles,node_next_admin,node_next_api,node_ranking_engine toneBlue
class node_root_app,node_root_home,node_root_rank,node_root_profile,node_root_compare,node_root_data,node_root_regions toneAmber
class node_main_app,node_main_home,node_main_rank,node_main_profile,node_main_compare,node_main_data,node_main_regions toneMint
class node_visitor toneIndigo
```

## Components

### Next.js product

- [Home](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/page.tsx): `ahei-app/src/app/page.tsx`
- [Rankings](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/rankings/page.tsx): `ahei-app/src/app/rankings/page.tsx`
- [University directory](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/universities/page.tsx): `ahei-app/src/app/universities/page.tsx`
- [University profile](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/universities/%5Bid%5D/UniversityDetailClient.tsx): `ahei-app/src/app/universities/[id]/UniversityDetailClient.tsx`
- [Comparison](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/compare/page.tsx): `ahei-app/src/app/compare/page.tsx`
- [Explore](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/explore/page.tsx): `ahei-app/src/app/explore/page.tsx`
- [Careers](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/careers/page.tsx): `ahei-app/src/app/careers/page.tsx`
- [Articles](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/articles/ArticlesHubClient.tsx): `ahei-app/src/app/articles/ArticlesHubClient.tsx`
- [Administration](https://github.com/songalobung/ahei/blob/main/ahei-app/src/app/admin/page.tsx): `ahei-app/src/app/admin/page.tsx`
- [Product API routes](https://github.com/songalobung/ahei/tree/main/ahei-app/src/app/api): `ahei-app/src/app/api`
- [Ranking engine](https://github.com/songalobung/ahei/blob/main/ahei-app/src/domain/ranking-engine.ts): `ahei-app/src/domain/ranking-engine.ts`

### Root Vite UI

- [App orchestrator](https://github.com/songalobung/ahei/blob/main/src/App.tsx): `src/App.tsx`
- [Home screen](https://github.com/songalobung/ahei/blob/main/src/components/HomeScreen.tsx): `src/components/HomeScreen.tsx`
- [Rankings screen](https://github.com/songalobung/ahei/blob/main/src/components/RankingsScreen.tsx): `src/components/RankingsScreen.tsx`
- [University profile](https://github.com/songalobung/ahei/blob/main/src/components/UniversityProfileScreen.tsx): `src/components/UniversityProfileScreen.tsx`
- [Compare screen](https://github.com/songalobung/ahei/blob/main/src/components/CompareScreen.tsx): `src/components/CompareScreen.tsx`
- [University records](https://github.com/songalobung/ahei/blob/main/src/data/universities.ts): `src/data/universities.ts`
- [Regions and insights](https://github.com/songalobung/ahei/blob/main/src/data/macroRegions.ts): `src/data/macroRegions.ts`

### Nested Vite UI

- [App orchestrator](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/App.tsx): `ahei-main/ahei-main/src/App.tsx`
- [Home screen](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/HomeScreen.tsx): `ahei-main/ahei-main/src/components/HomeScreen.tsx`
- [Rankings screen](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/RankingsScreen.tsx): `ahei-main/ahei-main/src/components/RankingsScreen.tsx`
- [University profile](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/UniversityProfileScreen.tsx): `ahei-main/ahei-main/src/components/UniversityProfileScreen.tsx`
- [Compare screen](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/components/CompareScreen.tsx): `ahei-main/ahei-main/src/components/CompareScreen.tsx`
- [University records](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/data/universities.ts): `ahei-main/ahei-main/src/data/universities.ts`
- [Regions and insights](https://github.com/songalobung/ahei/blob/main/ahei-main/ahei-main/src/data/macroRegions.ts): `ahei-main/ahei-main/src/data/macroRegions.ts`

### Other components

- **Visitor**

## Connections

- Visitor → App orchestrator: uses
- App orchestrator → Home screen: renders (evidence: `src/App.tsx`)
- App orchestrator → Rankings screen: renders (evidence: `src/App.tsx`)
- App orchestrator → University profile: renders (evidence: `src/App.tsx`)
- App orchestrator → University records: provides data (evidence: `src/App.tsx`)
- Home screen → University records: reads (evidence: `src/components/HomeScreen.tsx`)
- Home screen → Regions and insights: reads (evidence: `src/components/HomeScreen.tsx`)
- Rankings screen → University records: reads (evidence: `src/components/RankingsScreen.tsx`)
- University profile → University records: reads (evidence: `src/components/UniversityProfileScreen.tsx`)
- Compare screen → University records: reads (evidence: `src/components/CompareScreen.tsx`)
- App orchestrator → Home screen: renders (evidence: `ahei-main/ahei-main/src/App.tsx`)
- App orchestrator → Rankings screen: renders (evidence: `ahei-main/ahei-main/src/App.tsx`)
- App orchestrator → University profile: renders (evidence: `ahei-main/ahei-main/src/App.tsx`)
- App orchestrator → University records: provides data (evidence: `ahei-main/ahei-main/src/App.tsx`)
- Home screen → University records: reads (evidence: `ahei-main/ahei-main/src/components/HomeScreen.tsx`)
- Home screen → Regions and insights: reads (evidence: `ahei-main/ahei-main/src/components/HomeScreen.tsx`)
- Rankings screen → University records: reads (evidence: `ahei-main/ahei-main/src/components/RankingsScreen.tsx`)
- University profile → University records: reads (evidence: `ahei-main/ahei-main/src/components/UniversityProfileScreen.tsx`)
- Compare screen → University records: reads (evidence: `ahei-main/ahei-main/src/components/CompareScreen.tsx`)
