# heytoki/acit3495-group18 architecture

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

- Interactive diagram: https://gitdiagram.com/heytoki/acit3495-group18
- Repository: https://github.com/heytoki/acit3495-group18

## Overview

This is a student-grade entry and results application. Users register or sign in through either web app, then enter validated grades; a background worker aggregates grades by course, and the results app displays those aggregates. Authentication is delegated to a separate service, while the entry, aggregation, and results stages use MySQL and MongoDB. The graph reflects relationships visible in the excerpts; deployment and gateway wiring are not shown.

Main entry points: [`enter-data/src/app.js`](https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/app.js) (Grade entry app), [`show-results/src/app.js`](https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/app.js) (Results app), [`auth/app.py`](https://github.com/heytoki/acit3495-group18/blob/main/auth/app.py) (Authentication service), [`analytics/app.py`](https://github.com/heytoki/acit3495-group18/blob/main/analytics/app.py) (Grade aggregation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Grade entry"]
  node_entry_app["Grade entry app<br/>[app.js]"]
  node_grade_validation["Grade validation<br/>[validate.js]"]
  node_entry_jwt["Token verification<br/>[jwt.js]"]
  node_mysql_pool["MySQL pool<br/>[db.js]"]
  node_mysql[("Grade database<br/>[init.sql]")]
end

subgraph group_identity["Identity"]
  node_auth_service["Authentication service<br/>[app.py]"]
end

subgraph group_analytics["Analytics"]
  node_analytics_worker["Grade aggregation<br/>[app.py]"]
  node_mongo[("Analytics database<br/>[init.js]")]
end

subgraph group_results["Results"]
  node_results_app["Results app<br/>[app.js]"]
  node_results_jwt["Token verification<br/>[jwt.js]"]
  node_mongo_store["Mongo data access<br/>[db.js]"]
end

node_user(("User"))

node_user -->|"submits grades"| node_entry_app
node_entry_app -->|"validates input"| node_grade_validation
node_entry_app -->|"checks tokens"| node_entry_jwt
node_entry_app -->|"requests login"| node_auth_service
node_entry_app -->|"writes grades"| node_mysql
node_entry_app -->|"uses pool"| node_mysql_pool
node_auth_service -.->|"issues tokens"| node_user
node_analytics_worker -->|"reads grades"| node_mysql
node_analytics_worker -->|"upserts aggregates"| node_mongo
node_user -->|"views results"| node_results_app
node_results_app -->|"checks tokens"| node_results_jwt
node_results_app -->|"requests login"| node_auth_service
node_results_app -->|"fetches results"| node_mongo_store
node_mongo_store -->|"reads aggregates"| node_mongo

click node_entry_app "https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/app.js"
click node_grade_validation "https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/validate.js"
click node_entry_jwt "https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/jwt.js"
click node_mysql_pool "https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/db.js"
click node_mysql "https://github.com/heytoki/acit3495-group18/blob/main/mysql/init.sql"
click node_auth_service "https://github.com/heytoki/acit3495-group18/blob/main/auth/app.py"
click node_analytics_worker "https://github.com/heytoki/acit3495-group18/blob/main/analytics/app.py"
click node_mongo "https://github.com/heytoki/acit3495-group18/blob/main/mongo/init.js"
click node_results_app "https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/app.js"
click node_results_jwt "https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/jwt.js"
click node_mongo_store "https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/db.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_entry_app,node_grade_validation,node_entry_jwt,node_mysql_pool,node_mysql,node_user toneBlue
class node_auth_service toneAmber
class node_analytics_worker,node_mongo toneMint
class node_results_app,node_results_jwt,node_mongo_store toneRose
```

## Components

### Grade entry

- [Grade entry app](https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/app.js): `enter-data/src/app.js`
- [Grade validation](https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/validate.js): `enter-data/src/validate.js`
- [Token verification](https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/jwt.js): `enter-data/src/jwt.js`
- [MySQL pool](https://github.com/heytoki/acit3495-group18/blob/main/enter-data/src/db.js): `enter-data/src/db.js`
- [Grade database](https://github.com/heytoki/acit3495-group18/blob/main/mysql/init.sql): `mysql/init.sql`

### Identity

- [Authentication service](https://github.com/heytoki/acit3495-group18/blob/main/auth/app.py): `auth/app.py`

### Analytics

- [Grade aggregation](https://github.com/heytoki/acit3495-group18/blob/main/analytics/app.py): `analytics/app.py`
- [Analytics database](https://github.com/heytoki/acit3495-group18/blob/main/mongo/init.js): `mongo/init.js`

### Results

- [Results app](https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/app.js): `show-results/src/app.js`
- [Token verification](https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/jwt.js): `show-results/src/jwt.js`
- [Mongo data access](https://github.com/heytoki/acit3495-group18/blob/main/show-results/src/db.js): `show-results/src/db.js`

### Other components

- **User**

## Connections

- User → Grade entry app: submits grades (evidence: `enter-data/src/app.js`)
- Grade entry app → Grade validation: validates input (evidence: `enter-data/src/app.js`)
- Grade entry app → Token verification: checks tokens (evidence: `enter-data/src/app.js`)
- Grade entry app → Authentication service: requests login (evidence: `enter-data/src/app.js`)
- Grade entry app → Grade database: writes grades (evidence: `enter-data/src/app.js`)
- Grade entry app → MySQL pool: uses pool (evidence: `enter-data/src/server.js`)
- Authentication service → User: issues tokens
- Grade aggregation → Grade database: reads grades (evidence: `analytics/app.py`)
- Grade aggregation → Analytics database: upserts aggregates (evidence: `analytics/app.py`)
- User → Results app: views results (evidence: `show-results/src/app.js`)
- Results app → Token verification: checks tokens (evidence: `show-results/src/app.js`)
- Results app → Authentication service: requests login (evidence: `show-results/src/app.js`)
- Results app → Mongo data access: fetches results (evidence: `show-results/src/app.js`)
- Mongo data access → Analytics database: reads aggregates (evidence: `show-results/src/db.js`)
