You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2026. It is now read-only.
Custom POS (Point of Sale) app for sports clubs. Tracks orders placed at club bars, member debt, monthly billing, and leaderboards. Written in pure Go with server-side rendered HTML.
Architecture
domain/ Pure business entities (no dependencies)
├── club.go Club enum (Parabool, Gladiators, Calamari)
├── authdomain/ User, Role, Permission
└── orderdomain/ Order, Member, Item, Category, Price, Status
api/ Shared payload types (used by handlers and templates)
backend/
├── application/ Business logic services
│ ├── auth/ auth.Service — login, sessions, user CRUD
│ └── order/ order.Service — orders, members, catalog, billing, leaderboard
├── global/settings/ Config struct and defaults
└── infrastructure/
├── repo/ Repository interfaces (Order, Member, User, Catalog)
│ ├── postgres/ PostgreSQL implementations + migrations
│ └── mockdb/ Mock implementations for tests
└── router/ HTTP handlers and routing (stdlib net/http)
templates/ Go html/template files (embedded via embed.FS)
├── base.html Base layout
├── nav.html Navigation component
├── *.html Page templates
└── admin/*.html Admin page templates
static/files/ Static assets (embedded), BeerCSS framework
Dev server with hot-reload (watches .go, .html, .js)
just run-once
Run without file watching
just test
Run tests with coverage
just lint
Run golangci-lint
just generate
Run go generate ./... (enumer)
just build
Build binary to ./bin/streepjes
just container
Build container image with podman
Setup
Start PostgreSQL: docker-compose up -d
Copy streepjes.example.toml to config or set env vars in .env.dev
just run
Login with default admin credentials (logged on first startup)
Testing
Standard Go tests, co-located with source (*_test.go)
Mock repos in backend/infrastructure/repo/mockdb/ (User, Member, Order, Catalog) — structs with function fields
Router tests: HTTP handler tests using httptest with mock services
Postgres integration tests: use github.com/ory/dockertest/v3 to spin up a real PostgreSQL container; test all repo CRUD, filters, error paths, and migrations
Assertion library: git.fuyu.moe/Fuyu/assert
Run: just test (postgres tests require Docker)
Vulnerability scan: go run golang.org/x/vuln/cmd/govulncheck@latest ./...
How to Implement a New Feature
Adding a new domain entity
Define type in domain/orderdomain/ (or new subdomain)
If enum, add //go:generate go tool enumer ... directive, run just generate
Add migration in backend/infrastructure/repo/postgres/migrations/NNNN.sql
Adding a new repository
Define interface in backend/infrastructure/repo/ (e.g. repo.MyEntity)
Implement in backend/infrastructure/repo/postgres/
Add mock in backend/infrastructure/repo/mockdb/
Wire in main.go (create repo, pass to service)
Adding a new service method
Add method to service interface (backend/application/{service}/)
Implement on the service struct in the same package
Write tests using mockdb
Adding a new page
Create template in templates/ (or templates/admin/)
Register in templates/templates.gopageFiles slice
Template must define blocks expected by base.html
Add route in Server.routes() in backend/infrastructure/router/router.go
Add handler as a method on the Server struct in the appropriate file:
pages_profile.go — profile/password/name
pages_bartender.go — order, history, leaderboard
pages_admin_users.go — user management
pages_admin_members.go — member management
pages_admin_catalog.go — catalog management
pages_admin_billing.go — billing
Use s.render(w, "template.html", data) to render, newPageData(r, "pagename") for nav state
Adding a new API endpoint
Add route in Server.routes() (router.go)
Add handler as a method on the Server struct in bartender.go or admin.go
For JSON request bodies: use json.NewDecoder(r.Body).Decode(&payload)
For JSON responses: use json.NewEncoder(w).Encode(data) with Content-Type: application/json