# duwiarsana/softwareantrianbankrs architecture

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

- Interactive diagram: https://gitdiagram.com/duwiarsana/softwareantrianbankrs
- Repository: https://github.com/duwiarsana/softwareantrianbankrs

## Overview

QueuePro is a multi-tenant digital queue system. Visitors select a service at the kiosk to obtain a ticket; counter staff call and complete tickets; a public display reflects queue activity and rotates advertisements with Indonesian voice announcements. Administrators manage services, counters, ads, and organization settings, while users register or sign in. README documents real-time synchronization; sampled source confirms the app/API entry points, service management, authentication, and display behavior, but not the detailed ticket-route or socket-event wiring.

Main entry points: [`server/src/index.js`](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/index.js) (HTTP and socket server), [`client/src/App.jsx`](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/App.jsx) (Route application), [`client/src/lib/api.js`](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/api.js) (HTTP API client), [`server/src/routes/auth.js`](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/auth.js) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_register["Organization registration<br/>[Register.jsx]"]
  node_kiosk["Ticket kiosk<br/>[Kiosk.jsx]"]
  node_counter["Counter dashboard<br/>[Counter.jsx]"]
  node_display["Queue display<br/>[Display.jsx]"]
  node_admin["Admin management"]
  node_api["HTTP API client<br/>[api.js]"]
  node_socketclient["Realtime client<br/>[socket.js]"]
  node_voice["Voice announcements<br/>[voice.js]"]
end

subgraph group_server["Queue and admin API"]
  node_server["HTTP and socket server<br/>[index.js]"]
  node_serviceroutes["Service routes<br/>[services.js]"]
  node_ticketroutes["Ticket routes<br/>[tickets.js]"]
  node_counterroutes["Counter routes<br/>[counters.js]"]
  node_ad_routes["Advertisement routes<br/>[advertisements.js]"]
  node_org_routes["Organization routes<br/>[organizations.js]"]
  node_masterroutes["Master routes<br/>[master.js]"]
  node_socketserver["Socket event handlers<br/>[handler.js]"]
end

subgraph group_identity["Identity and tenancy"]
  node_authstate["Auth context<br/>[AuthContext.jsx]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_authmw["JWT authorization<br/>[auth.js]"]
end

subgraph group_persistence["Persistent state"]
  node_schema["Queue data schema<br/>[schema.prisma]"]
  node_database[("Application database")]
end

node_visitors(("Visitors"))
node_staff(("Counter staff"))
node_admins(("Administrators"))
node_monitor(("Waiting-room display"))
node_google(("Google OAuth"))
node_mail(("Email service"))

node_visitors -->|"open kiosk"| node_app
node_staff -->|"open counter"| node_app
node_admins -->|"manage system"| node_app
node_monitor -->|"open display"| node_app
node_app -->|"routes to"| node_kiosk
node_app -->|"routes to"| node_counter
node_app -->|"routes to"| node_display
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_login -->|"signs in through"| node_authstate
node_register -->|"registers through"| node_authstate
node_authstate -->|"requests identity"| node_api
node_kiosk -->|"requests services and tickets"| node_api
node_counter -->|"updates queue"| node_api
node_admin -->|"manages settings"| node_api
node_display -->|"loads queue and ads"| node_api
node_display -->|"subscribes to updates"| node_socketclient
node_display -->|"announces calls"| node_voice
node_api -->|"HTTP requests"| node_server
node_socketclient -->|"socket connection"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_serviceroutes
node_server -->|"mounts routes"| node_ticketroutes
node_server -->|"mounts routes"| node_counterroutes
node_server -->|"mounts routes"| node_ad_routes
node_server -->|"mounts routes"| node_org_routes
node_server -->|"mounts routes"| node_masterroutes
node_server -->|"sets up handlers"| node_socketserver
node_authroutes -->|"checks and signs tokens"| node_authmw
node_serviceroutes -->|"guards admin routes"| node_authmw
node_authroutes -.->|"verifies credentials"| node_google
node_authroutes -.->|"sends registration report"| node_mail
node_authroutes -->|"reads and writes users and organizations"| node_database
node_serviceroutes -->|"reads and writes services"| node_database
node_ticketroutes -->|"queue persistence"| node_database
node_counterroutes -->|"counter persistence"| node_database
node_ad_routes -->|"advertisement persistence"| node_database
node_org_routes -->|"organization persistence"| node_database
node_masterroutes -->|"master data persistence"| node_database
node_schema -->|"defines stored models"| node_database

click node_app "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/App.jsx"
click node_authstate "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/contexts/AuthContext.jsx"
click node_login "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Login.jsx"
click node_register "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Register.jsx"
click node_kiosk "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Kiosk.jsx"
click node_counter "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Counter.jsx"
click node_display "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Display.jsx"
click node_admin "https://github.com/duwiarsana/softwareantrianbankrs/tree/main/client/src/pages/admin"
click node_api "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/api.js"
click node_socketclient "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/socket.js"
click node_voice "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/voice.js"
click node_server "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/index.js"
click node_authroutes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/auth.js"
click node_authmw "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/middleware/auth.js"
click node_serviceroutes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/services.js"
click node_ticketroutes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/tickets.js"
click node_counterroutes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/counters.js"
click node_ad_routes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/advertisements.js"
click node_org_routes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/organizations.js"
click node_masterroutes "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/master.js"
click node_socketserver "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/socket/handler.js"
click node_schema "https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/prisma/schema.prisma"

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_login,node_register,node_kiosk,node_counter,node_display,node_admin,node_api,node_socketclient,node_voice toneBlue
class node_server,node_serviceroutes,node_ticketroutes,node_counterroutes,node_ad_routes,node_org_routes,node_masterroutes,node_socketserver toneAmber
class node_authstate,node_authroutes,node_authmw toneMint
class node_schema,node_database toneRose
class node_visitors,node_staff,node_admins,node_monitor,node_google,node_mail toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login and registration](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Organization registration](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Ticket kiosk](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Kiosk.jsx): `client/src/pages/Kiosk.jsx`
- [Counter dashboard](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Counter.jsx): `client/src/pages/Counter.jsx`
- [Queue display](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/pages/Display.jsx): `client/src/pages/Display.jsx`
- [Admin management](https://github.com/duwiarsana/softwareantrianbankrs/tree/main/client/src/pages/admin): `client/src/pages/admin`
- [HTTP API client](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/api.js): `client/src/lib/api.js`
- [Realtime client](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/socket.js): `client/src/lib/socket.js`
- [Voice announcements](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/lib/voice.js): `client/src/lib/voice.js`

### Queue and admin API

- [HTTP and socket server](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/index.js): `server/src/index.js`
- [Service routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/services.js): `server/src/routes/services.js`
- [Ticket routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/tickets.js): `server/src/routes/tickets.js`
- [Counter routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/counters.js): `server/src/routes/counters.js`
- [Advertisement routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/advertisements.js): `server/src/routes/advertisements.js`
- [Organization routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/organizations.js): `server/src/routes/organizations.js`
- [Master routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/master.js): `server/src/routes/master.js`
- [Socket event handlers](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/socket/handler.js): `server/src/socket/handler.js`

### Identity and tenancy

- [Auth context](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/client/src/contexts/AuthContext.jsx): `client/src/contexts/AuthContext.jsx`
- [Authentication routes](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/routes/auth.js): `server/src/routes/auth.js`
- [JWT authorization](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`

### Persistent state

- [Queue data schema](https://github.com/duwiarsana/softwareantrianbankrs/blob/main/server/prisma/schema.prisma): `server/prisma/schema.prisma`
- **Application database**

### Other components

- **Visitors**
- **Counter staff**
- **Administrators**
- **Waiting-room display**
- **Google OAuth**
- **Email service**

## Connections

- Visitors → Route application: open kiosk
- Counter staff → Route application: open counter
- Administrators → Route application: manage system
- Waiting-room display → Route application: open display
- Route application → Ticket kiosk: routes to
- Route application → Counter dashboard: routes to
- Route application → Queue display: routes to
- Route application → Admin management: routes to
- Route application → Login and registration: routes to
- Route application → Organization registration: routes to
- Login and registration → Auth context: signs in through
- Organization registration → Auth context: registers through
- Auth context → HTTP API client: requests identity
- Ticket kiosk → HTTP API client: requests services and tickets
- Counter dashboard → HTTP API client: updates queue
- Admin management → HTTP API client: manages settings
- Queue display → HTTP API client: loads queue and ads
- Queue display → Realtime client: subscribes to updates
- Queue display → Voice announcements: announces calls
- HTTP API client → HTTP and socket server: HTTP requests
- Realtime client → HTTP and socket server: socket connection
- HTTP and socket server → Authentication routes: mounts routes
- HTTP and socket server → Service routes: mounts routes
- HTTP and socket server → Ticket routes: mounts routes
- HTTP and socket server → Counter routes: mounts routes
- HTTP and socket server → Advertisement routes: mounts routes
- HTTP and socket server → Organization routes: mounts routes
- HTTP and socket server → Master routes: mounts routes
- HTTP and socket server → Socket event handlers: sets up handlers
- Authentication routes → JWT authorization: checks and signs tokens
- Service routes → JWT authorization: guards admin routes
- Authentication routes → Google OAuth: verifies credentials
- Authentication routes → Email service: sends registration report
- Authentication routes → Application database: reads and writes users and organizations
- Service routes → Application database: reads and writes services
- Ticket routes → Application database: queue persistence
- Counter routes → Application database: counter persistence
- Advertisement routes → Application database: advertisement persistence
- Organization routes → Application database: organization persistence
- Master routes → Application database: master data persistence
- Queue data schema → Application database: defines stored models
