How rabbii96/mega works
1. This repository is a full-stack MERN application with a delivery platform built around Docker, Jenkins, GitOps, and Kubernetes on AWS EKS. The application itself is a simple product-management domain, but the repo is equally about the deployment pipeline and cluster operations around it.
2. The core request/response path is: browser UI in the frontend sends HTTP calls through an Axios wrapper to the backend API, the backend reads/writes product data in MongoDB, and responses are rendered back in the React UI. That is the main data flow you would diagram.
3. The backend lives in backend/ and is organized as a small Express-style API with clear layers: routes/ defines endpoints, controllers/ contains request handlers, models/ defines the product schema, and config/ holds database connection and utility code. server.mjs is the entrypoint, and the use of .mjs indicates ES modules.
4. The backend domain is centered on products only. Files like controllers/productController.mjs, models/product.mjs, and routes/productRoutes.mjs show CRUD-style product operations rather than a broad multi-domain service.
5. The frontend lives in frontend/ and is a Vite-based React app. The main screens are ProductPage.jsx and ProductForm.jsx, with ProductCard.jsx as a reusable view component. Routing is handled under frontend/src/routes/, and frontend/src/axios/invAxios.js is the API client boundary to the backend.
6. Frontend configuration suggests environment-specific API endpoints via frontend/src/config/index.js and .env.docker. This implies the UI is meant to run both locally and in containers, with the backend URL injected per environment.
7. MongoDB is treated as a separate infrastructure component rather than an embedded dependency. The repo includes kubernetes/mongodb.yaml, persistent volume and claim manifests, and database/ with a Dockerfile plus db-setup.sh, indicating the database can be provisioned in cluster with durable storage.
8. Containerization is first-class. Both frontend/ and backend/ have Dockerfiles, and there is a top-level docker-compose.yml for local multi-container execution. That means the app can run as a 3-tier stack: frontend container, backend container, and MongoDB container.
9. Kubernetes deployment is defined in kubernetes/ with separate manifests for frontend, backend, MongoDB, and storage. The README shows the app is exposed through NodePort services, with frontend and backend assigned fixed external ports, so the cluster boundary is intentionally public-facing through worker nodes.
10. GitOps is the CD model. GitOps/Jenkinsfile and the ArgoCD setup in the README indicate Jenkins builds artifacts and then updates Kubernetes manifests in Git, while ArgoCD watches the repo and syncs the cluster from the kubernetes/ directory. In other words, Git is the source of truth for deployment state.
11. Jenkins is the main CI orchestrator. The repo contains a root Jenkinsfile for CI and a separate GitOps pipeline file under GitOps/. The pipelines are designed to run scans and quality gates, then build container images and push them to the registry before CD takes over.
12. The supply-chain/security tooling is built into the delivery flow: OWASP Dependency-Check, SonarQube, and Trivy are all called out in the README and wired into Jenkins. SonarQube handles code-quality analysis, OWASP handles dependency vulnerability checks, and Trivy scans the filesystem/image content.
13. The AWS infrastructure layer is split between cluster provisioning and node provisioning. terraform/ contains EC2-related infrastructure code, while the README describes EKS creation via eksctl and then cluster access through Jenkins/master EC2. So Terraform supports base infrastructure, but EKS is the actual runtime platform for the app.
14. Operational automation is in Automations/, with scripts for updating frontend and backend deployment values before CI/CD runs. Those scripts appear to inject the current worker-node instance ID, which suggests the app’s exposed endpoints or deployment manifests depend on the target node address.
15. Monitoring is layered on top of the cluster using Helm-installed Prometheus and Grafana. This is not part of the application code path, but it is part of the production architecture: app pods emit metrics to the monitoring stack running in the same EKS environment.
16. Overall boundary map: React UI at the edge, Express/Mongo backend in the application tier, Kubernetes as the runtime boundary, Jenkins as build/scan/orchestration, ArgoCD as deployment reconciler, and AWS EKS/EC2/Terraform as infrastructure. The diagram should emphasize that the repo is not just an app—it is an app plus a full CI/CD and GitOps delivery system.
Main entry points: Jenkinsfile CI pipeline · ProductPage.jsx Product page · invAxios.js API client · frontend.yaml K8s manifests
Components 26
Frontend
Vite + React UI and API client boundary
- React app · Browser-facing product management interface
frontend/src/App.jsx - Product page · Main product listing and interaction screen
frontend/src/pages/ProductPage.jsx - Product form · Create/edit product form
frontend/src/pages/ProductForm.jsx - Product card · Reusable product presentation component
frontend/src/components/ProductCard.jsx - API client · HTTP boundary to the backend API
frontend/src/axios/invAxios.js - Routes · Frontend route wiring
frontend/src/routes/index.jsx - Env config · Environment-specific frontend endpoint settings
frontend/src/config/index.js
Backend
Express API and product domain
- Server · Backend process bootstrap and HTTP server
backend/server.mjs - Routes · Maps product endpoints to controllers
backend/routes/productRoutes.mjs - Controller · Product CRUD request handling
backend/controllers/productController.mjs - Product model · Product data schema and persistence model
backend/models/product.mjs - DB config · MongoDB connection utilities
backend/config/db.mjs
Data
MongoDB and durable storage
Delivery
CI/CD, GitOps, and automation
- Compose · Three-container local runtime composition
docker-compose.yml - Backend image · Backend container definition
backend/Dockerfile - Frontend image · Frontend container definition
frontend/Dockerfile - DB image · MongoDB initialization container definition
database/Dockerfile - CI pipeline · Primary CI pipeline for build, scan, and publish
Jenkinsfile - GitOps pipeline · Pipeline that updates deployment state in Git
GitOps/Jenkinsfile - Automation scripts · Deployment value update scripts used before CI/CD
Automations/updatefrontendnew.sh
Infrastructure
Kubernetes, cloud, and provisioning
- K8s manifests · Frontend, backend, MongoDB, and storage manifests
kubernetes/frontend.yaml - EKS cluster · Kubernetes runtime boundary on AWS EKS
README.md - Terraform · Base AWS infrastructure provisioning
terraform/ec2.tf - ArgoCD · Synchronizes cluster state from Git
README.md - Monitoring · Cluster metrics and dashboards
README.md
Connections 27
- React app → Routes: uses · Application shell is routed into screens
- Routes → Product page: loads · Primary product screen is routed
- Product page → Product form: opens · Create/edit actions open the form
- Product page → Product card: renders · Product list uses reusable cards
- Product page → API client: calls API · Screen issues backend requests through client wrapper
- Product form → API client: calls API · Form submits product mutations through client wrapper
- API client → Env config: reads · API base URL comes from environment config
- API client → Server: HTTP · Frontend talks to backend server endpoints
- Server → Routes: registers · Server mounts product route handlers
- Routes → Controller: dispatches · Route handlers delegate to controller logic
- Controller → Product model: uses · Controller persists and queries product records
- Product model → DB config: connects via · Model operations depend on Mongo connection setup
- DB config → MongoDB: connects · Backend connects to MongoDB service
- MongoDB → Storage: stores on · MongoDB data is backed by durable storage
- Compose → Frontend image: builds · Local stack includes the frontend container
- Compose → Backend image: builds · Local stack includes the backend container
- Compose → DB image: builds · Local stack includes the database container
- CI pipeline → Backend image: builds · CI builds backend image
- CI pipeline → Frontend image: builds · CI builds frontend image
- CI pipeline → Automation scripts: uses · Pipelines incorporate deployment update scripts
- CI pipeline → K8s manifests: publishes · CI produces deployable image and manifest changes
- GitOps pipeline → K8s manifests: updates · GitOps pipeline writes desired cluster state
- ArgoCD → K8s manifests: syncs · ArgoCD watches manifests as source of truth
- K8s manifests → EKS cluster: runs on · Manifests are applied to the EKS runtime
- Terraform → EKS cluster: provisions base · Terraform supports underlying AWS infrastructure
- EKS cluster → Monitoring: hosts · Cluster also runs metrics and dashboards
- CI pipeline → ArgoCD: hands off to · Git-based deployment is reconciled after CI