How 912-burca-olivia/devoops works
Project type and purpose
• This is a full-stack, containerized “MiniTwit” application (a Twitter clone) with a Go-based frontend (“itu-minitwit”), a Go-based REST API (“itu-minitwit-api”), a SQLite database, plus a full logging & monitoring stack (ELK + Prometheus/Grafana). The project uses Docker Compose for local development and testing, Terraform/Ansible for provisioning, and GitHub Actions for CI/CD.
Main components and their roles
a. Frontend Web App (“itu-minitwit”)
• Serves HTML templates, CSS, user registration/login, timeline views.
• Listens on port 8080.
b. Backend API (“itu-minitwit-api”)
• Exposes endpoints for posting tweets, following users, retrieving timelines.
• Manages database schema (schema.sql), and builds metrics (metrics.go) for Prometheus.
• Listens on port 7070.
c. Database (SQLite)
• A file-based DB (minitwit.db in each service) for storing users, follows, messages.
d. Logging pipeline (ELK)
• Filebeat collects logs from the app/API containers.
• Logstash ingests and transforms logs.
• Elasticsearch stores and indexes logs.
• Kibana provides log dashboards.
e. Monitoring stack
• The API exposes Prometheus metrics.
• Prometheus scrapes those metrics.
• Grafana visualizes application and system metrics.
f. Infrastructure & Provisioning
• Terraform (do-terraform) for cloud infra.
• Ansible roles (setup/roles) for installing Beats and Logstash.
• Vagrantfile for local VM setup.
g. CI/CD & Testing
• GitHub Actions workflows automate build, test (unit, e2e, API simulation), Docker image publishing, and releases.
• Docker Compose test configs spin up dependent services for integration tests.
Relationships and data flows
• User’s browser → HTTP requests → Frontend (8080)
• Frontend → REST calls → API (7070)
• API → SQL queries → SQLite DB
• App/API → stdout logs → Filebeat → Logstash → Elasticsearch → Kibana
• API → /metrics endpoint → Prometheus → Grafana
• CI triggers → build & push Docker images → (optional) Terraform deploy
• Docker Compose wires up all containers via an isolated network
Architectural patterns and design principles
• Clear separation of concerns: UI layer vs. API layer vs. data layer
• Container-per-service (“one process per container”)
• Infrastructure as code (Terraform + Ansible)
• Automated testing pipeline in containerized test environments
• Observability: logs centralized in ELK; metrics in Prometheus/Grafana