| post_title | author1 | post_slug | microsoft_alias | featured_image | categories | tags | ai_note | summary | post_date | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Personal Finance Platform |
Mauricio Silva |
personal-finance |
n/a |
|
|
Generated with AI assistance following repository guidelines. |
Full-stack personal finance platform with analytics, automation, and documentation pipelines. |
2025-09-28 |
A production-minded personal finance suite built on Django, Celery, and rich analytics tooling. It ingests market data, computes portfolio metrics, and surfaces dashboards and APIs that are ready for Portainer or Leapcell deployments.
Note
The repository is organized as a multi-app Django project with Celery workers,
Redis integration, and a Sphinx documentation site. Explore AGENTS.md for
agent-focused guidance and the memory-bank/ folder for current project
context.
- Unified Django apps for analytics, backtesting, tax, realtime streaming, and portfolio management.
- Data ingestion adapters (e.g., Yahoo Finance) with asynchronous pipelines powered by Celery + Redis.
- Analytics built on Polars/Pandas, QuantStats, and visualization helpers including Plotly dashboards.
- REST and WebSocket surfaces prepared via Django REST Framework and Channels-compatible patterns.
- Comprehensive Sphinx documentation with reusable toctrees, autogenerated API docs, and changelog tooling.
| Layer | Highlights |
|---|---|
| Presentation | Django templates, DRF endpoints, websocket routing in config/ |
| Domain | Modular apps under personal_finance/ for analytics, portfolios, assets, tax, realtime, and visualization |
| Data & Storage | PostgreSQL (default) with SQLite fallback, Redis for async coordination |
| Automation | Celery workers, scheduled tasks via django-celery-beat, ETL scripts (run_finance.py, setup_database.py) |
| Documentation | Sphinx site with docs/index.rst toctree, sphinx-apidoc pipeline, changelog automation |
- Python 3.10 – 3.13 with
pip - PostgreSQL (optional; falls back to SQLite)
- Redis (required for Celery, optional for simple local runs)
- Docker + Docker Compose (optional, but recommended for parity)
justcommand runner (optional convenience)
-
Clone and enter the repository.
-
Create a virtual environment and install dependencies.
python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip python -m pip install -r requirements.txt python -m pip install -r requirements-dev.txt -
Configure environment variables.
cp .env.example .env # Edit .env to set DATABASE_URL, REDIS_URL, DJANGO_SECRET_KEY, etc. -
Initialize the database and static assets.
python manage.py migrate python manage.py collectstatic --noinput
-
Start the web server (Celery optional for simple flows).
python manage.py runserver
just up # or: docker compose -f docker-compose.local.yml up -d
just logs django # view container logs
just down # or: docker compose downTip
The just manage <command> shortcut wraps python manage.py <command>
inside the Docker Compose environment, keeping dependencies aligned with
container images.
| Variable | Purpose | Default/Fallback |
|---|---|---|
DJANGO_SETTINGS_MODULE |
Controls settings module (config.settings.local for dev) |
Set in .env |
DJANGO_SECRET_KEY |
Secret for cryptographic signing | Required |
DATABASE_URL |
Database connection string | Defaults to SQLite if unset |
REDIS_URL |
Redis connection for Celery & Channels | Required for async tasks |
ALLOWED_HOSTS |
Comma-separated hosts for Django | Defaults to localhost |
CELERY_BROKER_URL |
Broker override when not using Redis | Optional |
EMAIL_* |
SMTP configuration for alerts | Optional |
Warning
Never commit .env or secrets. Store production credentials in your
platform's secret manager (Portainer, Leapcell, GitHub Actions, etc.).
python manage.py check— validates Django configuration.python run_finance.py— orchestrates ETL/backtesting routines.python personal_finance/scripts/<name>.py— run bespoke data tasks.alembic upgrade head— apply non-Django schema migrations fromalembic/.
pytest -q
ruff check .
black .
flake8 src tests --max-line-length=88 --select=E9,F63,F7,F82
pip-auditRedis-dependent tests require a running Redis instance (docker compose up redis).
The docs live in docs/ and follow Sphinx best practices:
- The
index.rstroot defines navigation via a.. toctree::directive with:maxdepth: 2. - RestructuredText directives (
.. code-block::,.. glossary::, etc.) provide rich formatting. sphinx-apidocgenerates API stubs from Django modules, andchangelog_utils.pyenforces release notes.sphinx-quickstartmetadata was bootstrapped and can be revisited withsphinx-quickstartfor new projects.
Build and serve docs:
make -C docs html
make -C docs livehtml # requires sphinx-autobuild for live reload
make -C docs apidocs APP=personal_financeGenerated HTML appears under docs/_build/html. Publish via static hosting or
integrate into your deployment pipeline.
config/ # Django settings, URLs, ASGI/WSGI, Celery app
personal_finance/
analytics/ # Portfolio analytics services
assets/ # Asset import and enrichment
backtesting/ # Strategy simulation utilities
data_profiler/ # DataProfiler integrations and validators
data_sources/ # Market data adapters (e.g., yfinance)
realtime/ # Streaming & polling services
tax/ # Tax and compliance modules
visualization/ # Dashboard + plotting helpers
docs/ # Sphinx documentation suite
deploy/ # Portainer and Leapcell deployment artifacts
docker-compose.*.yml # Local and production compose stacks
memory-bank/ # Living context for AI agents
AGENTS.md # Agent operating handbook
- Portainer: Use assets under
deploy/portainer/to ship containers with Redis, PostgreSQL, Celery, and web services. - Leapcell: Follow
deploy/leapcell/templates and ensure environment variables align with cloud secrets. - Docker Compose (production):
docker-compose.production.ymlincludes hardened settings, static file serving via WhiteNoise, and background workers.
📚 Comprehensive Sphinx documentation is available at: https://maugx3.github.io/personal-finance/
The documentation follows the Diátaxis framework and includes:
- 🚀 Quick Start Guide: Get up and running in minutes
- 🏗️ Architecture Overview: System design and component interactions
- ⚙️ Configuration Reference: Environment variables, Django settings, and security
- 🔌 API Documentation: Complete REST API reference with examples
- 📊 Feature Modules: Deep-dive guides for backtesting, visualization, tax reporting, real-time data, and data profiling
- 🚀 Deployment Guide: Production deployment for Docker, cloud platforms, and security hardening
- 🔧 Development Guide: Local setup, testing, code quality, and contribution guidelines
# Install documentation dependencies
pip install -r requirements-docs.txt
# Build documentation
./build-docs.sh
# Or manually:
cd docs
make html
# Open docs/_build/html/index.html in your browserDocumentation is automatically built and deployed to GitHub Pages via GitHub Actions when changes are pushed to the main branch. The workflow builds the Sphinx documentation and publishes it at the GitHub Pages URL.
AGENTS.mdfor deep-dive operational procedures.memory-bank/for active decisions, progress tracking, and task backlog.docs/for narrative guides (howto.rst,users.rst, changelog utilities`).- Top-level usage guides (
BACKTESTING_USAGE.md,REALTIME_USAGE.md,VISUALIZATION_USAGE.md,TAX_USAGE.md) for feature-specific walkthroughs.