# bin0106/cnpm-24ct1-phantriduc architecture

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

- Interactive diagram: https://gitdiagram.com/bin0106/cnpm-24ct1-phantriduc
- Repository: https://github.com/bin0106/cnpm-24ct1-phantriduc

## Overview

UniLife is a student-life frontend for finding housing, food and entertainment, trading used goods, and accessing study materials. The user-facing flow enters a React SPA, browses these sections, opens listing details or contacts, and can save favorites; admins have listing and moderation tools. The repository contains multiple UniLife frontend copies, including a componentized demo, plus unrelated Java exercises that are not part of this product. The README documents local browser persistence; sampled excerpts do not expose its implementation, so storage links are documented rather than inferred from code.

Main entry points: [`unilife-demo/src/App.jsx`](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx) (UniLife app), [`unilife-demo/src/components/AdminView.jsx`](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AdminView.jsx) (Admin moderation), [`unilife-demo/src/main.jsx`](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/main.jsx) (Demo entry), [`src/main.jsx`](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/src/main.jsx) (Root entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry points"]
  node_appmain["UniLife app<br/>[App.jsx]"]
  node_demoentry["Demo entry<br/>[main.jsx]"]
  node_rootapp["Root app copy<br/>[App.jsx]"]
  node_rootentry["Root entry<br/>[main.jsx]"]
  node_studentapp["24CT1 app copy<br/>[App.jsx]"]
  node_studententry["24CT1 entry<br/>[main.jsx]"]
end

subgraph group_discovery["Student discovery"]
  node_housing["Housing search<br/>[App.jsx]"]
  node_food["Food listings<br/>[App.jsx]"]
  node_market["Used-goods market<br/>[App.jsx]"]
  node_entertainment["Entertainment listings<br/>[App.jsx]"]
  node_study["Study resources<br/>[App.jsx]"]
end

subgraph group_engagement["Interaction and admin"]
  node_details["Listing details<br/>[DetailModal.jsx]"]
  node_contact["Contact and chat<br/>[App.jsx]"]
  node_favorites["Favorites<br/>[App.jsx]"]
  node_auth["Authentication<br/>[AuthModal.jsx]"]
  node_submission["Location submission"]
  node_moderation["Admin moderation<br/>[AdminView.jsx]"]
end

subgraph group_data["Local data"]
  node_seeddata["Sample listings<br/>[mockData.js]"]
  node_browserstore[("Browser storage")]
end

node_student(("Student"))
node_admin(("Admin or host"))

node_student -->|"browses"| node_appmain
node_admin -->|"reviews posts"| node_moderation
node_demoentry -->|"renders"| node_appmain
node_rootentry -->|"renders"| node_rootapp
node_studententry -->|"renders"| node_studentapp
node_appmain -->|"shows"| node_housing
node_appmain -->|"shows"| node_food
node_appmain -->|"shows"| node_market
node_appmain -->|"shows"| node_entertainment
node_appmain -->|"shows"| node_study
node_appmain -->|"opens"| node_details
node_appmain -->|"opens"| node_auth
node_appmain -->|"opens"| node_submission
node_appmain -->|"shows"| node_moderation
node_appmain -->|"loads"| node_seeddata
node_student -->|"saves listings"| node_favorites
node_student -->|"contacts poster"| node_contact
node_appmain -->|"persists state"| node_browserstore
node_moderation -.->|"updates listings"| node_browserstore

click node_appmain "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_demoentry "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/main.jsx"
click node_rootapp "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/src/App.jsx"
click node_rootentry "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/src/main.jsx"
click node_studentapp "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/24CT1_PHAN-TRI-DUC/src/App.jsx"
click node_studententry "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/24CT1_PHAN-TRI-DUC/src/main.jsx"
click node_housing "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_food "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_market "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_entertainment "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_study "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_details "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/DetailModal.jsx"
click node_contact "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_favorites "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx"
click node_auth "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AuthModal.jsx"
click node_submission "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AddLocationModal.jsx"
click node_moderation "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AdminView.jsx"
click node_seeddata "https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/data/mockData.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_appmain,node_demoentry,node_rootapp,node_rootentry,node_studentapp,node_studententry toneBlue
class node_housing,node_food,node_market,node_entertainment,node_study toneAmber
class node_details,node_contact,node_favorites,node_auth,node_submission,node_moderation toneMint
class node_seeddata,node_browserstore toneRose
class node_student,node_admin toneIndigo
```

## Components

### App entry points

- [UniLife app](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Demo entry](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/main.jsx): `unilife-demo/src/main.jsx`
- [Root app copy](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/src/App.jsx): `src/App.jsx`
- [Root entry](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/src/main.jsx): `src/main.jsx`
- [24CT1 app copy](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/24CT1_PHAN-TRI-DUC/src/App.jsx): `24CT1_PHAN-TRI-DUC/src/App.jsx`
- [24CT1 entry](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/24CT1_PHAN-TRI-DUC/src/main.jsx): `24CT1_PHAN-TRI-DUC/src/main.jsx`

### Student discovery

- [Housing search](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Food listings](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Used-goods market](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Entertainment listings](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Study resources](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`

### Interaction and admin

- [Listing details](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/DetailModal.jsx): `unilife-demo/src/components/DetailModal.jsx`
- [Contact and chat](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Favorites](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/App.jsx): `unilife-demo/src/App.jsx`
- [Authentication](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AuthModal.jsx): `unilife-demo/src/components/AuthModal.jsx`
- [Location submission](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AddLocationModal.jsx): `unilife-demo/src/components/AddLocationModal.jsx`
- [Admin moderation](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/components/AdminView.jsx): `unilife-demo/src/components/AdminView.jsx`

### Local data

- [Sample listings](https://github.com/bin0106/cnpm-24ct1-phantriduc/blob/main/unilife-demo/src/data/mockData.js): `unilife-demo/src/data/mockData.js`
- **Browser storage**

### Other components

- **Student**
- **Admin or host**

## Connections

- Student → UniLife app: browses
- Admin or host → Admin moderation: reviews posts
- Demo entry → UniLife app: renders (evidence: `unilife-demo/src/main.jsx`)
- Root entry → Root app copy: renders (evidence: `src/main.jsx`)
- 24CT1 entry → 24CT1 app copy: renders (evidence: `24CT1_PHAN-TRI-DUC/src/main.jsx`)
- UniLife app → Housing search: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Food listings: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Used-goods market: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Entertainment listings: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Study resources: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Listing details: opens (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Authentication: opens (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Location submission: opens (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Admin moderation: shows (evidence: `unilife-demo/src/App.jsx`)
- UniLife app → Sample listings: loads (evidence: `unilife-demo/src/App.jsx`)
- Student → Favorites: saves listings
- Student → Contact and chat: contacts poster
- UniLife app → Browser storage: persists state
- Admin moderation → Browser storage: updates listings
