2.8 KiB
Repository Guidelines
Project Structure & Module Organization
backend/ hosts the FastAPI services plus ML pipelines (services/, strategy/, prompts/) and shared utilities; entrypoint is backend/main.py. frontend/ is a Vite-powered Vue 3 dashboard (routes, stores, charts). Persistent specs live in docs/, while scripts/, verify_implementation.sh, and verify-cicd.sh automate checks and deployments. Root-level docker-compose.yml wires PostgreSQL, Redis, API, frontend, and Adminer, so treat it as the single source for service wiring and env expectations.
Build, Test, and Development Commands
# Backend local dev
cd backend && pip install -r requirements.txt && uvicorn main:app --reload
# Frontend dev server
cd frontend && npm install && npm run dev
# End-to-end stack
docker-compose up -d && docker-compose logs -f backend
Use npm run build for production dashboard bundles, and docker-compose restart backend whenever environment variables change. The verify_implementation.sh and verify-cicd.sh scripts chain lint, tests, and deployment smoke checks before merges.
Coding Style & Naming Conventions
Python modules use 4-space indentation, type hints, and descriptive, hyphen-free snake_case names (see backend/services/ patterns). Run black backend && isort backend for formatting, flake8 backend for lint, and mypy backend for type gates before pushing. Vue components follow PascalCase file names, script setup with Composition API, and 2-space indentation; run npm run lint (ESLint + eslint-plugin-vue) and keep refs in src/ aligned with the router name (e.g., DashboardView.vue).
Testing Guidelines
Back-end unit and integration tests live under backend/tests/ plus top-level probes like test_smart_cache.py. Execute pytest backend/tests --asyncio-mode=auto --cov=backend and target critical standalone suites with pytest test_real_data_integration.py -k live. For API smoke checks, reuse the curated curl commands in TEST_COMMANDS.md (e.g., curl -X POST http://localhost:8001/api/collab/recommend -d '{"symbol":"AAPL"}'). Keep new tests named test_<feature>.py or Test<Class> inside modules so pytest auto-discovers them.
Commit & Pull Request Guidelines
Commits follow the repo’s Conventional Commit history (feat:, fix:, test:, etc.) and should remain scoped to one domain (backend, frontend, infra). Reference Jira/GitHub issue IDs where available. PRs must explain motivation, outline backend/frontend impacts, attach CLI or screenshot proof for new UI states, list config or secret changes, and link to the verification script output. When touching deployment files (docker-compose, k8s manifests), include rollback notes and confirm secrets are injected via .env or Kubernetes secrets rather than committed files.