git clone https://github.com/0bserver07/StackUnderflow.git
cd StackUnderflow
pip install -e ".[dev]"The [dev] extra pulls in pytest, ruff, mypy, and the build tooling. To work
on the React frontend:
cd stackunderflow-ui
npm install
npm run dev # dev server with hot reload
npm run build # production build → stackunderflow/static/react/pytest tests/ -q # fast suite; slow tests are deselected by default
pytest -m slow tests/stackunderflow/integration -q # slow e2e + perf-regression suiteFrontend tests use the Node built-in test runner (no vitest dependency):
cd stackunderflow-ui && node --test tests/services/*.test.tsbash lint.sh # ruff check + ruff format --check + mypy- Fork the repo and create a branch from
main - Make your changes
- Add tests if you added functionality
- Run the test suite and linter
- Open a PR with a clear description of what changed and why
See docs/adapters.md for the contract (SessionRef, Record, the SourceAdapter protocol), the enumerate() / read() semantics, the ProviderPricer extension point, and the beta-flag wiring pattern. Working references: stackunderflow/adapters/claude.py (file-mode), stackunderflow/adapters/cursor.py (database-mode).
stackunderflow/adapters/— per-provider source-file parsersstackunderflow/etl/— the normalize → marts pipeline, the filesystem watcher, backfillstackunderflow/store/— SQLite store, schema, migrations, query helpersstackunderflow/routes/— FastAPI route modulesstackunderflow/services/— search, Q&A, tags, bookmarks, discovery, recommendersstackunderflow/infra/— cache, costs, currency, provider pricersstackunderflow/mcp/— the MCP serverstackunderflow-ui/— React frontend
docs/HANDOFF.md has the full package map and the design rationale.
- Python: follow ruff defaults, 120 char line length
- TypeScript: follow the existing patterns in
stackunderflow-ui/ - No docstrings needed for obvious functions
- Comments only where the logic isn't self-evident