Skip to content

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

  1. Read Project Context β†’ docs/architecture/01-context.md β€” System boundaries, external integrations, user personas
  2. Understand Architecture β†’ docs/architecture/02-container.md β€” High-level container architecture (C4 model)
  3. Review Key Decisions β†’ docs/architecture/04-decisions.md β€” Why we chose Python, OpenTelemetry, Cloudflare, etc.
  4. 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

  1. Request Access β†’ You'll receive an invitation to Cloudflare Access to view documentation (uses your GitHub account)
  2. Install Prerequisites β†’ Prerequisites below β€” Docker Desktop, VS Code, WSL2 (Windows)
  3. Clone & Open in DevContainer β†’ See Dev Container usage below
  4. Open Multi-Root Workspace β†’ trade_psykl.code-workspace (critical for Python imports)
  5. Start Default Stack β†’ docker compose up -d β€” Launch web + observability services
  6. Verify Services Running β†’ docker compose ps β€” Check health status
  7. 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

  1. Read Developer Environment Guide β†’ docs/infra/devops/developer-environment.md β€” Full workflow details
  2. Understand Docker Profiles β†’ docs/infra/devops/docker-profiles.md β€” How to run different service combinations
  3. Review Branching & PR Process β†’ docs/contributing.md β€” Git workflow and code review standards
  4. Study CI/CD Pipeline β†’ docs/infra/devops/ci-cd.md β€” Automated testing and deployment
  5. 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

  1. Read Observability Architecture β†’ docs/infra/devops/observability.md β€” Metrics, logs, traces strategy
  2. Understand Service Telemetry β†’ .github/copilot/observability.md β€” Implementation patterns
  3. Explore Grafana Cloud β†’ VS Code Task: "Observability: Open Grafana Cloud" β€” View live dashboards
  4. Check Prometheus Metrics β†’ http://localhost:9090 β€” Query service metrics
  5. 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:

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

  1. Stock Selection Criteria β†’ docs/trading/stock-selection.md β€” How we pick stocks (liquidity, momentum, sectors)
  2. Tools & Screeners β†’ docs/trading/tools-and-screeners.md β€” Finviz, TradingView, sector analysis platforms
  3. Data Sources β†’ docs/trading/data-sources.md β€” APIs for price data, earnings, fundamentals
  4. Strategy Template β†’ docs/trading/template.md β€” Standard format for documenting trading strategies
  5. 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

  1. Review Implementation Plan β†’ docs/architecture/05-implementation.md β€” Epics and task breakdown
  2. Check Current Progress β†’ Same file, look for [x] completed vs [ ] pending items
  3. Understand Deployment Strategy β†’ docs/infra/devops/deployment.md β€” How we release to production
  4. 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...


πŸ“– 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.md and docs/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.yml for:
    • 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 in docs/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. See docs/devops/developer-environment.md for details.

Repo layout (high level) ​

  • src/api/ β€” FastAPI service (see src/api/main.py, src/api/requirements.txt)
  • src/engine/ β€” strategy/rule engine (placeholder running main.py)
  • src/ui/ β€” UI placeholder (served via serve on 5173)
  • docs/ β€” VitePress documentation site (Dockerfile, package.json, and markdown sources)
  • src/data/ β€” MongoDB container setup (pinned image; optional init scripts in initdb.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):
powershell
docker compose up -d
  • Start specific stacks by choosing profiles:
powershell
# 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

Note: For documentation development with live reload, use native VitePress (VS Code task: Docs: Dev Server (Native)) instead of the CMS container.

  • Stop everything:
powershell
docker compose down

Tip: 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):

ServiceContainerHost:ContainerPurpose
APIapi8000:8000FastAPI hello endpoint (GET /)
Engineengine8001:8080Metrics endpoint (GET /metrics)
UIui8080:8080Static placeholder page
Docsdocs5173:5173Pre-built docs site (production)
Datadata27017:27017MongoDB (no web UI)
Prometheusprometheus9090:9090Metrics UI and PromQL queries
Promtailpromtail9080:9080Log 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):
powershell
docker compose up --build -d
  • Start in the background (later runs, no rebuild):
powershell
docker compose up -d
  • See what’s running and health states:
powershell
docker compose ps
  • Tail logs for all services (Ctrl+C to stop):
powershell
docker compose logs -f
  • Tail logs for one service:
powershell
docker compose logs -f api
  • Check observability endpoints:
powershell
# 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:
powershell
docker compose build --no-cache api
  • Recreate just one service (no dependencies), rebuilding it:
powershell
docker compose up -d --no-deps --build api
  • Prevent builds even if images are missing (will error if not built yet):
powershell
docker compose up -d --no-build
  • Exec into a running container shell:
powershell
docker compose exec api sh
  • Stop and remove containers, network (keep volumes):
powershell
docker compose down
  • Stop and remove containers, network, and volumes (removes Mongo data):
powershell
docker compose down -v
  • Optional cleanup of dangling images/build cache:
powershell
docker image prune -f
docker builder prune -f

Quick API test (PowerShell) ​

Use PowerShell to hit the API root and parse JSON:

powershell
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.md for the end-to-end developer workflow and conventions.

CI/CD notes ​

  • CI workflow lives at .github/workflows/ci.yml (see docs/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".

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.yml or 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). See docs/devops/developer-environment.md.
  • Profile confusion: see docs/devops/docker-profiles.md for 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.md for more on services, healthchecks, and image pinning.
  • See docs/devops/docker-profiles.md for comprehensive profile documentation and common development scenarios.
  • See docs/devops/observability.md for observability architecture and Grafana Cloud integration.
  • See docs/devops/developer-environment.md for the full development workflow including multi-root workspace setup.

Documentation generated with VitePress