Getting Started (Developers) β
π New Developer Onboarding Sequence β
Welcome to TradePsykl! This structured onboarding path will get you from zero to productive contributor in a systematic way. Follow this sequence in order β each phase builds on the previous.
Phase 1: Foundation β
Goal: Understand what we're building and why
- Read Project Context β
docs/architecture/01-context.mdβ System boundaries, external integrations, user personas - Understand Architecture β
docs/architecture/02-container.mdβ High-level container architecture (C4 model) - Review Key Decisions β
docs/architecture/04-decisions.mdβ Why we chose Python, OpenTelemetry, Cloudflare, etc. - Trading Concepts Overview β
docs/trading/overview.mdβ Weekly trading strategy fundamentals
Checkpoint: You should be able to explain: "What problem does TradePsykl solve?" and "What are the major system components?"
Phase 2: Environment Setup β
Goal: Get a working development environment
- Request Access β You'll receive an invitation to Cloudflare Access to view documentation (uses your GitHub account)
- Install Prerequisites β Prerequisites below β Docker Desktop, VS Code, WSL2 (Windows)
- Clone & Open in DevContainer β See Dev Container usage below
- Open Multi-Root Workspace β
trade_psykl.code-workspace(critical for Python imports) - Start Default Stack β
docker compose up -dβ Launch web + observability services - Verify Services Running β
docker compose psβ Check health status - Test Endpoints β API (localhost:8000), UI (localhost:5173), Prometheus (localhost:9090)
Checkpoint: All services green in docker compose ps, you can hit the API and see JSON response
Phase 3: Development Workflow β
Goal: Understand how to make changes and follow best practices
- Read Developer Environment Guide β
docs/infra/devops/developer-environment.mdβ Full workflow details - Understand Docker Profiles β
docs/infra/devops/docker-profiles.mdβ How to run different service combinations - Review Branching & PR Process β
docs/contributing.mdβ Git workflow and code review standards - Study CI/CD Pipeline β
docs/infra/devops/ci-cd.mdβ Automated testing and deployment - Practice: Create a branch, make a trivial change (e.g., update API hello message), run tests, open a draft PR
Checkpoint: You've created a branch, modified code, run tests locally, and understand the PR workflow
Phase 4: Observability Deep Dive β
Goal: Learn how we monitor and debug the system
- Read Observability Architecture β
docs/infra/devops/observability.mdβ Metrics, logs, traces strategy - Understand Service Telemetry β
.github/copilot/observability.mdβ Implementation patterns - Explore Grafana Cloud β VS Code Task: "Observability: Open Grafana Cloud" β View live dashboards
- Check Prometheus Metrics β
http://localhost:9090β Query service metrics - Review Existing Dashboards β
docs/infra/devops/dashboards/README.mdβ API and Engine monitoring
Checkpoint: You can find a trace in Grafana Cloud, query metrics in Prometheus, and understand what signals each service emits
Phase 5: Service Deep Dive β
Goal: Understand each service's architecture and responsibilities
Pick services based on your assigned work area. Read both main docs and Copilot guidance:
- API Service β
src/api/main.py+.github/copilot/api.md - Engine Service β
src/engine/main.py+.github/copilot/engine.md - UI Service β
src/ui/+.github/copilot/ui.md - Data Layer β
src/data/+.github/copilot/data.md - Documentation β
docs/+.github/copilot/docs.md
Checkpoint: You understand your service's entry points, configuration, telemetry, and test structure
Phase 6: Trading Domain Knowledge β
Goal: Learn the financial domain concepts we're automating
- Stock Selection Criteria β
docs/trading/stock-selection.mdβ How we pick stocks (liquidity, momentum, sectors) - Tools & Screeners β
docs/trading/tools-and-screeners.mdβ Finviz, TradingView, sector analysis platforms - Data Sources β
docs/trading/data-sources.mdβ APIs for price data, earnings, fundamentals - Strategy Template β
docs/trading/template.mdβ Standard format for documenting trading strategies - Review Component Architecture β
docs/architecture/03-component.mdβ How data flows through the system
Checkpoint: You can explain pivot-based weekly trading and identify which components handle data ingestion vs strategy execution
Phase 7: Implementation Roadmap β
Goal: Understand current progress and what's coming next
- Review Implementation Plan β
docs/architecture/05-implementation.mdβ Epics and task breakdown - Check Current Progress β Same file, look for
[x]completed vs[ ]pending items - Understand Deployment Strategy β
docs/infra/devops/deployment.mdβ How we release to production - Team Sync β Schedule pairing session to discuss your first assignment
Checkpoint: You know what's been built, what's in progress, and where you'll contribute first
π Quick Reference After Onboarding β
Need to...
- Run services? β How to run (containers)
- Debug an issue? β Useful developer commands + Observability docs
- Understand a config file? β Check Developer Environment Guide or Docker Profiles
- Add a new feature? β Follow Contributing Guide β Branch β Implement β Test β PR
- Add observability? β See Observability Patterns
- Find architectural context? β Start with C4 Architecture Docs β System design documentation
π Detailed Setup Guide β
This guide helps you run TradePsykl locally with Docker and understand the basics of the repo layout and CI.
- For deeper DevOps details, see
docs/devops/docker.mdanddocs/devops/ci-cd.md. - For the development environment workflow, see
docs/devops/developer-environment.md. - Documentation style: we reference files/paths rather than embedding configuration snippets.
What you'll set up β
- Containers orchestrated by
docker-compose.ymlfor:- Services: API (FastAPI), Engine, UI (static placeholder), CMS (docs), Data (MongoDB)
- Observability: Prometheus (metrics), Promtail (log shipping to Grafana Cloud)
- Per-service Dockerfiles under
src/(see the Services section indocs/devops/docker.md) - Optional VS Code Dev Container (
.devcontainer/devcontainer.json)
Prerequisites β
- Docker Desktop (Windows/macOS) or Docker Engine (Linux)
- Git
- VS Code (optional, recommended) with Dev Containers extension for a consistent environment
- Important: When using VS Code, open the multi-root workspace file
trade_psykl.code-workspace(not the folder directly) to enable per-service Python import resolution. Seedocs/devops/developer-environment.mdfor details.
Repo layout (high level) β
src/api/β FastAPI service (seesrc/api/main.py,src/api/requirements.txt)src/engine/β strategy/rule engine (placeholder runningmain.py)src/ui/β UI placeholder (served viaserveon 5173)docs/β VitePress documentation site (Dockerfile, package.json, and markdown sources)src/data/β MongoDB container setup (pinned image; optional init scripts ininitdb.d/)docs/devops/β operations docs (docker.md,ci-cd.md)
How to run (containers) β
This repo uses Compose profiles so you can run single-, multi-, or all-service stacks. The default profile is set in .env via COMPOSE_PROFILES=web,observability.
Default stack includes web services (API, UI, Data) + observability (Prometheus, Promtail). For comprehensive profile documentation, see docs/devops/docker-profiles.md.
Note: CMS (docs) runs only with explicit --profile cms or via native VitePress for development (see below).
- Start the default stack (uses
.env):
docker compose up -d- Start specific stacks by choosing profiles:
# Web services only (no observability)
docker compose --profile web up -d
# API + observability
docker compose --profile api --profile observability up -d
# Engine + Data + observability
docker compose --profile engine --profile data --profile observability up -d
# All services
docker compose --profile all up -d- Check services:
- API: http://localhost:8000/ β returns a JSON hello message
- UI: http://localhost:5173/ β renders a simple hello page
- Data: MongoDB listens on 27017 (no public web UI)
- Prometheus: http://localhost:9090/ β metrics UI
- Promtail: http://localhost:9080/ready β log shipping healthcheck
Note: For documentation development with live reload, use native VitePress (VS Code task: Docs: Dev Server (Native)) instead of the CMS container.
- Stop everything:
docker compose downTip: VS Code includes convenience tasks under .vscode/tasks.json (Run Task β "Compose: Up (default from .env)", etc.).
Ports and services β
These are the default local ports exposed by the composition (refer to docker-compose.yml for authoritative mappings):
| Service | Container | Host:Container | Purpose |
|---|---|---|---|
| API | api | 8000:8000 | FastAPI hello endpoint (GET /) |
| Engine | engine | 8001:8080 | Metrics endpoint (GET /metrics) |
| UI | ui | 8080:8080 | Static placeholder page |
| Docs | docs | 5173:5173 | Pre-built docs site (production) |
| Data | data | 27017:27017 | MongoDB (no web UI) |
| Prometheus | prometheus | 9090:9090 | Metrics UI and PromQL queries |
| Promtail | promtail | 9080:9080 | Log shipping healthcheck |
Note: For documentation development, use native VitePress (VS Code task: Docs: Dev Server (Native)) instead of the CMS container for live reload.
Useful developer commands β
- Start everything in the background (first run):
docker compose up --build -d- Start in the background (later runs, no rebuild):
docker compose up -d- See whatβs running and health states:
docker compose ps- Tail logs for all services (Ctrl+C to stop):
docker compose logs -f- Tail logs for one service:
docker compose logs -f api- Check observability endpoints:
# API metrics
Invoke-RestMethod http://localhost:8000/metrics
# Engine metrics
Invoke-RestMethod http://localhost:8001/metrics
# Prometheus UI
Start-Process http://localhost:9090
# Promtail health
Invoke-RestMethod http://localhost:9080/ready- Rebuild a specific service without cache:
docker compose build --no-cache api- Recreate just one service (no dependencies), rebuilding it:
docker compose up -d --no-deps --build api- Prevent builds even if images are missing (will error if not built yet):
docker compose up -d --no-build- Exec into a running container shell:
docker compose exec api sh- Stop and remove containers, network (keep volumes):
docker compose down- Stop and remove containers, network, and volumes (removes Mongo data):
docker compose down -v- Optional cleanup of dangling images/build cache:
docker image prune -f
docker builder prune -fQuick API test (PowerShell) β
Use PowerShell to hit the API root and parse JSON:
Invoke-RestMethod http://localhost:8000/Optional: Dev Container (VS Code) β
- Open the repository in VS Code β "Reopen in Container". The devcontainer provides Python 3.12 + Node LTS plus Docker CLI access.
- After opening in devcontainer: Open the workspace file (
File > Open Workspace from Fileβ¦βtrade_psykl.code-workspace) for proper per-service Python import resolution. - Services run in their own containers (per-service Dockerfiles). The devcontainer installs only shared dev tools (linters/formatters); app dependencies are built inside each service image.
- Run Compose from the devcontainer terminal the same as on the host. For fastest file mounts on Windows, prefer WSL2 and keep the repo under WSL.
- See
docs/devops/developer-environment.mdfor the end-to-end developer workflow and conventions.
CI/CD notes β
- CI workflow lives at
.github/workflows/ci.yml(seedocs/devops/ci-cd.md). - To conserve minutes, you can skip CI:
- Include
[skip ci]in the commit message (push) or in the PR title (pull_request). Jobs will not run. - You can always run manually from Actions via "Run workflow".
- Include
Mongo image pinning (brief) β
- The Mongo container used by
src/data/is pinned to a specific 7.0.x patch version to reduce drift and improve reproducibility/security. Update the tag periodically as fixes are released, or pin to a digest for immutability.
Troubleshooting β
- Port in use: change the host port mapping in
docker-compose.ymlor stop the conflicting app. - Cache issues: use
docker compose build --no-cache <service>. - Windows/WSL2: ensure Docker Desktop uses the WSL2 backend for best performance.
- Import errors in VS Code: ensure you've opened
trade_psykl.code-workspace(not the folder directly). Seedocs/devops/developer-environment.md. - Profile confusion: see
docs/devops/docker-profiles.mdfor comprehensive profile documentation and common scenarios.
What's next β
- When the real backend is implemented, set the API entrypoint to a proper server command (e.g., uvicorn) and replace UI placeholder with Svelte/Vue dev server.
- See
docs/devops/docker.mdfor more on services, healthchecks, and image pinning. - See
docs/devops/docker-profiles.mdfor comprehensive profile documentation and common development scenarios. - See
docs/devops/observability.mdfor observability architecture and Grafana Cloud integration. - See
docs/devops/developer-environment.mdfor the full development workflow including multi-root workspace setup.