How dissouri001/shop works
Souk is a small React storefront backed by an Express API and PostgreSQL. A shopper views the product catalogue, adds items to a cart, and submits an email and order; the API checks stock, calculates the total, and records the order transactionally. The API also exposes health and Prometheus metrics endpoints. The README documents Kubernetes deployment and Terraform cluster provisioning. Source excerpts show the application and database calls; deployment and monitoring links are limited to documented relationships because their configuration files were not sampled.
Main entry points: app.js Catalogue and checkout · App.jsx Storefront and cart · k8s Kubernetes deployment · index.js API server
Components 13
Storefront
- Storefront and cart
frontend/src/App.jsx - React bootstrap
frontend/src/main.jsx
Commerce API
- API server
backend/src/index.js - Catalogue and checkout
backend/src/app.js - PostgreSQL
- Database schema
db/init.sql
Operations
- Health and metrics
backend/src/app.js - Prometheus config
monitoring/prometheus.yml - Prometheus
- Grafana
- Cluster provisioning
terraform/main.tf - Kubernetes deployment
k8s
Other components
- Shopper
Connections 13
- Shopper → Storefront and cart: uses
frontend/src/App.jsx - React bootstrap → Storefront and cart: renders
frontend/src/main.jsx - Storefront and cart → Catalogue and checkout: requests catalogue and orders
frontend/src/App.jsx - API server → Catalogue and checkout: creates app
backend/src/index.js - Catalogue and checkout → PostgreSQL: queries and updates
backend/src/app.js - Database schema → PostgreSQL: initializes schema
README.md - Catalogue and checkout → Health and metrics: exposes endpoints
backend/src/app.js - Prometheus → Health and metrics: scrapes metrics
- Prometheus config → Prometheus: configures
- Prometheus → Grafana: visualizes monitoring
README.md - Cluster provisioning → Kubernetes deployment: provisions cluster
README.md - Kubernetes deployment → API server: deploys API
README.md - Kubernetes deployment → Storefront and cart: deploys storefront
README.md