A complete DevOps project example: from code to a working service with tests, containerization, deployment, and basic observability. The project demonstrates modern development and DevOps practices, including test automation, monitoring, logging, and metrics visualization.
The project structure is as follows:
devops-demo/
├── backend/ # Backend service
│ ├── app/ # FastAPI application
│ ├── alembic/ # Database migrations
│ ├── tests/ # Backend tests
│ ├── Dockerfile # Production Dockerfile
│ └── pyproject.toml # Python dependencies and configuration
│
├── docs/ # Documentation
│
├── frontend/ # Frontend application
│ ├── src/ # React components
│ ├── public/ # Static files
│ ├── Dockerfile # Production Dockerfile
│ ├── package.json # Node.js dependencies
│ └── vite.config.js # Vite configuration
│
├── observability/ # Observability configuration
│ ├── prometheus.yml # Prometheus configuration
│ ├── prometheus_slo_rules.yml # SLO rules
│ ├── grafana/ # Grafana configuration
│ │ ├── dashboards/ # JSON dashboards
│ │ ├── provisioning/ # Automatic configuration
│ │ └── grafana.ini # Grafana settings
│ ├── loki/ # Loki configuration
│ └── alloy/ # Grafana Alloy configuration
│
├── docker-compose.yml # Main Docker Compose configuration
├── Makefile # Convenience commands
└── README.md # This file
The project contains detailed documentation for various aspects of development and usage:
- Prerequisites - Required knowledge and skills for working with the project, recommended learning resources
- Local setup - Local development environment setup, dependency installation, Docker configuration, and troubleshooting common issues
- Running tests - Detailed guide on running tests, including unit and integration tests for backend and frontend
- Contributing - Contribution guidelines, code standards, code review process, and best practices
- Docker version 24 or newer
- Docker Compose version 2.24 or newer
- Make version 3.81 or newer
- Minimum 2GB free RAM
- Minimum 3GB free disk space
-
Start everything
make up
-
Seed initial data (could be done multiple times)
make seed
After successful startup, all services will be available at the following URLs:
| Service | URL | Credentials | Description |
|---|---|---|---|
| Frontend | http://localhost:8080 | - | React application with CRUD interface for managing items |
| API | http://localhost:8000 | - | FastAPI REST API server |
| API Documentation | http://localhost:8000/docs | - | Swagger UI with interactive API documentation |
| ReDoc | http://localhost:8000/redoc | - | Alternative API documentation in ReDoc format |
| Grafana | http://localhost:3000 | admin/admin | Dashboards for metrics and logs visualization |
| Prometheus | http://localhost:9090 | - | UI for viewing and querying metrics |
| Loki | http://localhost:3100 | - | API for accessing logs |
| Postgres Exporter | http://localhost:9187 | - | PostgreSQL metrics in Prometheus format |
| cAdvisor | http://localhost:8081 | - | Container and resource metrics |
Notes:
-
On first login to Grafana, the system will prompt you to change the administrator password. For development environments, this can be skipped.
-
Detailed interactive API documentation is available via Swagger UI at http://localhost:8000/docs or via ReDoc at http://localhost:8000/redoc.
-
For a complete list of available convenience make targets, run:
make help
For more detailed information, please refer to local setup.
See the architecture overview for detailed information.
See the observability overview for detailed information.
See the data overview for detailed information.
See the troubleshooting guide for common issues and solutions.
The project can be used for:
- Demonstrating DevOps practices with practical examples
- Practical classes on containerization and orchestration
- Learning observability and monitoring
- Practice with CI/CD and automation
- Understanding production-ready code and architecture
See homework assignments with various difficulty levels for students.
This project is intended for educational purposes and licensed under the MIT License - see the LICENSE file for details.