Personal finance tracking web application with cash flow and investment management.
- Cash flow tracking (income/expenses)
- Investment portfolio management
- Excel bank statement import
- Multi-language support (EN/TR)
- Grafana analytics integration
# Clone and setup
git clone <repo-url>
cd track-finance
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Initialize database
flask db upgrade
# Run application
flask run --debug
Access: http://localhost:5000
When you modify database models, run these commands:
# Generate migration after model changes
flask db migrate -m "Description of changes"
# Apply migrations to database
flask db upgrade
# Check migration status
flask db current
# Rollback to previous migration (if needed)
flask db downgrade
# Reset database (⚠️ This will delete all data!)
flask db downgrade base
flask db upgrade
# Access database shell
flask shell
SQLite "database is locked" error (common with Grafana integration):
# Enable WAL mode for concurrent access
sqlite3 finance.db "PRAGMA journal_mode=WAL;"
sqlite3 finance.db "PRAGMA busy_timeout=30000;"
# Check database status
sqlite3 finance.db ".databases"
When you add new _('text')
strings to templates or code:
# Extract new translatable strings
pybabel extract -F babel.cfg -k _l -o messages.pot .
# Update existing translation files
pybabel update -i messages.pot -d translations
# Edit translation files manually
# translations/tr/LC_MESSAGES/messages.po
# translations/en/LC_MESSAGES/messages.po
# Compile translations after editing
pybabel compile -d translations
Create /etc/systemd/system/track-finance.service
:
[Unit]
Description=Track Finance Gunicorn Service
After=network.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/track-finance
ExecStart=/home/ubuntu/track-finance/.venv/bin/gunicorn -w 4 -b 0.0.0.0:8000 app:app
Restart=always
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl enable track-finance
sudo systemctl start track-finance
sudo systemctl status track-finance
If you prefer to run Gunicorn manually:
# Using Gunicorn directly
gunicorn -w 4 -b 0.0.0.0:8000 app:app
This project is licensed under the MIT License - see the LICENSE file for details.
© 2025 Zekeriya AY