How johnpapa/shopathome works
Project type and purpose
• This is a full-stack sample “Shop at Home” mono-repo demonstrating four interchangeable frontends (Angular, React, Svelte, Vue) each hosted on Azure Static Web Apps, plus two backend API options (Azure Functions and Fastify REST server deployed to Azure Container Apps).
• Purpose: show how to build, run, and deploy a shopping list application using different JS frameworks and two API hosting models.
File structure
• Top level:
• .github/workflows – CI/CD pipelines for each frontend via Azure Static Web Apps
• .devcontainer, .vscode – local dev environments
• angular-app, react-app, svelte-app, vue-app – four independent frontends, each structured per framework conventions
• api – Azure Functions project (Node.js) under “api” folder
• fastify-api-server – standalone Fastify server project
• Patterns:
• Frontends all share common components: auth login/logout, header, nav, products and discounts pages, staticwebapp.config.json for routing to /api/*
• API projects share data modules in /shared (product-data.js, discount-data.js, models.js)
• Deployment: GitHub Actions workflows push frontends to Azure Static Web Apps; Fastify server containerized and deployed to Azure Container Apps; Functions app runs under the same Static Web App.
Extract README insights
• Describes how to run locally with SWA CLI (frontends + Functions)
• Two backend choices: Azure Functions (in‐repo) or Fastify server (container)
• Hosts frontends at angular.shopathome.dev, react.shopathome.dev, etc.
• API endpoints: /api/products, /api/discounts (GET/POST/PUT/DELETE)
a. Main components (group into layers):
1. Presentation Layer
– Four separate SPA apps (Angular, React, Svelte, Vue)
– Each deployed as Azure Static Web App
2. API Layer
– Azure Functions App (Node.js) under /api
– Fastify Container App (Node.js) under fastify-api-server
3. Data Layer
– In-memory sample data modules (product-data, discount-data)
– Shared models (models.js)
4. DevOps/CICD
– GitHub Actions workflows per frontend
– SWA CLI for local emulation
5. Cloud Infrastructure
– Azure Static Web Apps (hosting SPAs + Functions API)
– Azure Container Apps (hosting Fastify API)
b. Relationships & interactions:
– User browser → (HTTPS) → Static Web App (serves SPA assets)
– SPA makes REST calls to /api/*
– Azure Static Web Apps proxies /api/* calls to either Functions App or Container App endpoint
– API reads/writes data via shared modules (in memory) and returns JSON
c. Architectural patterns / design principles:
– Single-page app frontends with clear separation from backend
– API abstraction layer, RESTful endpoints for product and discount resources
– Mono-repo structure to compare multiple frameworks side by side
– Infrastructure as code via GitHub Actions YAML workflows
d. Key technologies / frameworks:
– Angular CLI, React (Create React App), Svelte (Rollup/Vite), Vue CLI/Vite
– Azure Static Web Apps + SWA CLI
– Azure Functions (JavaScript)
– Fastify (Node.js server framework)
– GitHub Actions for CI/CD