Thanks for your interest in Capital! This document explains how to set up your environment, the branching model, and the rules we ask contributors to follow.
By participating you agree to abide by our Code of Conduct. Be kind. Assume good faith.
engine/ Python trading engine + API (uv, FastAPI, PostgreSQL)
web/ React + Vite + TypeScript dashboard
docs/ architecture, branching, PR guidelines, releases, venue setup
git clone https://github.com/FurkanEdizkan/Capital.git
cd Capital
git checkout test # always branch off test, never main
git switch -c feat/my-thingThe fastest path to a running stack is the installer (Docker + Compose v2):
scripts/install.sh # development mode — hot reload
scripts/install.sh prod # production-style mode — built assetsTo develop a single service directly (hot reload, native tooling):
# 1. PostgreSQL
docker compose up -d postgres
# 2. Engine
cd engine
uv sync
uv run alembic upgrade head
uv run uvicorn main:app --reload # http://localhost:8000
# 3. Web (in another shell)
cd web
npm install
npm run dev # http://localhost:5173Capital uses a two-trunk model.
contributors -> feature/* -> PR into test -> CI green -> merged into test
|
automated PR test -> main
|
CI green
v
main (stable)
mainis the stable branch. Releases are tagged frommain. Never open a PR directly intomain.testis the integration branch. All contributor PRs targettest.- A GitHub workflow opens (or refreshes) a PR from
testintomainwhenever CI ontestis green. Maintainers review and merge that PR to ship.
See docs/BRANCHING.md for the full model and the branch-protection settings maintainers must configure.
- Create a topic branch off
test. Use prefixes:feat/,fix/,docs/,refactor/,chore/,ci/,test/,perf/. - Make your changes. Add or update tests.
- Ensure the project's lint + test commands pass locally:
- Engine:
cd engine && uv run ruff check . && uv run pytest - Web:
cd web && npm run lint && npm run build - If you changed an engine API endpoint or model, regenerate the schema:
cd engine && uv run python export_openapi.pycd web && npm run gen:api
- Engine:
- Push and open a PR into
test. Fill out the PR template. - Address review feedback. CI must be green before merge.
- Maintainers merge with a merge commit (not squash). Your PR title becomes the merge commit message, so it must follow Conventional Commits — and because every commit on your branch is preserved in history, write those cleanly and Conventionally too.
Read docs/PR_GUIDELINES.md for the full checklist.
We follow Conventional Commits 1.0.0.
Format:
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
Allowed types: feat, fix, docs, style, refactor, perf, test,
build, ci, chore, revert.
The scope is optional and free-form — use the area of the codebase you touched
(engine, web, api, ui, infra, ci, docs, …).
Examples:
feat(engine): add binance client wrapperfix(web): crash on empty positions listdocs: clarify local setup steps
Breaking changes use ! and a BREAKING CHANGE: footer:
feat(api)!: rename `path` field to `source`
BREAKING CHANGE: clients must update the field name.
PR titles are validated against .commitlintrc.yaml by the Commitlint
workflow; the local husky commit-msg hook applies the same rules.
- Keep tests close to the code they cover.
- Prefer small, real fixtures over heavy mocks when verifying behavior.
- Add a regression test with every bug fix.
- Engine tests run against a real PostgreSQL (CI brings one up). Don't mock the database.
Use the GitHub issue templates. Include your OS, the project version or commit, and clear reproduction steps.