Language: English | Español
Finance is a Flask + PostgreSQL web app to manage personal/household finances with role-based access, dashboard analytics, records, backups, and SMTP reports.
This application was created with AI assistance. The project ideas and direction come from the author.
Repository: osmelonunez/finance
- Stable version:
3.0.0 - Production compose image is pinned to
f1nanc3/finance:3.0.0
- Separate views:
Expenses,Incomes,Savings - Dashboard with monthly and yearly charts
- Auth with roles:
admin,editor,user - Rate limiting in auth endpoints
- Profile preferences per user:
- language (
en/es) - rows per page
- email notifications on/off
- language (
- Management modules:
- users
- database connection
- backups
- SMTP + email reports
- categories
- system settings
- accounts/cards
- Deferred and financed expenses
- Localized categories for default list (
en/es) - SQL migrations with migration tracking table
- Gunicorn runtime in Docker, running as non-root user
- Structured JSON logs + health checks (
/health/live,/health/ready)
- Backend: Python, Flask, psycopg2
- Database: PostgreSQL
- Frontend: Jinja2 templates, Bootstrap, Chart.js
- Runtime: Docker, Docker Compose, Gunicorn
- Docker + Docker Compose
- PostgreSQL reachable from the container
make upApp URL:
Useful commands:
make restart
make logs
make downOn first access, app redirects to /setup.
Options:
Use existing databaseCreate new database
Notes:
- First admin is created from wizard form.
- No hardcoded
admin/admin. - Database and database user must already exist.
- DB connection is persisted in
/config/.app_config.json. - If
DB_CONFIG_ENCRYPTION_KEYis configured, DB URL is stored encrypted.
Compose file:
/Users/osmel/git/finance/docker/docker-compose.yaml
Commands:
make up-prod
make logs-prod
make down-prodMulti-arch build + push (linux/amd64,linux/arm64):
make build IMAGE=f1nanc3/finance:latestLocal build only:
make build-localDependency audit:
make audit-depsRequired in production:
APP_ENV=productionSECRET_KEY(must be custom, non-default)SMTP_ENCRYPTION_KEY(must be custom, non-default)DB_CONFIG_ENCRYPTION_KEY(required when using/config/.app_config.jsonDB config)
Recommended:
APP_PUBLIC_URL(links in emails)SESSION_LIFETIME_HOURS(default12)LOG_FORMAT=jsonLOG_LEVEL=INFO
Rate limits:
RATE_LIMIT_LOGIN_IPRATE_LIMIT_LOGIN_IDRATE_LIMIT_REGISTER_IPRATE_LIMIT_PASSWORD_CHANGE
- In production, startup fails if required secrets are missing/default.
- App config file is created with mode
0600. - SMTP credentials are encrypted at rest.
- DB URL in app config can be encrypted with
DB_CONFIG_ENCRYPTION_KEY. - Container logs are rotated via Compose:
max-size: 10mmax-file: 7
- Secrets are redacted from logs (passwords/tokens/URLs with credentials).
- Backup files are stored at
/backupsin the container. - Typical mounts:
./backups -> /backups./config -> /config
- Backup schedule/retention/restore/delete from:
Management -> Backups
- SMTP settings are managed in UI (
Management -> SMTP). - Sender display name is configurable.
- Monthly/yearly reports are enabled by default.
- Reports are sent only to users:
- active
- with email notifications enabled
- Report template version is configurable (phase 1:
v1).
This project is licensed under the MIT License.