# muhsar27/pointbox-ui architecture

> Architecture diagram of the GitHub repository muhsar27/pointbox-ui, 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/muhsar27/pointbox-ui
- Repository: https://github.com/muhsar27/pointbox-ui

## Overview

Pointbox UI is a small Go web app for viewing members and adding, removing, or adjusting their points. Requests are dispatched by the HTTP server to handlers in main.go; handlers render templates or update an in-memory member map, then redirect where appropriate. Startup also opens and pings MySQL, but the sampled handlers use the in-memory map rather than database persistence. The tree shows templates and CSS; no README or source evidence describes additional capabilities.

Main entry points: [`main.go`](https://github.com/muhsar27/pointbox-ui/blob/main/main.go) (HTTP server), [`db.go`](https://github.com/muhsar27/pointbox-ui/blob/main/db.go) (Open database), [`static/style.css`](https://github.com/muhsar27/pointbox-ui/blob/main/static/style.css) (Static CSS), [`template/home.html`](https://github.com/muhsar27/pointbox-ui/blob/main/template/home.html) (Home template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_server["HTTP server<br/>[main.go]"]
  node_home["Home handler<br/>[main.go]"]
  node_addform["Add form handler<br/>[main.go]"]
  node_static["Static CSS<br/>[style.css]"]
  node_homeview["Home template<br/>[home.html]"]
  node_addview["Add-member template<br/>[addmember.html]"]
end

subgraph group_domain["Member points"]
  node_create["Create member<br/>[main.go]"]
  node_addpoints["Add points<br/>[main.go]"]
  node_subtract["Remove points<br/>[main.go]"]
  node_deletemember["Delete member<br/>[main.go]"]
  node_members["In-memory members<br/>[main.go]"]
end

subgraph group_startup["Startup integration"]
  node_startup["Application startup<br/>[main.go]"]
  node_dbopen["Open database<br/>[db.go]"]
end

node_user(("Browser user"))
node_mysql[("MySQL service")]

node_user -->|"sends requests"| node_server
node_server -->|"dispatches GET /"| node_home
node_server -->|"dispatches GET /add"| node_addform
node_server -->|"dispatches POST /add"| node_create
node_server -->|"dispatches point POST"| node_addpoints
node_server -->|"dispatches point POST"| node_subtract
node_server -->|"dispatches POST /delete"| node_deletemember
node_server -->|"serves files"| node_static
node_home -->|"reads"| node_members
node_home -->|"renders"| node_homeview
node_addform -->|"renders"| node_addview
node_create -->|"writes"| node_members
node_addpoints -->|"reads and writes"| node_members
node_subtract -->|"reads and writes"| node_members
node_deletemember -->|"deletes from"| node_members
node_create -->|"redirects"| node_user
node_addpoints -->|"redirects"| node_user
node_subtract -->|"redirects"| node_user
node_deletemember -->|"redirects"| node_user
node_startup -->|"opens connection"| node_dbopen
node_dbopen -->|"pings"| node_mysql
node_startup -->|"starts listener"| node_server

click node_server "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_home "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_addform "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_static "https://github.com/muhsar27/pointbox-ui/blob/main/static/style.css"
click node_homeview "https://github.com/muhsar27/pointbox-ui/blob/main/template/home.html"
click node_addview "https://github.com/muhsar27/pointbox-ui/blob/main/template/addmember.html"
click node_create "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_addpoints "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_subtract "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_deletemember "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_members "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_startup "https://github.com/muhsar27/pointbox-ui/blob/main/main.go"
click node_dbopen "https://github.com/muhsar27/pointbox-ui/blob/main/db.go"

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_server,node_home,node_addform,node_static,node_homeview,node_addview,node_user toneBlue
class node_create,node_addpoints,node_subtract,node_deletemember,node_members,node_mysql toneAmber
class node_startup,node_dbopen toneMint
```

## Components

### Web interface

- [HTTP server](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Home handler](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Add form handler](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Static CSS](https://github.com/muhsar27/pointbox-ui/blob/main/static/style.css): `static/style.css`
- [Home template](https://github.com/muhsar27/pointbox-ui/blob/main/template/home.html): `template/home.html`
- [Add-member template](https://github.com/muhsar27/pointbox-ui/blob/main/template/addmember.html): `template/addmember.html`

### Member points

- [Create member](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Add points](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Remove points](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Delete member](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [In-memory members](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`

### Startup integration

- [Application startup](https://github.com/muhsar27/pointbox-ui/blob/main/main.go): `main.go`
- [Open database](https://github.com/muhsar27/pointbox-ui/blob/main/db.go): `db.go`

### Other components

- **Browser user**
- **MySQL service**

## Connections

- Browser user → HTTP server: sends requests
- HTTP server → Home handler: dispatches GET /
- HTTP server → Add form handler: dispatches GET /add
- HTTP server → Create member: dispatches POST /add
- HTTP server → Add points: dispatches point POST
- HTTP server → Remove points: dispatches point POST
- HTTP server → Delete member: dispatches POST /delete
- HTTP server → Static CSS: serves files
- Home handler → In-memory members: reads
- Home handler → Home template: renders
- Add form handler → Add-member template: renders
- Create member → In-memory members: writes
- Add points → In-memory members: reads and writes
- Remove points → In-memory members: reads and writes
- Delete member → In-memory members: deletes from
- Create member → Browser user: redirects
- Add points → Browser user: redirects
- Remove points → Browser user: redirects
- Delete member → Browser user: redirects
- Application startup → Open database: opens connection
- Open database → MySQL service: pings
- Application startup → HTTP server: starts listener
