Welcome to CML Cloud ManagerΒΆ
A production-ready reference implementation for managing, monitoring, and operating CML Workers with real-time updates, background processing, and role-based access control.
This project demonstrates how to build a modern web application using the neuroglia-python framework. It provides a solid foundation for clean, scalable, and maintainable applications with Python while showcasing:
- Multi SubApp FastAPI architecture (API + UI)
- CQRS + domain events + background jobs (APScheduler)
- Real-time UI updates via Server-Sent Events (SSE)
- Automated worker & labs refresh cycles
- Role-based access (Admin / Manager / User)
- Observability with OpenTelemetry

Getting StartedΒΆ
New to the project? Start here:
- Install & Run: Follow the Installation Guide then Running the App.
- Login Roles: Use provided Keycloak test users (
admin,manager,user). - Explore Workers: View current workers; admins/managers can create, start/stop, terminate; all roles can view metrics.
- Real-Time Updates: Watch the status badge and worker list update automatically via SSE.
- Labs Data: Open a worker details modal and switch to the Labs tab to see lab records (auto-refreshed every 30 min + manual refresh).
Documentation MapΒΆ
- Architecture: Core patterns, CQRS, DI, background processing (overview)
- Security: Authentication flows & RBAC (auth flows)
- Real-Time Updates: SSE event stream & UI auto-refresh (see Architecture > Real-Time Updates)
- Worker Monitoring: Metrics, labs refresh, thresholds (worker monitoring)
- Development: Makefile, testing, docs, AI agent guide
- Deployment: Docker & environment setup (docker environment)
graph TD
subgraph "FastAPI Application"
A["Controllers (API Layer)"] --> B["Mediator (Neuroglia)"];
B --> C{"Handlers (Application Layer)"};
C --> C1["Commands (Write)"];
C --> C2["Queries (Read)"];
C1 --> D["Repositories (Data Access)"];
C2 --> D;
D --> E["MongoDB (Persistence)"];
end
π οΈ Technology StackΒΆ
BackendΒΆ
FrontendΒΆ
- Bundler: Parcel
- Templates: Nunjucks
- Styles: Bootstrap 5 + SCSS
- JavaScript: ES6 Modules
InfrastructureΒΆ
- Containers: Docker + Docker Compose
- Observability: OpenTelemetry
- Documentation: MkDocs Material
π€ Roles OverviewΒΆ
| Role | Capabilities |
|---|---|
| User | View workers, metrics, labs data (read-only) |
| Manager | All User capabilities + start/stop workers, update tags |
| Admin | Full lifecycle (create/import, start/stop, terminate), monitoring control |
Real-time updates & labs visibility apply to all roles; action buttons are filtered by role.
π€ ContributingΒΆ
This is a starter app template. When adapting for your project:
Keep the PatternsΒΆ
- β Authentication architecture
- β CQRS structure
- β Dependency injection setup
- β Frontend build pipeline
- β Docker development environment
Customize the DomainΒΆ
- π§ Replace Task entities with your models
- π§ Update UI components and styling
- π§ Configure Keycloak realms and roles
- π§ Adapt database schema
- π§ Add your API endpoints
Extend as NeededΒΆ
- β Additional auth providers
- β More command/query handlers
- β Event sourcing
- β Background jobs
- β API versioning
π Additional ResourcesΒΆ
DocumentationΒΆ
- GitHub Repository
- API Documentation (when running)
- Deployment Guide
External LinksΒΆ
π Real-Time & Background ProcessesΒΆ
- SSE Stream:
/api/events/streampushes worker lifecycle, metrics, labs updates. - Labs Refresh Job: Global recurrent job (
labs-refresh-global) runs every 30 minutes plus once at startup. - Metrics Collection: Poll interval configurable (
worker_metrics_poll_interval). - Status Badge: Workers view displays connection state: connected / reconnecting / disconnected / error.
π Getting HelpΒΆ
- Check Common Issues
- Review relevant documentation section
- Search GitHub Issues
- Create a new issue with details
Ready to start? Head to the Docker Environment guide to get your development environment running!