A professional simulation and monitoring system for NASA space missions
- About
- Features
- Installation
- Usage
- Dashboard
- Architecture
- Testing
- Configuration
- Security
- Contributing
- License
Apollo 11 is a comprehensive simulation and monitoring system designed for NASA space missions. Built with modern Python practices, it provides real-time telemetry data generation, analysis, and reporting capabilities with a beautiful terminal user interface.
Developed as part of the Softserve Python Bootcamp Challenge, this project demonstrates advanced Python concepts including:
- ποΈ Object-oriented programming with classes and inheritance
- π File I/O operations and directory management
- βοΈ Configuration management with YAML
- π§ͺ Comprehensive testing (unit tests + property-based testing)
- π₯οΈ CLI interface with argument parsing
- π Real-time dashboard with Rich library
- π Web dashboard with FastAPI and auto-refresh
- βΈοΈ Kubernetes deployment with Ingress and RabbitMQ
The system simulates real-world scenarios where multiple devices across different space missions generate telemetry data that needs to be collected, analyzed, and reported in real-time.
Apollo 11 provides a complete suite of tools for space mission monitoring:
- π Data Generator: Creates realistic simulated log files for different missions and devices
- π Report Analyzer: Processes logs and generates comprehensive device status statistics
- πΎ Backup Management: Automatically archives processed data with intelligent folder handling
- π₯οΈ TUI Dashboard: Beautiful terminal interface for real-time monitoring using Rich library
- π Web Dashboard: FastAPI web dashboard with JSON API, HTML interface, and Swagger docs
- Real-time Monitoring: Live updates of system status and mission statistics
- Web Dashboard: Auto-refreshing web UI with REST API and Swagger documentation
- Property-based Testing: Robust validation using Hypothesis framework
- Centralized Logging: Configurable logging system across all modules
- High Test Coverage: 96% test coverage with 88 comprehensive tests
- Professional CLI: Full argument parsing with validation and help system
- Kubernetes Support: Ready-to-deploy manifests for Docker Desktop
- Python 3.10+ - Download here
- Poetry - Installation guide
# 1. Clone the repository
git clone git@github.com:JoseJulianMosqueraFuli/apolo-11.git
cd apolo-11
# 2. Install dependencies
poetry install
# 3. Run with dashboard (recommended)
poetry run apolo --dashboard# Build and run with RabbitMQ
docker compose up --build# Run tests to verify everything works
poetry run pytest --cov=apolo_11 -v# Default configuration
poetry run apolo
# Custom parameters
poetry run apolo --num_files_min 1 --num_files_max 100 --generator_interval 5 --reporter_interval 15
# Enable dashboard for real-time monitoring (recommended)
poetry run apolo --dashboard| Parameter | Default | Description |
|---|---|---|
--num_files_min |
1 | Minimum number of log files to generate per cycle |
--num_files_max |
100 | Maximum number of log files to generate per cycle |
--generator_interval |
20 | Time in seconds between each file generation cycle |
--reporter_interval |
60 | Time in seconds between each report generation cycle |
--dashboard |
False | Enable TUI dashboard for real-time monitoring |
--api |
False | Enable web API dashboard (FastAPI) |
--api-port |
8000 | Port for the web API dashboard |
β οΈ Important: The reporter interval must be greater than the generator interval to prevent data accumulation.
The system features a beautiful Terminal User Interface (TUI) dashboard built with the Rich library for real-time monitoring:
- π Files Generated: Total log files created in current session
- π Current Cycle: Active generation cycle number
- β° Last Report: Timestamp of most recent statistical report
- π Mission Names: Active space missions (GalaxyTwo, ColonyMoon, VacMars, etc.)
- π§ Device Types: Device categories per mission (Rover, Equipment, Sensor, etc.)
- π Device Counts: Total devices per mission
- β Status Summary: Device status distribution (operational, excellent, unknown, etc.)
- β‘ Auto-refresh: Updates every second automatically
- π‘ Live Data: Direct feed from generator and reporter components
- π¨ Clean Layout: Professional interface using Rich library
- β¨οΈ Easy Exit: Press
Ctrl+Cto exit gracefully
# Recommended settings for optimal dashboard experience
poetry run apolo --dashboard --generator_interval 3 --reporter_interval 10
# Enable web dashboard (also works alongside TUI)
poetry run apolo --api --api-port 8000
# Both together
poetry run apolo --dashboard --api --generator_interval 3 --reporter_interval 10The system includes a modern web dashboard built with FastAPI for browser-based monitoring:
| Endpoint | Description |
|---|---|
GET / |
HTML dashboard with auto-refresh (every 3s) |
GET /api/stats |
JSON API with real-time system and mission stats |
GET /docs |
Swagger UI for API exploration |
# Enable the web dashboard
poetry run apolo --api --generator_interval 3 --reporter_interval 10
# Open in browser
open http://localhost:8000The web dashboard displays the same real-time information as the TUI dashboard:
- π Files Generated: Total log files created in current session
- π Current Cycle: Active generation cycle number
- β° Last Report: Timestamp of most recent statistical report
- π Mission Statistics: Per-mission device counts and status breakdowns with color-coded badges
- β‘ Auto-refresh: Updates every 3 seconds via JavaScript fetch API
- π‘ REST API: Machine-readable JSON at
/api/statsfor external integrations
The system follows a modular architecture with clear separation of concerns:
apolo-11/
βββ π apolo_11/
β βββ π config/
β β βββ π config.yaml # System configuration
β βββ π src/
β β βββ π classes.py # Mission and Device classes
β β βββ π cli.py # Async CLI entry point
β β βββ π config.py # ConfigManager
β β βββ π dashboard.py # TUI Dashboard with Rich
β βββ π web_dashboard.py # Web Dashboard with FastAPI
β β βββ π generator.py # Log generator
β β βββ π logging_config.py # Centralized logging
β β βββ π messaging.py # RabbitMQ message broker
β β βββ π reporter.py # Report processor
β βββ π results/ # Generated data (backups, reports)
βββ π tests/
β βββ π tests_src/ # Unit and property tests (65+)
βββ π docs/
β βββ π images/ # Diagrams and visual documentation
βββ π main.py # Backward-compatible entry point
βββ π k8s/ # Kubernetes manifests
β βββ π apolo-configmap.yaml
β βββ π apolo-deployment.yaml
β βββ π apolo-pvc.yaml
β βββ π apolo-service.yaml
β βββ π rabbitmq-ingress.yaml
β βββ π rabbitmq-service.yaml
β βββ π rabbitmq-statefulset.yaml
β βββ π README.md
βββ π Dockerfile # Docker image build
βββ π docker-compose.yml # Multi-service orchestration
βββ π pyproject.toml # Project dependencies
The project maintains high code quality with comprehensive testing:
- β 88 Tests Passing: All tests pass consistently
- π 96% Coverage: Excellent test coverage across all modules
- π¬ Property-Based Testing: Using Hypothesis for robust validation
- π§ͺ Unit Testing: Comprehensive unit tests for all components
# Run all tests with coverage report
poetry run pytest --cov=apolo_11 --cov-report=term-missing --cov-report=html
# Run tests in verbose mode
poetry run pytest -v
# Run specific test file
poetry run pytest tests/tests_src/test_dashboard.py -v
# Generate HTML coverage report
poetry run pytest --cov=apolo_11 --cov-report=html
# Open htmlcov/index.html in browser- Unit Tests: Test individual components and functions
- Property-Based Tests: Test universal properties using Hypothesis
- Integration Tests: Test component interactions
- Edge Case Tests: Test error conditions and boundary cases
The system is highly configurable through the apolo_11/config/config.yaml file:
# Mission definitions
missions:
codes:
OrbitOne: ORBONE
GalaxyTwo: GALXTWO
names:
- OrbitOne
- GalaxyTwo
# Device specifications
devices:
types:
- Satellite
- Rover
status:
- excellent
- good
- warning
# System settings
general:
num_files_initial: 1
num_files_final: 100
time_cycle: 20
# Logging configuration
logging:
level: INFO
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
# Directory paths
routes:
results: ./apolo_11/results
devices: ./apolo_11/results/devices
backups: ./apolo_11/results/backups/
reports: ./apolo_11/results/reports/- Missions: Add new space missions and their codes
- Devices: Define device types and status options
- Logging: Configure log levels and formats
- Paths: Customize directory structure
- Intervals: Set generation and reporting frequencies
- Timing Constraints: Reporter interval must exceed generator interval to prevent data accumulation
- Concurrency: No support for multiple simultaneous instances accessing the same log files
- Error Handling: Basic error handling for malformed log files may need enhancement
- Resource Usage: Large datasets may require additional memory optimization
Deploy to any Kubernetes cluster (tested on Docker Desktop & Kind):
# Deploy everything
kubectl apply -f k8s/
# Watch pods
kubectl get pods -w| Resource | Description |
|---|---|
rabbitmq |
StatefulSet + Service (AMQP 5672, Mgmt 15672) |
apolo-11 |
Deployment with TUI + Web dashboard (port 8000) |
apolo-config |
ConfigMap mounted at /app/apolo_11/config/ |
apolo-results |
PVC for persistent mission data |
apolo-ingress |
Ingress for apolo.local and rabbitmq.local |
# Web dashboard
kubectl port-forward svc/apolo-11 8000:8000
# Open http://localhost:8000
# RabbitMQ management
kubectl port-forward svc/rabbitmq 15672:15672
# Open http://localhost:15672 (guest/guest)
# View logs
kubectl logs -l app=apolo-11 -fSee k8s/README.md for full instructions.
docker build -t apolo-11 .
docker run --rm apolo-11 --dashboard --api --generator_interval 3 --reporter_interval 10Mount a volume to persist results:
docker run --rm -v $(pwd)/results:/app/apolo_11/results -p 8000:8000 apolo-11 --api --generator_interval 3 --reporter_interval 10docker compose up --buildStarts two services:
| Service | Image | Ports |
|---|---|---|
rabbitmq |
rabbitmq:3-management |
5672 (AMQP) |
15672 (Management) |
||
apolo-11 |
(built from Dockerfile) |
β |
The management UI is available at http://localhost:15672 (guest/guest).
| Variable | Default | Description |
|---|---|---|
RABBITMQ_HOST |
β | RabbitMQ host. Unset = no messaging |
When RABBITMQ_HOST is set, the generator publishes events to the apolo.generated topic exchange after each cycle:
{
"cycle": 5,
"files_count": 50,
"num_files_min": 1,
"num_files_max": 10,
"timestamp": "2026-05-14 20:00:00"
}External consumers can subscribe to apolo.generated for real-time monitoring, dashboards, or archiving. The system works with full functionality when RabbitMQ is not available β messaging is optional and zero-overhead when disabled.
- β Web Dashboard: FastAPI with auto-refresh HTML, JSON API, and Swagger docs
- β Kubernetes: Service + Ingress for web dashboard and RabbitMQ
- β CI Manifest Validation: Kubeconform validates all k8s manifests in CI
- β Architecture: Eliminated side-effect imports β no IO at module load time
- β Dependency Injection: All components accept optional config, testable without mocks
- β Config Stability: Routes changed from fragile list indices to dict keys
- β Package Safety: State file moved out of package source to results directory
- β
CLI Entry Point:
apolocommand works afterpip install(no morepython main.py) - β CI/CD: GitHub Actions with matrix testing across Python 3.10β3.12
- β Security: Patched pytest (CVE-2024-11305) and Pygments (CVE-2024-43791)
- β Logging: No longer stomps on root logger β safe as a library
- β SIGTERM Handling: Graceful shutdown on kill signal
- π Future: Web dashboard with WebSocket real-time updates
See SECURITY.md for the planned security hardening roadmap, including:
- π‘οΈ Running containers as non-root
- π RabbitMQ credentials in Kubernetes Secrets
- π Resource limits and probes
- π Container image vulnerability scanning
- π§ Network policies and PodDisruptionBudget
Contributions to improve security are welcome!
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone git@github.com:yourusername/apolo-11.git
cd apolo-11
# Install development dependencies
poetry install
# Run tests before committing
poetry run pytest --cov=apolo_11 --cov-fail-under=95
# Run linting
poetry run flake8 apolo_11/This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by:
π Alejandra Quiroz GΓ³mez β’ Sara Palacio β’ Jose Julian Mosquera Fuli
Softserve Python Bootcamp Challenge
β Star this repository if you found it helpful!
π Report Bug β’ β¨ Request Feature β’ π Documentation



