How alvaradoa/employee-application works
Main Components
• App Layer: This is represented by the contents of the “app” directory. It includes:
• app.py (the core Python application logic),
• templates (HTML pages such as about.html, addemp.html, etc.),
• static assets (files in the static folder),
• Dockerfile (for containerizing the application).
• Database Layer: Found in the “db” directory. It contains:
• MySQL schema (mysql.sql),
• Dockerfile (to build the MySQL container),
• Additional README for configuration.
• Orchestration & Deployment: The “manifest” directory contains Kubernetes YAML files for various resources (applications, services, config maps, secrets, PVCs, HPA configurations, etc.) and other deployment-related documentation. The docker-compose.yml file gives an overview on local multi-container practices.
• CI/CD Pipeline: The README mentions GitHub Actions for automatically building and pushing Docker images to Amazon ECR and deploying them to an Amazon EKS cluster.
File Structure & Architecturally Relevant Details
• The separation of “app” and “db” directories indicates a two-tier separation (web application and database).
• The “manifest” directory contains individual YAML definitions for Kubernetes components such as:
• Deployment descriptors (app.yaml, db.yaml) – representing pods or microservice deployments.
• Service and Ingress definitions – managing external accessibility.
• Persistent Volume Claims (app_pvc.yaml) – showing that storage persistence is managed.
• ConfigMaps and Secrets – emphasizing configuration and security management.
• The presence of a docker-compose.yml file implies local multi-container orchestration before transition to a full Kubernetes environment.
• Multiple README and documentation files across directories provide deployment instructions, further clarifying the architectural intent.
Construction
a. Main Components to Represent:
• Frontend/User Interface: Represent HTML templates and static files as part of the user interface hosted by the web server.
• Backend/Application Server: Represent this as the container encapsulated by the “app” directory which handles business logic.
• Database: Represent the MySQL database (from the “db” directory).
• Container Orchestration: Represent Kubernetes with the various resources (deployments, pods, services, PVCs, etc.) indicated by the “manifest” files.
• CI/CD Pipeline: Represent GitHub Actions and Amazon ECR as part of the automated build, test, and deploy cycle.
• Cloud Infrastructure: Represent Amazon EKS (for deployment), and note where cost, high availability, and scalability considerations come in.
b. Relationships and Interactions:
• How the CI/CD pipeline triggers new Docker image builds and pushes them to ECR, which then triggers deployments on the Kubernetes cluster.
c. Architectural Patterns & Principles:
• Containerization: Use Docker to encapsulate both the web application and database.
• Separation of Concerns: Clearly separate the web server (application logic and UI) from the database and infrastructure management.
• Declarative Infrastructure: The use of Kubernetes manifests illustrates Infrastructure as Code (IaC).
• Scalability and Availability: Include elements such as HPA (Horizontal Pod Autoscaling) and persistent storage from the manifest files.
d. Technologies, Frameworks, and Tools:
• Python (for app.py),
• Docker (for containerization),
• Kubernetes/EKS (for orchestration),
• MySQL (as the database),
• GitHub Actions (for CI/CD),
• Amazon ECR (for container registry),
• Docker Compose (local orchestration),
• And supporting files like ConfigMaps, Secrets which detail configuration and security management.