
nutmos/expensetrackr
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
A small expense-logging web service in Go (Gin) with a plain HTML + vanilla JS web page and a JSON API. Data is stored in SQLite through the pure-Go modernc.
概要
A small expense-logging web service in Go (Gin) with a plain HTML + vanilla JS web page and a JSON API. Data is stored in SQLite through the pure-Go modernc.org/sqlite driver, so no CGO or C toolchain is needed. Status: prototype for local use. It listens on 127.0.0.1 by default and requires a username/password login (server-side sessions); see docs/auth.md. Data is not per-user yet. - Go 1.24+ (go.mod targets go 1.24 / toolchain go1.24.4, and every dependency is pinned to a version that builds with the locally installed Go 1.24.4) - No CGO (CGO_ENABLED=0 works) - GNU make (optional; the targets are thin wrappers around go commands) Modelled on prometheus-operator: go.mod at the repo root, binaries under cmd/, packages under pkg/, a Makefile for common tasks, and documentation in its own folder. Everything runs from the repo root; no cd needed. Import packages as github.com/nutmos/expensetrackr/pkg/ .
README
以下は原文 README の抜粋です。原文を見る。
expense-service
A small expense-logging web service in Go (Gin) with a plain HTML + vanilla JS
web page and a JSON API. Data is stored in SQLite through the pure-Go
modernc.org/sqlite driver, so no CGO or C toolchain is needed.
Status: prototype for local use. It listens on 127.0.0.1 by default and requires a username/password login (server-side sessions); see docs/auth.md. Data is not per-user yet.
Requirements
- Go 1.24+ (
go.modtargets go 1.24 / toolchain go1.24.4, and every dependency is pinned to a version that builds with the locally installed Go 1.24.4) - No CGO (
CGO_ENABLED=0works) - GNU make (optional; the targets are thin wrappers around
gocommands)
Repository layout
Modelled on prometheus-operator:
go.mod at the repo root, binaries under cmd/, packages under pkg/, a
Makefile for common tasks, and documentation in its own folder. Everything
runs from the repo root; no cd needed.
go.mod, go.sum module github.com/nutmos/expensetrackr
Makefile build / run / test / vet / fmt / clean
cmd/server/ the expense-server binary (main package)
pkg/ library packages (api, store, transaction, balance, category, user,
money, validate), pkg/web (embedded web page) and pkg/apidoc
(embedded OpenAPI spec + offline Swagger UI)
docs/ project documentation (non-code)
skills/ AI-agent skill (SKILL.md) for using the HTTP API
README.md
bin/, data/, server.log local runtime files (git-ignored)
Import packages as github.com/nutmos/expensetrackr/pkg/. The web page
lives in pkg/web (an embed package like any other), not a root web/ folder,
so all Go code other than cmd/ lives under pkg/.
Run
cd /workspace/expense-service # repo root
make run # build bin/expense-server, serve http://127.0.0.1:8080 with data/expenses.db
# the same without make
CGO_ENABLED=0 go build -o bin/expense-server ./cmd/server
./bin/expense-server -addr 127.0.0.1:8080 -db data/expenses.db
# or straight from source
go run ./cmd/server # defaults: 127.0.0.1:8080, data/expenses.db
make run takes overrides: make run ADDR=127.0.0.1:9090 DB=/tmp/test.db.
The default -db data/expenses.db is relative to the current directory, so
run from the repo root.
| Flag | Env var | Default | Notes |
|---|---|---|---|
-addr |
EXPENSE_ADDR |
127.0.0.1:8080 |
Keep on 127.0.0.1: there is no auth (:8080 would expose it on all interfaces) |
-db |
EXPENSE_DB |
data/expenses.db |
Created automatically (directory included) |
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add nutmos/expensetrackr