Version: 3.0 Last Updated: 2025-11-25
| Documentation Type | Location | Description |
|---|---|---|
| 🏗️ Architecture V3 | architecture-v3/ | Complete V3 distributed architecture, patterns, and standards |
| 📋 V3 Implementation Proposal | ../proposal/implementation-v1/ | Detailed V3 implementation proposal with service specs |
| ✨ Features | features/ | Feature specifications and implementation guides |
| 🔐 Authentication | authenication-authorization-spec/ | EVE SSO auth and RBAC specification |
| 📊 Observability | observability/ | Metrics, logging, tracing, and alerting standards |
| 📦 Product Specs | product_specs.md | High-level product vision and requirements |
| 🗂️ Archive | archive/v1-v2/ | Legacy V1 and V2 documentation (reference only) |
- Architecture
- Features
- Observability
- Product & Technical Specifications
- Authentication & Authorization
- API Documentation
- Quick Start Guides
- Archive
Location: architecture-v3/
BattleScope V3 is a distributed, event-driven microservices architecture with strict domain boundaries and no shared code between services.
Key Documents:
- INDEX.md - Complete navigation guide for all V3 architecture docs
- Domain Service Boundaries - Domain-driven design applied to BattleScope
- Service Storage Isolation - Database-per-service pattern
- Code Isolation and Duplication - Why NO shared packages
- Distributed Systems Design - Resilience patterns (circuit breakers, retries, idempotency)
- Service Contracts and Testing - API and event contract standards
- Testing Standards and Coverage - 80% coverage requirement and testing patterns
- Code Standards and Quality - TypeScript, linting, formatting standards
- Makefile Standards - Development workflow automation
- GitHub Actions CI/CD - Automated testing and deployment
- Local Development Environment - Setting up local dev environment
Location: ../proposal/implementation-v1/
Complete implementation specification for V3 migration:
- INDEX.md - Executive summary and navigation
- README.md - Overview, timeline, success criteria
- ARCHITECTURE.md - Technical architecture details
- DOMAIN-BOUNDARIES.md - Service domain definitions
- OBSERVABILITY.md - Metrics, logging, tracing, SLO standards
- OBSERVABILITY-INFRASTRUCTURE.md - Kubernetes observability stack (Prometheus, Grafana, Loki, Jaeger)
- services/ - Detailed service specifications (6 services)
- diagrams/ - 8 Mermaid architecture diagrams
6 Services:
- Ingestion Service - Raw killmail acquisition (RedisQ + History API)
- Enrichment Service - Killmail augmentation with ESI data
- Battle Service - Clustering killmails into battles
- Search Service - Full-text search (Typesense)
- Notification Service - Real-time WebSocket notifications
- Frontend BFF - Backend-for-Frontend aggregation layer
Domain-Driven Design:
- 6 bounded contexts, each with ONE service
- No cross-domain data access
- Event-driven communication via Kafka
Code Isolation:
- NO shared packages (
@battlescope/commonremoved in V3) - Each service owns its types, models, and utilities
- Duplication > coupling
Storage Isolation:
- 6 databases (PostgreSQL + Typesense + Redis)
- No cross-database queries
- Data synchronization via Kafka events only
Service-Owned APIs:
- Each service exposes its own HTTP API
- No central API gateway (or thin routing only)
Location: features/
Directory: features/battle-reports/
- Killmail collection and filtering
- Battle clustering algorithm
- Battle reconstruction and statistics
Documents:
- feature-spec.md - Complete feature specification
- frontend-spec.md - UI/UX specification
- openapi-spec.md - API specification
Directory: features/battle-intel/
- Statistical analysis and trends
- Opponent tracking
- Combat intelligence
Documents:
- feature-spec.md - Complete feature specification
- frontend-spec.md - UI/UX specification
- openapi-spec.md - API specification
Directory: features/search/
- Full-text search across battles and entities
- Faceted filtering
- Autocomplete
Documents:
- feature-spec.md - Search feature specification
- frontend-spec.md - Search UI specification
- openapi-spec.md - Search API specification
- IMPLEMENTATION_SUMMARY.md - Implementation status
Directory: features/admin-panel/
- System configuration
- User management
- Ruleset configuration
Documents:
- feature-spec.md - Admin feature specification
- frontend-spec.md - Admin UI specification
- openapi-spec.md - Admin API specification
Document: features/historical-ingestion/feature-spec.md
Backfill historical killmail data using zKillboard History API:
- Date range selection
- Batch processing
- Progress tracking
- Job management UI
Use Cases:
- Data recovery after outages
- New alliance tracking (populate historical data)
- Historical analysis and trends
- Initial installation bootstrap
Document: features/data-retention-policy.md
Automatic 60-month (5-year) rolling window:
- Daily retention cleanup (02:00 UTC)
- Daily verification (03:00 UTC)
- Gap detection on startup
- Battle re-clustering when data changes
Location: observability/
Proposal Documents:
- OBSERVABILITY.md - Complete observability standards
- OBSERVABILITY-INFRASTRUCTURE.md - Kubernetes observability stack
| Component | Purpose | Retention | Access |
|---|---|---|---|
| Prometheus | Metrics collection and alerting | 30 days | NodePort 30500 |
| Grafana | Dashboards and visualization | N/A | NodePort 30501 |
| Loki | Log aggregation | 7 days | Internal (via Grafana) |
| Jaeger | Distributed tracing | 7 days | NodePort 30502 |
| AlertManager | Alert routing (Slack, PagerDuty) | N/A | Internal |
Metrics:
- Standard HTTP, database, Kafka, and cache metrics
- Business metrics (battles created, killmails ingested, etc.)
- SLO tracking (availability, latency, error rate)
Logging:
- Structured JSON logs with trace context
- File/line/function automatically added
- Log levels: ERROR, WARN, INFO, DEBUG, TRACE
Tracing:
- OpenTelemetry distributed tracing
- End-to-end killmail processing traces
- Database query tracing
- External API call tracing
Alerting:
- 15+ predefined alerts (critical + warning + SLO)
- Slack notifications for all alerts
- PagerDuty for critical alerts only
- Alert inhibition rules
| Service | Availability | Latency (p95) | Error Rate |
|---|---|---|---|
| Ingestion | 99.5% | N/A (async) | <1% |
| Enrichment | 99.5% | N/A (async) | <2% |
| Battle | 99.9% | <500ms | <0.5% |
| Search | 99.9% | <100ms | <0.5% |
| Notification | 99.5% | <100ms | <1% |
| Frontend BFF | 99.9% | <200ms (cached) | <1% |
product_specs.md - Platform-level product specification and feature overview
- requirements.md - Functional and non-functional requirements
- user-stories.md - User stories and acceptance criteria
- features.md - Feature list and priorities
- roadmap.md - Development roadmap
technical_specs.md - Legacy technical architecture (V1/V2 reference)
Ruleset Configuration: ruleset_configuration_spec.md - Ingestion ruleset configuration
Supported filters:
- Minimum pilots (e.g., only track battles with 5+ participants)
- Tracked alliances (allowlist)
- Tracked corporations (allowlist)
- Tracked systems (specific solar system IDs)
- Security types (highsec, lowsec, nullsec, wormhole, pochven)
Location: authenication-authorization-spec/
Status: ⏳ Planned (not yet implemented)
- EVE Online SSO - OAuth2/OIDC authentication
- Multi-character support - Link multiple EVE characters to one account
- Feature-scoped RBAC - Roles per feature:
user,fc,director,admin,superadmin - Graceful UI degradation - UI adapts based on feature access
All endpoints are currently public (no authentication required).
| File | Description | Source of Truth |
|---|---|---|
| openapi.json | Auto-generated from code | ✅ Yes |
| openapi-generated.yaml | YAML version of auto-generated spec | ✅ Yes |
| openapi.yaml | Original hand-crafted spec | ❌ Reference only |
Swagger UI (when server running):
cd backend/api
pnpm run dev
# Open: http://localhost:3000/docsRedoc:
npx redoc-cli serve docs/openapi.jsoncd backend/api
pnpm run generate-openapiThis updates:
docs/openapi.jsondocs/openapi-generated.yaml
All API responses follow these conventions:
- IDs as Strings:
"killmailId": "12345678"(supports BigInt) - Nullable Names:
"allianceName": "Pandemic Legion"ornull - ISO Timestamps:
"2025-11-25T18:43:00Z" - Consistent Errors:
{ "message": "Error description" }
- Architecture Overview: Start with architecture-v3/INDEX.md
- Service Specs: Read service specifications in proposal/implementation-v1/services/
- Local Setup: Follow architecture-v3/local-development-environment.md
- Coding Standards: Review architecture-v3/code-standards-and-quality.md
- Testing: Follow architecture-v3/testing-standards-and-coverage.md
- Executive Summary: Read proposal/implementation-v1/README.md
- Architecture Details: Review proposal/implementation-v1/ARCHITECTURE.md
- Domain Boundaries: Study proposal/implementation-v1/DOMAIN-BOUNDARIES.md
- Diagrams: Review all 8 diagrams in proposal/implementation-v1/diagrams/
- Observability: Check proposal/implementation-v1/OBSERVABILITY.md
- Executive Summary: Read proposal/implementation-v1/README.md executive summary
- Product Specs: Review product_specs.md
- Features: Check features/ for feature specifications
- Success Criteria: Review success criteria in proposal/implementation-v1/README.md
- Timeline: Check implementation phases in proposal/implementation-v1/README.md
Location: archive/v1-v2/
Legacy V1 and V2 documentation moved to archive:
- V2 architecture documentation
- Docker image specifications (V1/V2)
- Legacy service configurations
- Old technical specifications
- Historical logging documentation
Note: This is for reference only. Use V3 architecture docs for current implementation.
- Use Markdown format with proper heading hierarchy
- Include tables for structured data
- Provide code examples in JSON/YAML/TypeScript
- Add diagrams using Mermaid when helpful
- Cross-reference related documents
- Update this README when adding new sections
When code changes:
- Update route schemas in code
- Update route handlers
- Run
pnpm run generate-openapi - Commit code and generated specs together
When requirements change:
- Update product specifications
- Update feature specifications
- Implement code changes
- Update service specifications
- Regenerate OpenAPI specs
Adding new features:
- Create feature specification in
features/<feature-name>/ - Update service specifications in proposal
- Create API schemas and routes
- Generate OpenAPI specs
- Update this README's feature list
- Keep docs in sync with code - Documentation should reflect reality
- Use clear language - Avoid jargon, explain acronyms
- Provide examples - Show, don't just tell
- Update navigation - Add new docs to README and INDEX files
- Review before committing - Check for broken links and formatting
- Link related sections - Help readers discover related content
- Swagger UI: Built-in at
/docswhen API server running - Redoc:
npx redoc-cli serve docs/openapi.json - Mermaid: Diagram rendering in GitHub and VS Code
- OpenAPI Generator: Generate client libraries
TypeScript:
npx @openapitools/openapi-generator-cli generate \
-i docs/openapi.json \
-g typescript-axios \
-o clients/typescriptPython:
npx @openapitools/openapi-generator-cli generate \
-i docs/openapi.json \
-g python \
-o clients/python- Postman: Import
docs/openapi.json - Insomnia: Import OpenAPI spec
- curl: Copy examples from Swagger UI
- VS Code REST Client: Use
.httpfiles
Questions or issues:
- Check existing documentation first
- Review API examples in specs
- Consult observability standards
- Create GitHub issue for doc bugs
Documentation feedback:
- Create GitHub issue
- Tag with
documentationlabel - Suggest improvements or corrections
Last Updated: 2025-11-25 Architecture Version: V3 Status: Implementation in progress