How tsimbalar/codemagic-build-monitor works
Main Components
a. External Systems:
• Codemagic CI/CD Platform (external service)
• CatLight Client (consumer)
b. Core Application Components:
• API Layer
• Controllers (BuildInfo, Diagnostics, Example, Index)
• Authentication (Bearer Token)
• Middleware (Error Handling, Logging, Schema Validation)
• Domain Layer
• App Repository Interface
• Workflow Run Repository Interface
• Infrastructure Layer
• Codemagic Integration
• Codemagic Client
• App Repository Implementation
• Workflow Run Repository Implementation
• Caching Layer
• Cached App Repository
• Protocol Layer
• CatLight Protocol Implementation
• Basic Protocol
• Dynamic Protocol
• Shared Components
Relationships and Data Flow
• CatLight Client → API Layer (HTTP/REST)
• API Layer → Domain Layer (Internal calls)
• Domain Layer → Infrastructure Layer (Repository pattern)
• Infrastructure Layer → Codemagic API (External HTTP calls)
• Caching Layer ↔ Infrastructure Layer (Cache interaction)
Important Architectural Patterns to Highlight
• Clean Architecture pattern (controllers → domain → infrastructure)
• Repository Pattern (IAppRepository, IWorkflowRunRepository)
• Adapter Pattern (converting Codemagic data to CatLight protocol)
• Caching Strategy (CachedAppRepository)
• Dependency Injection (visible in the IoC container setup)
Technical Details
• Express.js as the web framework
• TSOA for API documentation and routing
• Bearer token authentication
• Docker containerization
• Port 9902 for the service
Implementation Notes
• The flow of authentication (Bearer token)
• Caching mechanism
• Error handling flow
• Request/Response flow
External Services Layer (Codemagic CI/CD)
Keep the abstraction level focused on the main architectural components while showing the key interactions that make the system work as a build status adapter between Codemagic and CatLight.
Remember to include the Docker container boundary around the application components to show the deployment context, as this is distributed as a containerized application.