# datpro903-dau-24ct1/dau-congnghephanmem architecture

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

- Interactive diagram: https://gitdiagram.com/datpro903-dau-24ct1/dau-congnghephanmem
- Repository: https://github.com/datpro903-dau-24ct1/dau-congnghephanmem

## Overview

IT CONNECT is a student social network with a separate administrator role. The main student workflow is account access, then using the routed social pages to share and interact with posts, connect with classmates, message friends, manage notifications, and update a profile; administrators have a separate post-moderation console. The React pages call PHP API endpoints, which use the configured MySQL connection. Relationships are included where the excerpts or README establish them; unsampled page-to-endpoint wiring is not inferred.

Main entry points: [`src/App.jsx`](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/App.jsx) (App router), [`backend/php/config/database.php`](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/backend/php/config/database.php) (MySQL connection), [`src/ProtectedRoute.jsx`](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/ProtectedRoute.jsx) (Student route gate), [`src/pages/Home.jsx`](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Home.jsx) (Home feed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and routing"]
  node_app["App router<br/>[App.jsx]"]
  node_student_gate["Student route gate<br/>[ProtectedRoute.jsx]"]
  node_admin_gate["Admin route gate<br/>[AdminRoute.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
end

subgraph group_social["Student social features"]
  node_home["Home feed<br/>[Home.jsx]"]
  node_friends["Friend connections<br/>[Friends.jsx]"]
  node_messages["Messaging<br/>[Messages.jsx]"]
  node_notifications["Notifications<br/>[Notifications.jsx]"]
  node_account["Profile and account<br/>[Account.jsx]"]
  node_admin_console["Admin console<br/>[Admin.jsx]"]
end

subgraph group_api["PHP API"]
  node_auth_api["Authentication API"]
  node_account_api["Account API"]
  node_posts_api["Posts and interactions API"]
  node_friends_api["Friendship API"]
  node_messages_api["Messaging API"]
  node_notifications_api["Notifications API"]
end

subgraph group_data["Persistence"]
  node_db_config["MySQL connection<br/>[database.php]"]
  node_mysql[("MySQL database")]
end

node_students(("Students"))
node_admins(("Administrators"))

node_students -->|"use"| node_app
node_admins -->|"use"| node_app
node_app -->|"routes"| node_login
node_app -->|"routes"| node_register
node_app -->|"guards student routes"| node_student_gate
node_app -->|"guards admin route"| node_admin_gate
node_app -->|"routes"| node_home
node_app -->|"routes"| node_friends
node_app -->|"routes"| node_messages
node_app -->|"routes"| node_notifications
node_app -->|"routes"| node_account
node_app -->|"routes"| node_admin_console
node_student_gate -->|"allows"| node_home
node_student_gate -->|"allows"| node_friends
node_student_gate -->|"allows"| node_messages
node_student_gate -->|"allows"| node_notifications
node_student_gate -->|"allows"| node_account
node_admin_gate -->|"allows admin"| node_admin_console
node_login -.->|"calls"| node_auth_api
node_register -.->|"calls"| node_auth_api
node_home -->|"fetches posts and comments"| node_posts_api
node_home -.->|"fetches friends"| node_friends_api
node_home -.->|"fetches notifications"| node_notifications_api
node_friends -.->|"uses"| node_friends_api
node_messages -->|"fetches messages"| node_messages_api
node_notifications -->|"uses"| node_notifications_api
node_account -->|"updates profile"| node_account_api
node_account -.->|"loads posts"| node_posts_api
node_admin_console -.->|"moderates posts"| node_posts_api
node_auth_api -->|"connects via"| node_db_config
node_account_api -->|"connects via"| node_db_config
node_posts_api -->|"connects via"| node_db_config
node_friends_api -->|"connects via"| node_db_config
node_messages_api -->|"connects via"| node_db_config
node_notifications_api -->|"connects via"| node_db_config
node_db_config -->|"opens connection"| node_mysql

click node_app "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/App.jsx"
click node_student_gate "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/ProtectedRoute.jsx"
click node_admin_gate "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/AdminRoute.jsx"
click node_login "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Login.jsx"
click node_register "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Register.jsx"
click node_home "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Home.jsx"
click node_friends "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Friends.jsx"
click node_messages "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Messages.jsx"
click node_notifications "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Notifications.jsx"
click node_account "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Account.jsx"
click node_admin_console "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Admin.jsx"
click node_auth_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/auth"
click node_account_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/account"
click node_posts_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/posts"
click node_friends_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/friends"
click node_messages_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/messages"
click node_notifications_api "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/notifications"
click node_db_config "https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/backend/php/config/database.php"

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_app,node_student_gate,node_admin_gate,node_login,node_register toneBlue
class node_home,node_friends,node_messages,node_notifications,node_account,node_admin_console toneAmber
class node_auth_api,node_account_api,node_posts_api,node_friends_api,node_messages_api,node_notifications_api toneMint
class node_db_config,node_mysql toneRose
class node_students,node_admins toneIndigo
```

## Components

### Access and routing

- [App router](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/App.jsx): `src/App.jsx`
- [Student route gate](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/ProtectedRoute.jsx): `src/ProtectedRoute.jsx`
- [Admin route gate](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/AdminRoute.jsx): `src/AdminRoute.jsx`
- [Login](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Registration](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Register.jsx): `src/pages/Register.jsx`

### Student social features

- [Home feed](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Friend connections](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Friends.jsx): `src/pages/Friends.jsx`
- [Messaging](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Messages.jsx): `src/pages/Messages.jsx`
- [Notifications](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Notifications.jsx): `src/pages/Notifications.jsx`
- [Profile and account](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Account.jsx): `src/pages/Account.jsx`
- [Admin console](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`

### PHP API

- [Authentication API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/auth): `backend/php/auth`
- [Account API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/account): `backend/php/account`
- [Posts and interactions API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/posts): `backend/php/posts`
- [Friendship API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/friends): `backend/php/friends`
- [Messaging API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/messages): `backend/php/messages`
- [Notifications API](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/tree/main/backend/php/notifications): `backend/php/notifications`

### Persistence

- [MySQL connection](https://github.com/datpro903-dau-24ct1/dau-congnghephanmem/blob/main/backend/php/config/database.php): `backend/php/config/database.php`
- **MySQL database**

### Other components

- **Students**
- **Administrators**

## Connections

- Students → App router: use (evidence: `README.md`)
- Administrators → App router: use (evidence: `README.md`)
- App router → Login: routes (evidence: `src/App.jsx`)
- App router → Registration: routes (evidence: `src/App.jsx`)
- App router → Student route gate: guards student routes (evidence: `src/App.jsx`)
- App router → Admin route gate: guards admin route (evidence: `src/App.jsx`)
- App router → Home feed: routes (evidence: `src/App.jsx`)
- App router → Friend connections: routes (evidence: `src/App.jsx`)
- App router → Messaging: routes (evidence: `src/App.jsx`)
- App router → Notifications: routes (evidence: `src/App.jsx`)
- App router → Profile and account: routes (evidence: `src/App.jsx`)
- App router → Admin console: routes (evidence: `src/App.jsx`)
- Student route gate → Home feed: allows (evidence: `README.md`)
- Student route gate → Friend connections: allows (evidence: `README.md`)
- Student route gate → Messaging: allows (evidence: `README.md`)
- Student route gate → Notifications: allows (evidence: `README.md`)
- Student route gate → Profile and account: allows (evidence: `README.md`)
- Admin route gate → Admin console: allows admin (evidence: `README.md`)
- Login → Authentication API: calls
- Registration → Authentication API: calls
- Home feed → Posts and interactions API: fetches posts and comments (evidence: `src/pages/Home.jsx`)
- Home feed → Friendship API: fetches friends
- Home feed → Notifications API: fetches notifications
- Friend connections → Friendship API: uses
- Messaging → Messaging API: fetches messages (evidence: `src/pages/Messages.jsx`)
- Notifications → Notifications API: uses (evidence: `src/pages/Notifications.jsx`)
- Profile and account → Account API: updates profile (evidence: `src/pages/Account.jsx`)
- Profile and account → Posts and interactions API: loads posts
- Admin console → Posts and interactions API: moderates posts
- Authentication API → MySQL connection: connects via (evidence: `backend/php/auth/login.php`)
- Account API → MySQL connection: connects via (evidence: `backend/php/account/update.php`)
- Posts and interactions API → MySQL connection: connects via (evidence: `backend/php/posts/posts.php`)
- Friendship API → MySQL connection: connects via (evidence: `backend/php/friends/action.php`)
- Messaging API → MySQL connection: connects via (evidence: `backend/php/messages/get-messages.php`)
- Notifications API → MySQL connection: connects via (evidence: `backend/php/notifications/notifications.php`)
- MySQL connection → MySQL database: opens connection (evidence: `backend/php/config/database.php`)
