How dm-chelupati/grubify works
Purpose and Entry Points
Grubify is a containerized food-delivery demo: a React single-page frontend drives a .NET 9 REST API for restaurant browsing, cart management, checkout, and order tracking. Runtime entry points are GrubifyApi/Program.cs for the API and grubify-frontend/src/index.tsx for the browser app. Azure Developer CLI deployment is defined by azure.yaml.
Frontend Application
The React 18/TypeScript client composes the delivery flow from page-level views: discovery, restaurant menus, cart, checkout, and tracking. Routing/application composition is centralized in grubify-frontend/src/App.tsx; page stages reside under grubify-frontend/src/pages/HomePage.tsx, grubify-frontend/src/pages/CheckoutPage.tsx, and grubify-frontend/src/pages/OrderTrackingPage.tsx. Shared navigation is in grubify-frontend/src/components/Navbar.tsx.
Frontend-to-API Boundary
Browser-side API access is centralized in grubify-frontend/src/services/api.ts, with shared client-side domain types in grubify-frontend/src/types/index.ts. This is the principal integration boundary: UI pages should consume the service layer rather than directly coupling to backend routes. The production frontend is containerized and served through Nginx via grubify-frontend/Dockerfile and grubify-frontend/nginx.conf.
API Host and HTTP Surface
The ASP.NET Core Web API host configures the HTTP pipeline and service startup in GrubifyApi/Program.cs. Controllers expose resource-oriented endpoints for the delivery workflow: restaurants and menus in GrubifyApi/Controllers/RestaurantsController.cs and GrubifyApi/Controllers/FoodItemsController.cs; carts and orders in GrubifyApi/Controllers/CartController.cs and GrubifyApi/Controllers/OrdersController.cs. WeatherForecastController.cs is a template/diagnostic-style endpoint, not part of the delivery domain.
Domain State and Workflow
Core API data contracts are Restaurant, FoodItem, Cart, and Order under GrubifyApi/Models/Restaurant.cs, GrubifyApi/Models/Cart.cs, and GrubifyApi/Models/Order.cs. The primary flow is: retrieve restaurants/items, construct or update cart state, create an order during checkout, then retrieve order status for tracking. No persistence layer, database project, or external payment provider is represented in the supplied tree; model/controller behavior is therefore the effective application-state boundary.
Container and Azure Deployment
Both application tiers build as separate images using GrubifyApi/Dockerfile and grubify-frontend/Dockerfile. Azure infrastructure is provisioned with Bicep: infra/main.bicep coordinates resources, while infra/core/host/container-registry.bicep and infra/core/host/container-app.bicep define image registry and Container Apps hosting. The target platform includes Azure Container Registry, Azure Container Apps, and a Container Apps Environment; the README also identifies Log Analytics as deployed observability infrastructure.
Operations and Automation
The repo is designed for Azure SRE-agent investigation scenarios, including stated memory-leak and payment-failure testing goals. GitHub Actions automation is defined in .github/workflows/sre-agent-investigate.yml. Deployment requires Docker for image builds plus Azure Developer CLI and Azure CLI; the prerequisite validation entry point is scripts/check-prerequisites.sh.
Main entry points: Program.cs API host · container-app.bicep Container Apps · container-registry.bicep Container Registry · main.bicep Infrastructure
Components 18
Frontend
- Browser user
- React entry
grubify-frontend/src/index.tsx - App routing
grubify-frontend/src/App.tsx - Delivery pages · Discovery, checkout, and order tracking views.
grubify-frontend/src/pages/HomePage.tsx - API service · Principal browser-to-API integration boundary.
grubify-frontend/src/services/api.ts - Frontend image
grubify-frontend/Dockerfile
Delivery API
- API host · Configures HTTP pipeline and service startup.
GrubifyApi/Program.cs - Catalog endpoints · Restaurant and menu resources.
GrubifyApi/Controllers/RestaurantsController.cs - Cart endpoints
GrubifyApi/Controllers/CartController.cs - Order endpoints · Checkout creation and order-status retrieval.
GrubifyApi/Controllers/OrdersController.cs - Delivery state · Restaurant, food item, cart, and order contracts form the effective state boundary.
GrubifyApi/Models/Order.cs - API image
GrubifyApi/Dockerfile
Azure deployment
- AZD deployment
azure.yaml - Infrastructure · Coordinates Azure resources.
infra/main.bicep - Container Registry
infra/core/host/container-registry.bicep - Container Apps · Hosts frontend and API containers in a Container Apps Environment.
infra/core/host/container-app.bicep
Operations
- SRE investigation · Automation for Azure SRE-agent investigation scenarios.
.github/workflows/sre-agent-investigate.yml - Prerequisite check · Validates Docker, Azure Developer CLI, and Azure CLI prerequisites.
scripts/check-prerequisites.sh
Connections 21
- Browser user → React entry: loads
- React entry → App routing: boots
- App routing → Delivery pages: routes to
- Delivery pages → API service: uses
- API service → API host: REST requests
- API host → Catalog endpoints: routes catalog
- API host → Cart endpoints: routes cart
- API host → Order endpoints: routes orders
- Catalog endpoints → Delivery state: reads catalog
- Cart endpoints → Delivery state: updates cart
- Order endpoints → Delivery state: creates and tracks orders
- Frontend image → Container Registry: publishes image
- API image → Container Registry: publishes image
- Container Registry → Container Apps: supplies images
- Container Apps → Frontend image: runs
- Container Apps → API image: runs
- AZD deployment → Infrastructure: provisions
- Infrastructure → Container Registry: creates
- Infrastructure → Container Apps: creates
- SRE investigation → AZD deployment: investigates deployed system
- Prerequisite check → AZD deployment: validates tooling