# hao-cpp/dieunw-project architecture

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

- Interactive diagram: https://gitdiagram.com/hao-cpp/dieunw-project
- Repository: https://github.com/hao-cpp/dieunw-project

## Overview

DIEUNW is a Vietnamese student community and learning web app. Users browse a social feed, connect with friends, message privately, join clubs, and use study resources and tools. The main flow is browser interaction through page-specific JavaScript to the server, which manages accounts and community data in SQLite; public learning rooms and resources use MockAPI. The sampled files show several client API calls, while some page-to-server wiring is only documented or implied, so those links are marked unverified. Build and test machinery is omitted.

Main entry points: [`server.js`](https://github.com/hao-cpp/dieunw-project/blob/main/server.js) (API Server), [`hoc-nhom.js`](https://github.com/hao-cpp/dieunw-project/blob/main/hoc-nhom.js) (Study Resources), [`script.js`](https://github.com/hao-cpp/dieunw-project/blob/main/script.js) (Social Feed), [`friends.js`](https://github.com/hao-cpp/dieunw-project/blob/main/friends.js) (Friends)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_community["Community"]
  node_feed["Social Feed<br/>[script.js]"]
  node_friends["Friends<br/>[friends.js]"]
  node_privatechat["Private Messages<br/>[messages.js]"]
  node_publicchat["Public Rooms<br/>[tro-chuyen.js]"]
end

subgraph group_identity["Accounts and Clubs"]
  node_profile["Profile and Auth<br/>[profile-auth.js]"]
  node_sections["Profile Sections"]
  node_clubs["Club Management<br/>[clubs.js]"]
  node_announcements["Club Announcements<br/>[announcements.js]"]
end

subgraph group_learning["Learning"]
  node_resources["Study Resources<br/>[hoc-nhom.js]"]
  node_selfstudy["Self Study Tools<br/>[tu-hoc.js]"]
end

subgraph group_platform["Application Backend"]
  node_server["API Server<br/>[server.js]"]
  node_sqlite[("Application Database<br/>[dieunw.sqlite]")]
end

node_student(("Student"))
node_mockapi{{"MockAPI"}}
node_emailjs{{"EmailJS"}}

node_student -->|"uses"| node_feed
node_student -->|"uses"| node_friends
node_student -->|"uses"| node_privatechat
node_student -->|"uses"| node_profile
node_student -->|"uses"| node_clubs
node_student -->|"uses"| node_announcements
node_student -->|"uses"| node_resources
node_student -->|"uses"| node_publicchat
node_student -->|"uses"| node_selfstudy
node_feed -->|"requests posts"| node_server
node_friends -->|"requests users"| node_server
node_privatechat -.->|"uses API"| node_server
node_profile -->|"uses API"| node_server
node_sections -->|"requests sections"| node_server
node_clubs -->|"requests clubs"| node_server
node_announcements -->|"posts announcements"| node_server
node_resources -->|"requests resources"| node_server
node_resources -.->|"uses resources"| node_mockapi
node_publicchat -->|"uses rooms"| node_mockapi
node_server -->|"reads and writes"| node_sqlite
node_server -.->|"sends OTP"| node_emailjs

click node_feed "https://github.com/hao-cpp/dieunw-project/blob/main/script.js"
click node_friends "https://github.com/hao-cpp/dieunw-project/blob/main/friends.js"
click node_privatechat "https://github.com/hao-cpp/dieunw-project/blob/main/messages.js"
click node_publicchat "https://github.com/hao-cpp/dieunw-project/blob/main/tro-chuyen.js"
click node_profile "https://github.com/hao-cpp/dieunw-project/blob/main/profile-auth.js"
click node_sections "https://github.com/hao-cpp/dieunw-project/blob/main/profile-sections.js"
click node_clubs "https://github.com/hao-cpp/dieunw-project/blob/main/clubs.js"
click node_announcements "https://github.com/hao-cpp/dieunw-project/blob/main/announcements.js"
click node_resources "https://github.com/hao-cpp/dieunw-project/blob/main/hoc-nhom.js"
click node_selfstudy "https://github.com/hao-cpp/dieunw-project/blob/main/tu-hoc.js"
click node_server "https://github.com/hao-cpp/dieunw-project/blob/main/server.js"
click node_sqlite "https://github.com/hao-cpp/dieunw-project/blob/main/data/dieunw.sqlite"

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_feed,node_friends,node_privatechat,node_publicchat toneBlue
class node_profile,node_sections,node_clubs,node_announcements toneAmber
class node_resources,node_selfstudy,node_mockapi toneMint
class node_server,node_sqlite toneRose
class node_student,node_emailjs toneIndigo
```

## Components

### Community

- [Social Feed](https://github.com/hao-cpp/dieunw-project/blob/main/script.js): `script.js`
- [Friends](https://github.com/hao-cpp/dieunw-project/blob/main/friends.js): `friends.js`
- [Private Messages](https://github.com/hao-cpp/dieunw-project/blob/main/messages.js): `messages.js`
- [Public Rooms](https://github.com/hao-cpp/dieunw-project/blob/main/tro-chuyen.js): `tro-chuyen.js`

### Accounts and Clubs

- [Profile and Auth](https://github.com/hao-cpp/dieunw-project/blob/main/profile-auth.js): `profile-auth.js`
- [Profile Sections](https://github.com/hao-cpp/dieunw-project/blob/main/profile-sections.js): `profile-sections.js`
- [Club Management](https://github.com/hao-cpp/dieunw-project/blob/main/clubs.js): `clubs.js`
- [Club Announcements](https://github.com/hao-cpp/dieunw-project/blob/main/announcements.js): `announcements.js`

### Learning

- [Study Resources](https://github.com/hao-cpp/dieunw-project/blob/main/hoc-nhom.js): `hoc-nhom.js`
- [Self Study Tools](https://github.com/hao-cpp/dieunw-project/blob/main/tu-hoc.js): `tu-hoc.js`

### Application Backend

- [API Server](https://github.com/hao-cpp/dieunw-project/blob/main/server.js): `server.js`
- [Application Database](https://github.com/hao-cpp/dieunw-project/blob/main/data/dieunw.sqlite): `data/dieunw.sqlite`

### Other components

- **Student**
- **MockAPI**
- **EmailJS**

## Connections

- Student → Social Feed: uses (evidence: `README.md`)
- Student → Friends: uses (evidence: `README.md`)
- Student → Private Messages: uses (evidence: `README.md`)
- Student → Profile and Auth: uses (evidence: `README.md`)
- Student → Club Management: uses (evidence: `README.md`)
- Student → Club Announcements: uses (evidence: `README.md`)
- Student → Study Resources: uses (evidence: `README.md`)
- Student → Public Rooms: uses (evidence: `README.md`)
- Student → Self Study Tools: uses (evidence: `README.md`)
- Social Feed → API Server: requests posts (evidence: `script.js`)
- Friends → API Server: requests users (evidence: `friends.js`)
- Private Messages → API Server: uses API
- Profile and Auth → API Server: uses API (evidence: `profile-auth.js`)
- Profile Sections → API Server: requests sections (evidence: `profile-sections.js`)
- Club Management → API Server: requests clubs (evidence: `clubs.js`)
- Club Announcements → API Server: posts announcements (evidence: `announcements.js`)
- Study Resources → API Server: requests resources (evidence: `hoc-nhom.js`)
- Study Resources → MockAPI: uses resources (evidence: `README.md`)
- Public Rooms → MockAPI: uses rooms (evidence: `tro-chuyen.js`)
- API Server → Application Database: reads and writes (evidence: `README.md`)
- API Server → EmailJS: sends OTP (evidence: `README.md`)
