Self-hosted profit/loss tracker for transactions with SQLite storage
A self-hosted, P&L tracker made with Go, HTMX and no JavaScript. Controtto, keeps track of your transaction saving it in a sqlite file, and returns all sorts of calculations including:
In order to fetch the price of an asset, Controtto relies on mainly 4 APIs (see code).
CONTROTTO_AVANTAGE_TOKEN
)CONTROTTO_TIINGO_TOKEN
)You can also check out the demo at demo.contre.io, the database resets every hour.
https://github.com/user-attachments/assets/28bf8782-6118-47c0-a94b-085e1a7045b2
All configurations are set in the .env
file and passed as environment variables. Variables CONTROTTO_PORT
and CONTROTTO_DB_PATH
are available.
# Install the dependencies
go mod tidy
# Set the .env
mv .env.example .env
# Source the env variables
. <(cat .env | grep -v -e '^$' | grep -v "#" | awk '{}')
go run ./cmd/main.go # go build ./cmd/main.go to just build it
go install github.com/cosmtrek/air@latest # Download air
air -c air.toml
and access localhost:3000
A Container image is available on Docker's public registry.
If you want to use Docker, simply replace podman
with docker
.
mkdir data
podman container run --rm -p 8000:8000 -v $(pwd)/data:/data contre95/controtto
go test -cover ./...
# Expected result
# ? controtto/cmd [no test files]
# ? controtto/src/app/managing [no test files]
# ? controtto/src/domain/pnl [no test files]
# ? controtto/src/gateways/markets [no test files]
# ? controtto/src/gateways/sqlite [no test files]
# ? controtto/src/presenters [no test files]
# ok controtto/src/app/querying 0.003s coverage: 40.7% of statements
style.css
+ Tailwind CDN.No configuration available
This service may require manual configuration, please check the details on the left
Related projects feature coming soon
Will recommend related projects based on sub-categories