# fudarren/mutiara-connect architecture

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

- Interactive diagram: https://gitdiagram.com/fudarren/mutiara-connect
- Repository: https://github.com/fudarren/mutiara-connect

## Overview

Mutiara-Connect is a community portal for Penang LRT construction information, news, notifications, and public feedback, with a separate staff management area. Residents browse project updates and map details, read news and alerts, or submit and track reports; staff manage complaints, construction updates, and announcements. The README describes feedback and the Telegram bot as mock/in-memory prototypes, and admin data as browser-localStorage backed. Source-index references and README route descriptions support the shown links; unsampled details and integrations are omitted where their wiring is not established.

Main entry points: [`app/page.tsx`](https://github.com/fudarren/mutiara-connect/blob/main/app/page.tsx) (Portal home), [`components/construction/ConstructionExplorer.tsx`](https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionExplorer.tsx) (Project explorer), [`lib/admin/store.ts`](https://github.com/fudarren/mutiara-connect/blob/main/lib/admin/store.ts) (Admin records), [`components/notification/NotificationCenter.tsx`](https://github.com/fudarren/mutiara-connect/blob/main/components/notification/NotificationCenter.tsx) (Notification centre)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Community portal"]
  node_home["Portal home<br/>[page.tsx]"]
  node_login["Sign-in<br/>[LoginPage.tsx]"]
  node_session["Browser session<br/>[session.ts]"]
  node_news["Construction news<br/>[page.tsx]"]
  node_newsdata["News data<br/>[news.ts]"]
  node_newsapi["News endpoint<br/>[route.ts]"]
end

subgraph group_construction["Construction information"]
  node_explorer["Project explorer"]
  node_map["Construction map"]
  node_constructiondata["Update filtering<br/>[construction.ts]"]
  node_constructionstore["Update store"]
  node_detail["Project details"]
end

subgraph group_management["Staff management"]
  node_dashboard["Admin overview<br/>[DashboardPage.tsx]"]
  node_complaints["Complaint management<br/>[ComplaintsPage.tsx]"]
  node_announcements["Announcement management"]
  node_constructionadmin["Construction management"]
  node_admindata[("Admin records<br/>[store.ts]")]
end

subgraph group_support["Feedback and alerts"]
  node_notices["Construction notices"]
  node_notification["Notification centre"]
  node_notificationstore["Notification state"]
  node_feedback["Feedback centre<br/>[FeedbackCenter.tsx]"]
  node_feedbackdata["Feedback helpers<br/>[feedback.ts]"]
  node_preferences["Notification preferences"]
  node_telegrambot["Mock Telegram bot<br/>[bot.mjs]"]
end

node_resident(("Community visitor"))
node_staff(("Staff administrator"))

node_resident -->|"browses"| node_home
node_home -->|"checks session"| node_session
node_resident -->|"signs in"| node_login
node_login -->|"authenticates locally"| node_session
node_home -->|"opens news"| node_news
node_news -->|"loads articles"| node_newsdata
node_newsapi -->|"reads news"| node_newsdata
node_home -->|"opens projects"| node_explorer
node_explorer -->|"filters updates"| node_constructiondata
node_explorer -->|"reads updates"| node_constructionstore
node_explorer -.->|"renders map"| node_map
node_explorer -->|"opens details"| node_detail
node_home -->|"opens alerts"| node_notification
node_notification -->|"reads and marks"| node_notificationstore
node_notification -->|"uses notice dates"| node_notices
node_resident -->|"submits report"| node_feedback
node_feedback -->|"formats reports"| node_feedbackdata
node_resident -->|"sets preferences"| node_preferences
node_staff -->|"opens admin"| node_dashboard
node_staff -->|"reviews complaints"| node_complaints
node_staff -->|"manages notices"| node_announcements
node_staff -->|"manages updates"| node_constructionadmin
node_dashboard -.->|"loads records"| node_admindata
node_complaints -.->|"updates records"| node_admindata
node_announcements -.->|"updates records"| node_admindata
node_constructionadmin -->|"manages records"| node_admindata
node_resident -->|"uses mock bot"| node_telegrambot

click node_home "https://github.com/fudarren/mutiara-connect/blob/main/app/page.tsx"
click node_login "https://github.com/fudarren/mutiara-connect/blob/main/components/LoginPage.tsx"
click node_session "https://github.com/fudarren/mutiara-connect/blob/main/lib/session.ts"
click node_news "https://github.com/fudarren/mutiara-connect/blob/main/app/news/page.tsx"
click node_newsdata "https://github.com/fudarren/mutiara-connect/blob/main/lib/news.ts"
click node_newsapi "https://github.com/fudarren/mutiara-connect/blob/main/app/api/news/route.ts"
click node_explorer "https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionExplorer.tsx"
click node_map "https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionMap.tsx"
click node_constructiondata "https://github.com/fudarren/mutiara-connect/blob/main/lib/construction.ts"
click node_constructionstore "https://github.com/fudarren/mutiara-connect/blob/main/lib/constructionStore.ts"
click node_detail "https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionDetail.tsx"
click node_notices "https://github.com/fudarren/mutiara-connect/blob/main/lib/constructionNotices.ts"
click node_notification "https://github.com/fudarren/mutiara-connect/blob/main/components/notification/NotificationCenter.tsx"
click node_notificationstore "https://github.com/fudarren/mutiara-connect/blob/main/lib/notificationStore.ts"
click node_feedback "https://github.com/fudarren/mutiara-connect/blob/main/components/feedback/FeedbackCenter.tsx"
click node_feedbackdata "https://github.com/fudarren/mutiara-connect/blob/main/lib/feedback.ts"
click node_preferences "https://github.com/fudarren/mutiara-connect/blob/main/components/notification/NotificationPreferences.tsx"
click node_dashboard "https://github.com/fudarren/mutiara-connect/blob/main/components/admin/DashboardPage.tsx"
click node_complaints "https://github.com/fudarren/mutiara-connect/blob/main/components/admin/ComplaintsPage.tsx"
click node_announcements "https://github.com/fudarren/mutiara-connect/blob/main/components/admin/AnnouncementsPage.tsx"
click node_constructionadmin "https://github.com/fudarren/mutiara-connect/blob/main/components/admin/ConstructionPage.tsx"
click node_admindata "https://github.com/fudarren/mutiara-connect/blob/main/lib/admin/store.ts"
click node_telegrambot "https://github.com/fudarren/mutiara-connect/blob/main/telegram-bot/bot.mjs"

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_home,node_login,node_session,node_news,node_newsdata,node_newsapi toneBlue
class node_explorer,node_map,node_constructiondata,node_constructionstore,node_detail toneAmber
class node_dashboard,node_complaints,node_announcements,node_constructionadmin,node_admindata toneMint
class node_notices,node_notification,node_notificationstore,node_feedback,node_feedbackdata,node_preferences,node_telegrambot toneRose
class node_resident,node_staff toneIndigo
```

## Components

### Community portal

- [Portal home](https://github.com/fudarren/mutiara-connect/blob/main/app/page.tsx): `app/page.tsx`
- [Sign-in](https://github.com/fudarren/mutiara-connect/blob/main/components/LoginPage.tsx): `components/LoginPage.tsx`
- [Browser session](https://github.com/fudarren/mutiara-connect/blob/main/lib/session.ts): `lib/session.ts`
- [Construction news](https://github.com/fudarren/mutiara-connect/blob/main/app/news/page.tsx): `app/news/page.tsx`
- [News data](https://github.com/fudarren/mutiara-connect/blob/main/lib/news.ts): `lib/news.ts`
- [News endpoint](https://github.com/fudarren/mutiara-connect/blob/main/app/api/news/route.ts): `app/api/news/route.ts`

### Construction information

- [Project explorer](https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionExplorer.tsx): `components/construction/ConstructionExplorer.tsx`
- [Construction map](https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionMap.tsx): `components/construction/ConstructionMap.tsx`
- [Update filtering](https://github.com/fudarren/mutiara-connect/blob/main/lib/construction.ts): `lib/construction.ts`
- [Update store](https://github.com/fudarren/mutiara-connect/blob/main/lib/constructionStore.ts): `lib/constructionStore.ts`
- [Project details](https://github.com/fudarren/mutiara-connect/blob/main/components/construction/ConstructionDetail.tsx): `components/construction/ConstructionDetail.tsx`

### Staff management

- [Admin overview](https://github.com/fudarren/mutiara-connect/blob/main/components/admin/DashboardPage.tsx): `components/admin/DashboardPage.tsx`
- [Complaint management](https://github.com/fudarren/mutiara-connect/blob/main/components/admin/ComplaintsPage.tsx): `components/admin/ComplaintsPage.tsx`
- [Announcement management](https://github.com/fudarren/mutiara-connect/blob/main/components/admin/AnnouncementsPage.tsx): `components/admin/AnnouncementsPage.tsx`
- [Construction management](https://github.com/fudarren/mutiara-connect/blob/main/components/admin/ConstructionPage.tsx): `components/admin/ConstructionPage.tsx`
- [Admin records](https://github.com/fudarren/mutiara-connect/blob/main/lib/admin/store.ts): `lib/admin/store.ts`

### Feedback and alerts

- [Construction notices](https://github.com/fudarren/mutiara-connect/blob/main/lib/constructionNotices.ts): `lib/constructionNotices.ts`
- [Notification centre](https://github.com/fudarren/mutiara-connect/blob/main/components/notification/NotificationCenter.tsx): `components/notification/NotificationCenter.tsx`
- [Notification state](https://github.com/fudarren/mutiara-connect/blob/main/lib/notificationStore.ts): `lib/notificationStore.ts`
- [Feedback centre](https://github.com/fudarren/mutiara-connect/blob/main/components/feedback/FeedbackCenter.tsx): `components/feedback/FeedbackCenter.tsx`
- [Feedback helpers](https://github.com/fudarren/mutiara-connect/blob/main/lib/feedback.ts): `lib/feedback.ts`
- [Notification preferences](https://github.com/fudarren/mutiara-connect/blob/main/components/notification/NotificationPreferences.tsx): `components/notification/NotificationPreferences.tsx`
- [Mock Telegram bot](https://github.com/fudarren/mutiara-connect/blob/main/telegram-bot/bot.mjs): `telegram-bot/bot.mjs`

### Other components

- **Community visitor**
- **Staff administrator**

## Connections

- Community visitor → Portal home: browses
- Portal home → Browser session: checks session (evidence: `app/page.tsx`)
- Community visitor → Sign-in: signs in
- Sign-in → Browser session: authenticates locally (evidence: `components/LoginPage.tsx`)
- Portal home → Construction news: opens news
- Construction news → News data: loads articles (evidence: `app/news/page.tsx`)
- News endpoint → News data: reads news (evidence: `app/api/news/route.ts`)
- Portal home → Project explorer: opens projects
- Project explorer → Update filtering: filters updates (evidence: `components/construction/ConstructionExplorer.tsx`)
- Project explorer → Update store: reads updates (evidence: `components/construction/ConstructionExplorer.tsx`)
- Project explorer → Construction map: renders map
- Project explorer → Project details: opens details
- Portal home → Notification centre: opens alerts
- Notification centre → Notification state: reads and marks (evidence: `components/notification/NotificationCenter.tsx`)
- Notification centre → Construction notices: uses notice dates (evidence: `components/notification/NotificationCenter.tsx`)
- Community visitor → Feedback centre: submits report
- Feedback centre → Feedback helpers: formats reports (evidence: `components/feedback/FeedbackCenter.tsx`)
- Community visitor → Notification preferences: sets preferences
- Staff administrator → Admin overview: opens admin
- Staff administrator → Complaint management: reviews complaints
- Staff administrator → Announcement management: manages notices
- Staff administrator → Construction management: manages updates
- Admin overview → Admin records: loads records
- Complaint management → Admin records: updates records
- Announcement management → Admin records: updates records
- Construction management → Admin records: manages records (evidence: `components/admin/ConstructionPage.tsx`)
- Community visitor → Mock Telegram bot: uses mock bot
