mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 19:16:40 +07:00
Track individual coins (identity + quantity) in a dedicated tab, backed by CoinGecko's Demo API (AURUM_COINGECKO_API_KEY). A holding is just another Asset under the hood (asset_class=crypto) with its value written as a regular AssetValuation — the existing Net Worth aggregation needs zero changes to pick it up. Prices never refresh in the background (no scheduler in this stack, same reasoning as recurring transactions): a "Refresh prices" button forces a sync, and GET /crypto/holdings lazily re-syncs at most once every 24h. CoinGecko outages leave existing values untouched (error_key: "unreachable") instead of failing the request. Backup/restore now carries CryptoHolding rows too, so a restore doesn't silently strip a holding's coin identity. Backend: 75/75 tests passing (9 new), including a real identity-map staleness bug the tests caught in the raw-Core-upsert + ORM re-read pattern, fixed via populate_existing=True. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01855PiW5Wd8n4aRW4n9kByY
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${AURUM_POSTGRES_USER:-aurum}
|
|
POSTGRES_PASSWORD: ${AURUM_POSTGRES_PASSWORD:-aurum}
|
|
POSTGRES_DB: ${AURUM_POSTGRES_DB:-aurum}
|
|
volumes:
|
|
- aurum_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${AURUM_POSTGRES_USER:-aurum}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build: ./backend
|
|
restart: unless-stopped
|
|
environment:
|
|
AURUM_POSTGRES_USER: ${AURUM_POSTGRES_USER:-aurum}
|
|
AURUM_POSTGRES_PASSWORD: ${AURUM_POSTGRES_PASSWORD:-aurum}
|
|
AURUM_POSTGRES_DB: ${AURUM_POSTGRES_DB:-aurum}
|
|
AURUM_POSTGRES_HOST: db
|
|
AURUM_POSTGRES_PORT: 5432
|
|
AURUM_CORS_ORIGINS: ${AURUM_CORS_ORIGINS:-*}
|
|
AURUM_DEFAULT_CURRENCY: ${AURUM_DEFAULT_CURRENCY:-USD}
|
|
# Free CoinGecko Demo key (coingecko.com/en/api/pricing) — the Crypto
|
|
# tab's price sync 400s with a clear message until this is set.
|
|
AURUM_COINGECKO_API_KEY: ${AURUM_COINGECKO_API_KEY:-}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
web:
|
|
build: ./frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${AURUM_WEB_PORT:-3000}:80"
|
|
environment:
|
|
# Both unset = no login screen at all. See frontend/docker-entrypoint.d/20-basic-auth.sh.
|
|
AURUM_BASIC_AUTH_USER: ${AURUM_BASIC_AUTH_USER:-}
|
|
AURUM_BASIC_AUTH_PASSWORD: ${AURUM_BASIC_AUTH_PASSWORD:-}
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
aurum_pgdata:
|