How alessok/devops-proyecto-final works
Project Type and Purpose
• This is a full-stack web application comprising:
• A React/TypeScript frontend served by Nginx
• A Node.js/Express/TypeScript backend
• A PostgreSQL database with Flyway migrations
• CI/CD pipeline (Jenkins + GitHub Actions)
• Containerized deployment (Docker, docker-compose, Kubernetes)
• Monitoring (Prometheus + Grafana)
• The app appears to be an inventory management or CRUD admin system (categories, products, users).
File Structure Analysis
• Top-level “src” directory splits into “frontend” & “backend” subprojects, each with its own Dockerfile, package.json, tsconfig.
• “database” holds Flyway config & SQL migrations.
• “infrastructure/kubernetes” contains K8s manifests for namespace, backend, frontend, and Postgres.
• “docker-compose.yml” orchestrates local dev services (frontend, backend, Postgres).
• “.github/workflows/ci-cd.yml”, “Jenkinsfile”, and related scripts outline the CI/CD flow.
• “monitoring” directory defines Prometheus configs, alerting rules, and Grafana dashboards.
• “tests” holds API collection tests, end-to-end tests, integration scripts, and performance tests.
README Insights
• The README is a timestamp stub for Jenkins sync; no architecture details here.
• We infer tech stack and deployment patterns solely from file structure.
Main Components
a. Client Layer
• Web Browser/Mobile → React Frontend (served by Nginx)
b. Presentation/API Layer
• Frontend Container → REST API calls → Backend Container (Node/Express)
c. Data Layer
• Backend → Flyway-managed PostgreSQL
d. CI/CD Pipeline
• GitHub → GitHub Actions + Jenkins → Build & Test → Docker Registry → K8s Deployment
e. Infrastructure/Orchestration
• Kubernetes Cluster:
• Frontend Pod(s)
• Backend Pod(s)
• Postgres Pod
• ConfigMaps/Secrets
• docker-compose (dev/local)
f. Monitoring & Logging
• Prometheus scrapes metrics from backend & Kubernetes
• Alertmanager rules (Prometheus alerts)
Relationships & Interactions
• User’s browser ↔ HTTP(S) ↔ Nginx (frontend) ↔ JavaScript app ↔ HTTP REST ↔ Express server
• Express server ↔ SQL queries ↔ Postgres
• CI/CD triggers on commit → runs tests (unit, E2E, performance) → builds Docker images → pushes to registry → deploys to K8s
• K8s liveness/readiness health checks ensure pods are healthy
• Prometheus scrapes:
• /metrics endpoint on backend
• K8s API
Grafana reads from Prometheus → dashboards & alerts
Architectural Patterns & Principles
• Layered architecture: presentation (frontend), application (backend), data (DB).
• Micro-layer separation: distinct containers for each service.
• Infrastructure as Code: K8s manifests, docker-compose, Flyway migrations.
• Continuous Delivery: automated CI/CD pipelines.
• Observability: metrics, dashboards, alerting.
Technologies & Libraries
• Frontend: React, TypeScript, React-Router, Context API
• Backend: Node.js, Express, TypeScript, Jest tests, ESLint, Flyway, pg library
• Database: PostgreSQL
• CI/CD: Jenkins, GitHub Actions, sonar-scanner, Groovy init script
• Containerization: Docker, docker-compose, Kubernetes
• Monitoring: Prometheus, Grafana
• Testing: Jest, Supertest (API tests), Playwright or similar for E2E, Artillery for performance