# tuosminh/greenedumap-dtudz-document architecture

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

- Interactive diagram: https://gitdiagram.com/tuosminh/greenedumap-dtudz-document
- Repository: https://github.com/tuosminh/greenedumap-dtudz-document

## Overview

GreenEduMap is presented as a green-city data and education platform. Its visible product workflow spans public environmental/map views, AI recommendations, school learning, and administrative monitoring; a separate FastAPI service handles registration, login, tokens, roles, users, and developer API keys. The README documents broader OpenData, GIS, and real-time ambitions, but the sampled files do not establish their runtime wiring. Web-page-to-hook/backend links are therefore omitted where source evidence is unavailable.

Main entry points: [`modules/web-app/src/app/page.tsx`](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/page.tsx) (Web application), [`modules/auth-service/app/main.py`](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/main.py) (Auth API routes), [`modules/auth-service/app/services/auth.py`](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/services/auth.py) (Auth operations), [`modules/auth-service/app/dependencies.py`](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/dependencies.py) (Auth dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[page.tsx]"]
end

subgraph group_domains["Green city features"]
  node_map["Environmental map<br/>[page.tsx]"]
  node_live["Environmental data<br/>[page.tsx]"]
  node_ai["AI insights<br/>[page.tsx]"]
  node_recommend["Green recommendations<br/>[page.tsx]"]
  node_chat["GreenBot chat<br/>[page.tsx]"]
  node_schools["School learning<br/>[page.tsx]"]
  node_schooldash["School dashboard<br/>[page.tsx]"]
  node_admin["Admin dashboard<br/>[page.tsx]"]
  node_ward["Ward management<br/>[page.tsx]"]
end

subgraph group_auth["Authentication service"]
  node_authapi["Auth API routes<br/>[main.py]"]
  node_authdeps["Auth dependencies<br/>[dependencies.py]"]
  node_authsvc["Auth operations<br/>[auth.py]"]
  node_usersvc["User management<br/>[user.py]"]
end

subgraph group_authdata["Auth data and security"]
  node_security["Token and key security<br/>[security.py]"]
  node_models["User and token models<br/>[models.py]"]
  node_db[("Auth database<br/>[database.py]")]
end

node_resident(("Community users"))

node_resident -->|"uses platform"| node_webapp
node_webapp -->|"offers map"| node_map
node_webapp -->|"shows environment"| node_live
node_webapp -->|"offers analysis"| node_ai
node_webapp -->|"offers actions"| node_recommend
node_webapp -->|"offers GreenBot"| node_chat
node_webapp -->|"supports learning"| node_schools
node_webapp -->|"supports schools"| node_schooldash
node_webapp -->|"supports governance"| node_admin
node_webapp -->|"manages areas"| node_ward
node_authapi -->|"dispatches auth"| node_authsvc
node_authapi -->|"dispatches user ops"| node_usersvc
node_authapi -->|"uses dependencies"| node_authdeps
node_authdeps -->|"creates service"| node_authsvc
node_authdeps -->|"creates service"| node_usersvc
node_authsvc -->|"hashes and signs"| node_security
node_authsvc -->|"queries and stores"| node_models
node_usersvc -->|"queries and updates"| node_models
node_models -->|"uses base"| node_db
node_authapi -->|"initializes and closes"| node_db

click node_webapp "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/page.tsx"
click node_map "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/map/page.tsx"
click node_live "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/stats/page.tsx"
click node_ai "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/ai-analysis/page.tsx"
click node_recommend "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/recommendations/page.tsx"
click node_chat "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/chat/page.tsx"
click node_schools "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/school/courses/page.tsx"
click node_schooldash "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/school/dashboard/page.tsx"
click node_admin "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/admin/dashboard/page.tsx"
click node_ward "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/admin/wards/page.tsx"
click node_authapi "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/main.py"
click node_authdeps "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/dependencies.py"
click node_authsvc "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/services/auth.py"
click node_usersvc "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/services/user.py"
click node_security "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/core/security.py"
click node_models "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/models.py"
click node_db "https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/core/database.py"

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_webapp,node_resident toneBlue
class node_map,node_live,node_ai,node_recommend,node_chat,node_schools,node_schooldash,node_admin,node_ward toneAmber
class node_authapi,node_authdeps,node_authsvc,node_usersvc toneMint
class node_security,node_models,node_db toneRose
```

## Components

### Web experience

- [Web application](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/page.tsx): `modules/web-app/src/app/page.tsx`

### Green city features

- [Environmental map](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/map/page.tsx): `modules/web-app/src/app/map/page.tsx`
- [Environmental data](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/stats/page.tsx): `modules/web-app/src/app/stats/page.tsx`
- [AI insights](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/ai-analysis/page.tsx): `modules/web-app/src/app/ai-analysis/page.tsx`
- [Green recommendations](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/recommendations/page.tsx): `modules/web-app/src/app/recommendations/page.tsx`
- [GreenBot chat](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/chat/page.tsx): `modules/web-app/src/app/chat/page.tsx`
- [School learning](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/school/courses/page.tsx): `modules/web-app/src/app/school/courses/page.tsx`
- [School dashboard](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/school/dashboard/page.tsx): `modules/web-app/src/app/school/dashboard/page.tsx`
- [Admin dashboard](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/admin/dashboard/page.tsx): `modules/web-app/src/app/admin/dashboard/page.tsx`
- [Ward management](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/web-app/src/app/admin/wards/page.tsx): `modules/web-app/src/app/admin/wards/page.tsx`

### Authentication service

- [Auth API routes](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/main.py): `modules/auth-service/app/main.py`
- [Auth dependencies](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/dependencies.py): `modules/auth-service/app/dependencies.py`
- [Auth operations](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/services/auth.py): `modules/auth-service/app/services/auth.py`
- [User management](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/services/user.py): `modules/auth-service/app/services/user.py`

### Auth data and security

- [Token and key security](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/core/security.py): `modules/auth-service/app/core/security.py`
- [User and token models](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/models.py): `modules/auth-service/app/models.py`
- [Auth database](https://github.com/tuosminh/greenedumap-dtudz-document/blob/main/modules/auth-service/app/core/database.py): `modules/auth-service/app/core/database.py`

### Other components

- **Community users**

## Connections

- Community users → Web application: uses platform
- Web application → Environmental map: offers map
- Web application → Environmental data: shows environment
- Web application → AI insights: offers analysis
- Web application → Green recommendations: offers actions
- Web application → GreenBot chat: offers GreenBot
- Web application → School learning: supports learning
- Web application → School dashboard: supports schools
- Web application → Admin dashboard: supports governance
- Web application → Ward management: manages areas
- Auth API routes → Auth operations: dispatches auth (evidence: `modules/auth-service/app/main.py`)
- Auth API routes → User management: dispatches user ops (evidence: `modules/auth-service/app/main.py`)
- Auth API routes → Auth dependencies: uses dependencies (evidence: `modules/auth-service/app/main.py`)
- Auth dependencies → Auth operations: creates service (evidence: `modules/auth-service/app/dependencies.py`)
- Auth dependencies → User management: creates service (evidence: `modules/auth-service/app/dependencies.py`)
- Auth operations → Token and key security: hashes and signs (evidence: `modules/auth-service/app/services/auth.py`)
- Auth operations → User and token models: queries and stores (evidence: `modules/auth-service/app/services/auth.py`)
- User management → User and token models: queries and updates (evidence: `modules/auth-service/app/services/user.py`)
- User and token models → Auth database: uses base (evidence: `modules/auth-service/app/models.py`)
- Auth API routes → Auth database: initializes and closes (evidence: `modules/auth-service/app/main.py`)
