No description
- Go 63.1%
- HTML 36.9%
| cmd/seed | ||
| db | ||
| templates | ||
| .gitignore | ||
| AGENTS.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
| renovate.json | ||
strichel
A lightweight digital tally tab tracker. Users have a balance that gets topped up and spent down — think prepaid bar tabs or shared kitty accounts.
Features
- Multiple accounts with running balances
- Index groups accounts into active (entry in last 7 days) and inactive
- Quick spend/top-up buttons and named preset buttons (configurable)
- Custom amount and optional note per transaction
- Collect — charge individual amounts from multiple people at once
- Split — divide a total equally among selected people
- Transaction history with undo (within 1 hour of booking)
- Hourly consolidation of old entries (configurable)
- Prometheus metrics at
/metrics
Running
go run .
Listens on :8080 by default. The SQLite database (strichel.db) is created automatically in the working directory on first run.
Seeding test data
go run ./cmd/seed # writes to strichel.db
go run ./cmd/seed test.db # or a separate file
Inserts 40 users with random entries spread over the last 6 months (25 inactive, 15 active).
Configuration
All configuration is via environment variables, parsed at startup by caarlos0/env.
| Variable | Default | Description |
|---|---|---|
STRICHEL_ADDR |
:8080 |
TCP address to listen on |
STRICHEL_DB |
strichel.db |
Path to the SQLite database file |
STRICHEL_CONSOLIDATE |
true |
Set to false to disable the hourly consolidation job |
STRICHEL_BUTTONS |
-0.25,-0.35,-0.50,-1,-2,-5,0.50,1,2,5,10,20 |
Exactly 12 comma-separated amounts; negative = spend buttons, positive = top-up buttons |
STRICHEL_PRESETS |
Getränk 🧉:100,Wasser 🌊:50,Bueno 🍬:35,Pringles 🥔:225,Pickup 🍫:100,Tschunk 🍹:350 |
3 or 6 named preset spend buttons in name:cents format |
Building a binary
go build -o strichel .
./strichel
Docker
FROM golang:1.22-alpine AS build
WORKDIR /app
COPY . .
RUN go build -o strichel .
FROM alpine:latest
WORKDIR /app
COPY --from=build /app/strichel .
EXPOSE 8080
CMD ["./strichel"]
Metrics
Prometheus metrics are exposed at GET /metrics.
| Metric | Type | Description |
|---|---|---|
strichel_spend_euros |
Histogram | Spend event sizes in euros; buckets are derived from the configured spend buttons |
strichel_spend_euros_count gives the total number of spending events.
Tech stack
- Go —
net/http,html/template,database/sql - SQLite — via
modernc.org/sqlite(pure Go, no CGO) - Tailwind CSS — loaded from CDN
- Prometheus —
prometheus/client_golang - caarlos0/env — environment variable parsing