# codecraftmedia3/matric500 architecture

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

- Interactive diagram: https://gitdiagram.com/codecraftmedia3/matric500
- Repository: https://github.com/codecraftmedia3/matric500

## Overview

Matric500 is a student learning-roadmap and community web app. Students sign in, complete a profile, explore subject and grade content, and track progress; the product also includes an AI study assistant, news and social features. Administrators manage users and content. The excerpts show server route registration and several module dependencies; unsampled client wiring is represented only where documented, so some UI-to-API links are omitted.

Main entry points: [`server.js`](https://github.com/codecraftmedia3/matric500/blob/main/server.js) (HTTP server), [`auth.js`](https://github.com/codecraftmedia3/matric500/blob/main/auth.js) (Authentication), [`roadmap.js`](https://github.com/codecraftmedia3/matric500/blob/main/roadmap.js) (Roadmap service), [`db.js`](https://github.com/codecraftmedia3/matric500/blob/main/db.js) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student interface"]
  node_index["Learning shell<br/>[index.html]"]
  node_app["Roadmap interface<br/>[app.js]"]
  node_login["Sign-in interface<br/>[login.js]"]
  node_assistant_ui["Assistant interface<br/>[assistant.js]"]
  node_social_ui["Socials interface<br/>[socials.js]"]
  node_admin_ui["Admin interface<br/>[admin.js]"]
end

subgraph group_learning["Learning services"]
  node_roadmap_data["Roadmap content<br/>[roadmap-data.json]"]
  node_roadmap_social["Social curriculum"]
  node_roadmap_service["Roadmap service<br/>[roadmap.js]"]
  node_ai_routes["AI assistant API<br/>[ai-routes.js]"]
end

subgraph group_community["Community features"]
  node_news_routes["News management<br/>[news-routes.js]"]
  node_social_routes["Social API<br/>[social-routes.js]"]
end

subgraph group_operations["Platform services"]
  node_auth["Authentication<br/>[auth.js]"]
  node_server["HTTP server<br/>[server.js]"]
  node_db["Database access<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
  node_admin_routes["Admin operations<br/>[admin.js]"]
end

node_student(("Student"))
node_administrator(("Administrator"))
node_google["Google sign-in"]
node_anthropic["Anthropic API"]

node_student -->|"opens"| node_index
node_administrator -->|"manages"| node_admin_ui
node_server -->|"serves"| node_index
node_server -->|"serves"| node_login
node_server -->|"serves"| node_assistant_ui
node_server -->|"mounts routes"| node_roadmap_service
node_server -->|"mounts routes"| node_ai_routes
node_server -->|"mounts routes"| node_news_routes
node_server -->|"mounts routes"| node_social_routes
node_server -->|"mounts routes"| node_admin_routes
node_server -->|"loads middleware"| node_auth
node_server -->|"connects"| node_db
node_roadmap_service -->|"loads"| node_roadmap_data
node_roadmap_service -->|"loads"| node_roadmap_social
node_roadmap_service -->|"reads and writes"| node_db
node_roadmap_service -->|"checks access"| node_auth
node_ai_routes -->|"requires sign-in"| node_auth
node_ai_routes -->|"requests completion"| node_anthropic
node_news_routes -->|"reads and writes"| node_db
node_news_routes -->|"checks access"| node_auth
node_social_routes -->|"reads and writes"| node_db
node_social_routes -->|"checks access"| node_auth
node_admin_routes -->|"reads and writes"| node_db
node_admin_routes -->|"requires admin"| node_auth
node_admin_routes -->|"uses roadmap index"| node_roadmap_service
node_auth -->|"loads user"| node_db
node_auth -->|"verifies token"| node_google
node_db -->|"queries"| node_postgres
node_index -.->|"hosts interface"| node_app
node_login -.->|"signs in"| node_auth
node_app -.->|"uses roadmap APIs"| node_roadmap_service
node_assistant_ui -.->|"sends prompts"| node_ai_routes
node_social_ui -.->|"uses social API"| node_social_routes
node_admin_ui -.->|"uses admin API"| node_admin_routes

click node_index "https://github.com/codecraftmedia3/matric500/blob/main/index.html"
click node_app "https://github.com/codecraftmedia3/matric500/blob/main/app.js"
click node_login "https://github.com/codecraftmedia3/matric500/blob/main/login.js"
click node_assistant_ui "https://github.com/codecraftmedia3/matric500/blob/main/assistant.js"
click node_social_ui "https://github.com/codecraftmedia3/matric500/blob/main/socials.js"
click node_admin_ui "https://github.com/codecraftmedia3/matric500/blob/main/admin.js"
click node_roadmap_data "https://github.com/codecraftmedia3/matric500/blob/main/roadmap-data.json"
click node_roadmap_social "https://github.com/codecraftmedia3/matric500/blob/main/roadmap-social.json"
click node_roadmap_service "https://github.com/codecraftmedia3/matric500/blob/main/roadmap.js"
click node_ai_routes "https://github.com/codecraftmedia3/matric500/blob/main/ai-routes.js"
click node_auth "https://github.com/codecraftmedia3/matric500/blob/main/auth.js"
click node_server "https://github.com/codecraftmedia3/matric500/blob/main/server.js"
click node_db "https://github.com/codecraftmedia3/matric500/blob/main/db.js"
click node_admin_routes "https://github.com/codecraftmedia3/matric500/blob/main/admin.js"
click node_news_routes "https://github.com/codecraftmedia3/matric500/blob/main/news-routes.js"
click node_social_routes "https://github.com/codecraftmedia3/matric500/blob/main/social-routes.js"

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_index,node_app,node_login,node_assistant_ui,node_social_ui,node_admin_ui toneBlue
class node_roadmap_data,node_roadmap_social,node_roadmap_service,node_ai_routes toneAmber
class node_news_routes,node_social_routes,node_anthropic toneMint
class node_auth,node_server,node_db,node_postgres,node_admin_routes toneRose
class node_student,node_administrator,node_google toneIndigo
```

## Components

### Student interface

- [Learning shell](https://github.com/codecraftmedia3/matric500/blob/main/index.html): `index.html`
- [Roadmap interface](https://github.com/codecraftmedia3/matric500/blob/main/app.js): `app.js`
- [Sign-in interface](https://github.com/codecraftmedia3/matric500/blob/main/login.js): `login.js`
- [Assistant interface](https://github.com/codecraftmedia3/matric500/blob/main/assistant.js): `assistant.js`
- [Socials interface](https://github.com/codecraftmedia3/matric500/blob/main/socials.js): `socials.js`
- [Admin interface](https://github.com/codecraftmedia3/matric500/blob/main/admin.js): `admin.js`

### Learning services

- [Roadmap content](https://github.com/codecraftmedia3/matric500/blob/main/roadmap-data.json): `roadmap-data.json`
- [Social curriculum](https://github.com/codecraftmedia3/matric500/blob/main/roadmap-social.json): `roadmap-social.json`
- [Roadmap service](https://github.com/codecraftmedia3/matric500/blob/main/roadmap.js): `roadmap.js`
- [AI assistant API](https://github.com/codecraftmedia3/matric500/blob/main/ai-routes.js): `ai-routes.js`

### Community features

- [News management](https://github.com/codecraftmedia3/matric500/blob/main/news-routes.js): `news-routes.js`
- [Social API](https://github.com/codecraftmedia3/matric500/blob/main/social-routes.js): `social-routes.js`

### Platform services

- [Authentication](https://github.com/codecraftmedia3/matric500/blob/main/auth.js): `auth.js`
- [HTTP server](https://github.com/codecraftmedia3/matric500/blob/main/server.js): `server.js`
- [Database access](https://github.com/codecraftmedia3/matric500/blob/main/db.js): `db.js`
- **PostgreSQL**
- [Admin operations](https://github.com/codecraftmedia3/matric500/blob/main/admin.js): `admin.js`

### Other components

- **Student**
- **Administrator**
- **Google sign-in**
- **Anthropic API**

## Connections

- Student → Learning shell: opens (evidence: `README.md`)
- Administrator → Admin interface: manages
- HTTP server → Learning shell: serves (evidence: `server.js`)
- HTTP server → Sign-in interface: serves (evidence: `server.js`)
- HTTP server → Assistant interface: serves (evidence: `server.js`)
- HTTP server → Roadmap service: mounts routes (evidence: `server.js`)
- HTTP server → AI assistant API: mounts routes (evidence: `server.js`)
- HTTP server → News management: mounts routes (evidence: `server.js`)
- HTTP server → Social API: mounts routes (evidence: `server.js`)
- HTTP server → Admin operations: mounts routes (evidence: `server.js`)
- HTTP server → Authentication: loads middleware (evidence: `server.js`)
- HTTP server → Database access: connects (evidence: `server.js`)
- Roadmap service → Roadmap content: loads (evidence: `roadmap.js`)
- Roadmap service → Social curriculum: loads (evidence: `roadmap.js`)
- Roadmap service → Database access: reads and writes (evidence: `roadmap.js`)
- Roadmap service → Authentication: checks access (evidence: `roadmap.js`)
- AI assistant API → Authentication: requires sign-in (evidence: `ai-routes.js`)
- AI assistant API → Anthropic API: requests completion (evidence: `ai-routes.js`)
- News management → Database access: reads and writes (evidence: `news-routes.js`)
- News management → Authentication: checks access (evidence: `news-routes.js`)
- Social API → Database access: reads and writes (evidence: `social-routes.js`)
- Social API → Authentication: checks access (evidence: `social-routes.js`)
- Admin operations → Database access: reads and writes (evidence: `admin.js`)
- Admin operations → Authentication: requires admin (evidence: `admin.js`)
- Admin operations → Roadmap service: uses roadmap index (evidence: `admin.js`)
- Authentication → Database access: loads user (evidence: `auth.js`)
- Authentication → Google sign-in: verifies token (evidence: `auth.js`)
- Database access → PostgreSQL: queries (evidence: `db.js`)
- Learning shell → Roadmap interface: hosts interface
- Sign-in interface → Authentication: signs in
- Roadmap interface → Roadmap service: uses roadmap APIs
- Assistant interface → AI assistant API: sends prompts
- Socials interface → Social API: uses social API
- Admin interface → Admin operations: uses admin API (evidence: `admin.js`)
