How azure-samples/contoso-real-estate works
Project type and purpose
• This is a monorepo JavaScript reference architecture for a cloud‑native real estate application showcasing micro‑frontends and microservices on Azure. It includes:
• Frontends: Angular “portal”, Next.js “blog”
• Headless CMS: Strapi (“blog‑cms”)
• Backend services: Azure Functions (“api”), Fastify Stripe webhook (“stripe”), real‑time notifications (“notifications”)
• E2E and developer docs (“testing”, “docs”)
• Infrastructure defined in Bicep under infra/
File structure
• Top‑level:
• .azdo/, .github/, infra/ for pipelines and Bicep modules
• packages/ as npm workspaces containing each service or app
• assets/, docs/, scripts/
• Each packages/* folder follows a clear pattern: code, configuration, environment samples, Dockerfiles or function.json
• infra/ subdivided into core/ modules (compute, storage, database, pubsub, security) and app/ modules for each component
Key architecture notes from README
• Uses Azure Static Web Apps for Angular portal
• Azure Container Apps for Next.js blog, Strapi CMS, Stripe service
• Azure Functions behind API Management for the portal API
• Databases: Cosmos DB (Mongo API) for portal, PostgreSQL for CMS, Blob Storage for assets
• Azure Event Grid / Web Pub-Sub for real‑time notifications
• CI/CD via Azure Developer CLI and GitHub Actions
Main components & their interactions
a. Frontend tier
• Portal (Angular) → Static Web Apps
• Blog (Next.js) → Container App
• CMS Admin (Strapi) → Container App
b. API tier
• Portal API → Azure Functions behind API Management
• Stripe webhook → Fastify in Container App
• Notifications service → Node server in Container/App Service + Web Pub‑Sub
c. Data tier
• Portal data → Cosmos DB (Mongo API)
• CMS data → Azure Database for PostgreSQL
• Media/uploads → Azure Blob Storage
d. Integration & messaging
• Stripe service → invokes Functions via APIM for payment validation
• Strapi → reads/writes PostgreSQL, stores files in Blob
• Event Grid/Web Pub‑Sub → push real‑time events to portal
e. DevOps & infra
• Bicep modules provisioning resources
• GitHub Actions/Azure DevOps pipelines for CI/CD
Architectural patterns & principles
• Micro‑frontends & microservices: separate deployable units per domain
• Serverless (Azure Functions) for stateless APIs
• Containerized services (Container Apps) for stateful or longer‑running processes
• API Gateway (APIM) for unified API surface, routing & policies
• Infrastructure as code (Bicep) organizing core vs. app modules
• Monorepo with npm workspaces for consistent dependency management
a. Sketch the Internet layer: three entry points (portal.contoso.com, blog.contoso.com, cms.contoso.com).
b. Azure Static Web App under portal, Azure Container App under blog and CMS.
h. Component with labels and annotate technologies (Angular, Next.js, Strapi, Fastify, Node.js).