metadata
title: Development Guide
summary: Local workflow for code, docs, tests, notebooks, and frontend changes.
Development Guide
This page is the maintainer-facing companion to the product docs.
Repo Layout
| Path | Purpose |
|---|---|
src/TerraFin/data/ |
Data providers, normalization, and output types |
src/TerraFin/analytics/ |
Indicators, DCF, risk, options, portfolio, and simulation helpers |
src/TerraFin/interface/ |
FastAPI app, page routes, and frontend |
src/TerraFin/agent/ |
External-agent client, hosted runtime, model runtime, and tools |
docs/ |
Formal documentation site source |
tests/ |
Automated regression coverage |
notebooks/ |
Manual and demo notebooks only |
Local Setup
pip install -e ".[dev]"
Add extras when needed:
pip install -e ".[db]"
pip install -e ".[notebooks]"
pip install -e ".[docs]"
Tests
Core Python tests:
pytest
Agent-focused slice:
pytest tests/agent tests/interface/test_agent_api.py
Packaging smoke:
python -m build
python scripts/package_smoke.py
Frontend
The frontend lives under src/TerraFin/interface/frontend/.
Typical commands:
npm install
npm run build
When you touch page-specific agent context, DCF workbenches, or the hosted assistant widget, verify both desktop and mobile flows.
Docs Site
TerraFin now ships a formal static docs site using MkDocs Material.
Preview locally:
pip install -e ".[docs]"
mkdocs serve
Build locally:
mkdocs build --strict
GitHub Pages deployment is defined in .github/workflows/docs-pages.yml.
Notebook Rules
Notebooks are for human-guided exploration, not automated tests.
- keep notebooks under
notebooks/ - do not use a
test_prefix for notebook filenames - promote stable notebook logic into
tests/test_*.pyif it becomes regression-critical
Detailed notebook guidance lives in Notebooks.
External Artifacts
Some code-adjacent references remain useful even though they are not formal docs pages:
- analytics implementation notes: src/TerraFin/analytics/analysis/README.md
- shipped TerraFin skill: skills/terrafin/SKILL.md