# khantpyaehtoo/ticket-system-demo architecture

> Architecture diagram of the GitHub repository khantpyaehtoo/ticket-system-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khantpyaehtoo/ticket-system-demo
- Repository: https://github.com/khantpyaehtoo/ticket-system-demo

## Overview

This is a Next.js service-operations workspace for authentication, ticket handling, product information, SLA-oriented dashboards, and user, team, and admin tasks. The principal user journey is entering through login, using the workspace to create or review tickets, and following ticket details and support activity. The tree supports these product areas, but most page implementations were not sampled, so their internal wiring is not asserted. The sampled auth action posts login data and stores returned credentials in cookies; the ticket chat excerpt shows a local editor and attachment preview, not a connected messaging service.

Main entry points: [`app/(auth)/login/page.tsx`](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(auth)/login/page.tsx) (Login flow), [`app/(user)/products/page.tsx`](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/products/page.tsx) (Product catalog), [`app/(user)/tickets/create/page.tsx`](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/create/page.tsx) (Ticket creation), [`app/(user)/tickets/details/[id]/page.tsx`](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/details/%5Bid%5D/page.tsx) (Ticket details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_login["Login flow<br/>[page.tsx]"]
  node_authforms["Auth forms"]
  node_authaction["Auth actions<br/>[authAction.ts]"]
end

subgraph group_user["User Workspace"]
  node_dashboard["User dashboard<br/>[page.tsx]"]
  node_products["Product catalog<br/>[page.tsx]"]
  node_productdetail["Product details<br/>[page.tsx]"]
  node_usersettings["Account settings<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
end

subgraph group_operations["Service Operations"]
  node_ticketlist["Ticket list<br/>[page.tsx]"]
  node_ticketcreate["Ticket creation<br/>[page.tsx]"]
  node_ticketform["Ticket form"]
  node_ticketdetail["Ticket details<br/>[page.tsx]"]
  node_ticketchat["Support activity<br/>[ChatSession.tsx]"]
  node_teamtickets["Team tickets<br/>[page.tsx]"]
  node_teamworks["Team work<br/>[page.tsx]"]
  node_teamnotifications["Team alerts<br/>[page.tsx]"]
  node_admintickets["Admin tickets<br/>[page.tsx]"]
  node_adminhome["Admin dashboard<br/>[page.tsx]"]
end

subgraph group_shared["Shared State"]
  node_notificationstore["Notification state"]
  node_userstore["User profile state<br/>[useUserStore.ts]"]
end

node_person(("Workspace user"))
node_authapi{{"Login endpoint"}}

node_person -->|"opens"| node_login
node_login -->|"renders"| node_authforms
node_authaction -->|"posts login"| node_authapi
node_person -->|"opens"| node_dashboard
node_person -->|"browses"| node_products
node_products -->|"opens item"| node_productdetail
node_person -->|"manages account"| node_usersettings
node_person -->|"views"| node_notifications
node_person -->|"reviews"| node_ticketlist
node_person -->|"starts request"| node_ticketcreate
node_ticketcreate -->|"renders"| node_ticketform
node_person -->|"opens ticket"| node_ticketdetail
node_ticketdetail -->|"renders"| node_ticketchat
node_person -->|"opens"| node_teamtickets
node_person -->|"opens"| node_teamworks
node_person -->|"opens"| node_teamnotifications
node_person -->|"opens"| node_admintickets
node_person -->|"opens"| node_adminhome

click node_login "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(auth)/login/page.tsx"
click node_authforms "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(auth)/login/_components/AuthFormWrapper.tsx"
click node_authaction "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/actions/authAction.ts"
click node_dashboard "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/dashboard/page.tsx"
click node_products "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/products/page.tsx"
click node_productdetail "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/products/viewProduct/%5Bid%5D/page.tsx"
click node_usersettings "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/settings/page.tsx"
click node_notifications "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/notifications/page.tsx"
click node_ticketlist "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/page.tsx"
click node_ticketcreate "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/create/page.tsx"
click node_ticketform "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/create/_components/TicketCreateForm.tsx"
click node_ticketdetail "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/details/%5Bid%5D/page.tsx"
click node_ticketchat "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/details/%5Bid%5D/_components/ChatSession.tsx"
click node_teamtickets "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-tickets/page.tsx"
click node_teamworks "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-works/page.tsx"
click node_teamnotifications "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-notifications/page.tsx"
click node_admintickets "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(admin)/admin-tickets/page.tsx"
click node_adminhome "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(admin)/admin/page.tsx"
click node_notificationstore "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/store/useNotificationsStore.ts"
click node_userstore "https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/store/useUserStore.ts"

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_login,node_authforms,node_authaction,node_person toneBlue
class node_dashboard,node_products,node_productdetail,node_usersettings,node_notifications toneAmber
class node_ticketlist,node_ticketcreate,node_ticketform,node_ticketdetail,node_ticketchat,node_teamtickets,node_teamworks,node_teamnotifications,node_admintickets,node_adminhome toneMint
class node_notificationstore,node_userstore toneRose
class node_authapi toneIndigo
```

## Components

### Authentication

- [Login flow](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Auth forms](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(auth)/login/_components/AuthFormWrapper.tsx): `app/(auth)/login/_components/AuthFormWrapper.tsx`
- [Auth actions](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/actions/authAction.ts): `actions/authAction.ts`

### User Workspace

- [User dashboard](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/dashboard/page.tsx): `app/(user)/dashboard/page.tsx`
- [Product catalog](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/products/page.tsx): `app/(user)/products/page.tsx`
- [Product details](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/products/viewProduct/%5Bid%5D/page.tsx): `app/(user)/products/viewProduct/[id]/page.tsx`
- [Account settings](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/settings/page.tsx): `app/(user)/settings/page.tsx`
- [Notifications](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/notifications/page.tsx): `app/(user)/notifications/page.tsx`

### Service Operations

- [Ticket list](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/page.tsx): `app/(user)/tickets/page.tsx`
- [Ticket creation](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/create/page.tsx): `app/(user)/tickets/create/page.tsx`
- [Ticket form](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/create/_components/TicketCreateForm.tsx): `app/(user)/tickets/create/_components/TicketCreateForm.tsx`
- [Ticket details](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/details/%5Bid%5D/page.tsx): `app/(user)/tickets/details/[id]/page.tsx`
- [Support activity](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(user)/tickets/details/%5Bid%5D/_components/ChatSession.tsx): `app/(user)/tickets/details/[id]/_components/ChatSession.tsx`
- [Team tickets](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-tickets/page.tsx): `app/(team)/team-tickets/page.tsx`
- [Team work](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-works/page.tsx): `app/(team)/team-works/page.tsx`
- [Team alerts](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(team)/team-notifications/page.tsx): `app/(team)/team-notifications/page.tsx`
- [Admin tickets](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(admin)/admin-tickets/page.tsx): `app/(admin)/admin-tickets/page.tsx`
- [Admin dashboard](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/app/(admin)/admin/page.tsx): `app/(admin)/admin/page.tsx`

### Shared State

- [Notification state](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/store/useNotificationsStore.ts): `store/useNotificationsStore.ts`
- [User profile state](https://github.com/khantpyaehtoo/ticket-system-demo/blob/main/store/useUserStore.ts): `store/useUserStore.ts`

### Other components

- **Workspace user**
- **Login endpoint**

## Connections

- Workspace user → Login flow: opens
- Login flow → Auth forms: renders
- Auth actions → Login endpoint: posts login
- Workspace user → User dashboard: opens
- Workspace user → Product catalog: browses
- Product catalog → Product details: opens item
- Workspace user → Account settings: manages account
- Workspace user → Notifications: views
- Workspace user → Ticket list: reviews
- Workspace user → Ticket creation: starts request
- Ticket creation → Ticket form: renders
- Workspace user → Ticket details: opens ticket
- Ticket details → Support activity: renders
- Workspace user → Team tickets: opens
- Workspace user → Team work: opens
- Workspace user → Team alerts: opens
- Workspace user → Admin tickets: opens
- Workspace user → Admin dashboard: opens
