# zpleum/takladnud architecture

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

- Interactive diagram: https://gitdiagram.com/zpleum/takladnud
- Repository: https://github.com/zpleum/takladnud

## Overview

This is a Thai-language market-stall booking and discovery web application. Shop operators register and manage their shop, select stalls for market sessions, and manage bookings; the public can browse market sessions and shops, follow QR links, and review shops. Administrators have a separate management area. The sampled files show the browser client making API requests and server handlers querying MySQL. Product capabilities beyond the excerpts are represented where evident, but their internal wiring is not inferred.

Main entry points: [`server.js`](https://github.com/zpleum/takladnud/blob/main/server.js) (HTTP API), [`public/index.js`](https://github.com/zpleum/takladnud/blob/main/public/index.js) (Market web client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_web["Market web client<br/>[index.js]"]
end

subgraph group_server["Application services"]
  node_api["HTTP API<br/>[server.js]"]
  node_identity["Authentication and sessions<br/>[server.js]"]
  node_markets["Markets and sessions<br/>[server.js]"]
  node_shop["Shop management<br/>[server.js]"]
  node_booking["Stall bookings<br/>[server.js]"]
  node_discovery["Public discovery and reviews<br/>[server.js]"]
  node_qr["QR access<br/>[server.js]"]
  node_admin["Administration<br/>[server.js]"]
  node_uploads["Shop image uploads<br/>[server.js]"]
end

subgraph group_data["Persistent data"]
  node_mysql[("MySQL database")]
end

node_visitor(("Visitor or operator"))

node_visitor -->|"uses"| node_web
node_web -->|"requests"| node_api
node_api -->|"routes auth"| node_identity
node_api -->|"routes market"| node_markets
node_api -->|"routes shop"| node_shop
node_api -->|"routes bookings"| node_booking
node_api -->|"routes public"| node_discovery
node_api -->|"routes QR"| node_qr
node_api -->|"routes admin"| node_admin
node_api -->|"handles uploads"| node_uploads
node_api -->|"queries"| node_mysql

click node_web "https://github.com/zpleum/takladnud/blob/main/public/index.js"
click node_api "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_identity "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_markets "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_shop "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_booking "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_discovery "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_qr "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_admin "https://github.com/zpleum/takladnud/blob/main/server.js"
click node_uploads "https://github.com/zpleum/takladnud/blob/main/server.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_web toneBlue
class node_api,node_identity,node_markets,node_shop,node_booking,node_discovery,node_qr,node_admin,node_uploads toneAmber
class node_mysql toneMint
class node_visitor toneIndigo
```

## Components

### Browser experience

- [Market web client](https://github.com/zpleum/takladnud/blob/main/public/index.js): `public/index.js`

### Application services

- [HTTP API](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Authentication and sessions](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Markets and sessions](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Shop management](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Stall bookings](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Public discovery and reviews](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [QR access](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Administration](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`
- [Shop image uploads](https://github.com/zpleum/takladnud/blob/main/server.js): `server.js`

### Persistent data

- **MySQL database**

### Other components

- **Visitor or operator**

## Connections

- Visitor or operator → Market web client: uses (evidence: `public/index.js`)
- Market web client → HTTP API: requests (evidence: `public/index.js`)
- HTTP API → Authentication and sessions: routes auth (evidence: `server.js`)
- HTTP API → Markets and sessions: routes market (evidence: `server.js`)
- HTTP API → Shop management: routes shop (evidence: `server.js`)
- HTTP API → Stall bookings: routes bookings (evidence: `server.js`)
- HTTP API → Public discovery and reviews: routes public (evidence: `server.js`)
- HTTP API → QR access: routes QR (evidence: `server.js`)
- HTTP API → Administration: routes admin (evidence: `server.js`)
- HTTP API → Shop image uploads: handles uploads (evidence: `server.js`)
- HTTP API → MySQL database: queries (evidence: `server.js`)
