A simple, toy ledger written in Go as a learning project. Basically provides endpoints to register accounts and send transactions between them, using Postgres locks to to cache balances on each transaction. I hope I can keep improving it (some ideas in TASKS.md
) as it's been useful for learning.
I've relied a lot on LLMs to get unstuck so there is still a lot of repetition.
It uses Echo to hndle HTTP requests, I would like to eventually move it to use the standard library.
Create a database with db/create && db/migrate
there is currently no DB cleanup or segregation for tests so the DB will get dirty, can be reset with db/destroy && db/create && db/migrate
Run go run app/app.go
. (Needs a running postgres service)
Just run go test ./...
to run tests on all subpackages. I would like to add some smoketests starting a server and sending HTTP requests.
I would like to add some e2e tests, clean up the code a bit, add processors so external services can be used to move money outside the managed ledgers and would like to try adding a message broker to split up processing.