# jeastham1993/plantbasedpizza architecture

> Architecture diagram of the GitHub repository jeastham1993/plantbasedpizza, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeastham1993/plantbasedpizza
- Repository: https://github.com/jeastham1993/plantbasedpizza

## Overview

##### Main Components and Architecture Overview

The system should be represented as a distributed microservices architecture with these key components:

a. Frontend Layer:
- React-based web application (src/frontend)
- Connection to API Gateway/Load Balancer

b. Service Layer (7 Microservices):
- Orders Service (.NET)
- Kitchen Service (NodeJS)
- Recipes Service (Java)
- Delivery Service (.NET)
- Payment Service (.NET)
- Loyalty Points Service (.NET)
- Account Service (.NET)

c. Infrastructure Components:
- AWS ECS Fargate (for web workloads)
- AWS Lambda (for async processing)
- EventBridge (for event-driven communication)
- SQS Queues (for background processing)
- MongoDB (for data persistence)
- API Gateway
- Shared Infrastructure components

##### Detailed Service Representation

For each service, show:
- API endpoints (ECS Fargate containers)
- Lambda functions
- Associated data stores
- Event subscriptions
- Service-specific queues

##### Cross-Cutting Concerns

Shared components:
- Authentication/Authorization
- Observability (Datadog integration)
- Shared infrastructure
- Common event bus

##### Deployment Boundaries

Clearly demarcate:
- VPC boundaries
- Availability Zones
- Security groups
- Service boundaries

##### Implementation Details

Specific implementation patterns:
- CQRS pattern in services
- Event-driven architecture flows
- Background worker patterns
- API Gateway routes

Tools Recommendation:
- Maintain separate views for different detail levels

Remember to:
- Keep the high-level view clean and understandable
- Clear boundaries between services
- Event-driven nature of the system
- Monitoring and observability components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        WA["Web Application"]:::frontend
    end

    subgraph "Service Layer"
        OS["Orders Service (.NET)"]:::service
        KS["Kitchen Service (Node.js)"]:::service
        RS["Recipes Service (Java)"]:::service
        DS["Delivery Service (.NET)"]:::service
        PS["Payment Service (.NET)"]:::service
        LS["Loyalty Points Service (.NET)"]:::service
        AS["Account Service (.NET)"]:::service
    end

    subgraph "Infrastructure Components"
        AG["API Gateway"]:::infra
        ECS["AWS ECS Fargate"]:::infra
        Lambda["AWS Lambda"]:::infra
        EB["EventBridge"]:::infra
        SQS["SQS Queues"]:::infra
        MongoDB["MongoDB"]:::infra
        SI["Shared Infrastructure"]:::infra
        EV["Event System"]:::infra
        IC["Infrastructure Constructs"]:::infra
    end

    subgraph "Cross-Cutting Concerns"
        SC["Shared Code"]:::shared
        IT["Integration Testing"]:::shared
        BW["Background Workers"]:::shared
    end

    WA --> AG
    AG --> |API Calls| OS
    AG --> |API Calls| KS
    AG --> |API Calls| RS
    AG --> |API Calls| DS
    AG --> |API Calls| PS
    AG --> |API Calls| LS
    AG --> |API Calls| AS

    OS --> EB
    KS --> EB
    RS --> EB
    DS --> EB
    PS --> EB
    LS --> EB
    AS --> EB

    OS --> MongoDB
    KS --> MongoDB
    RS --> MongoDB
    DS --> MongoDB
    PS --> MongoDB
    LS --> MongoDB
    AS --> MongoDB

    OS --> SQS
    KS --> SQS
    RS --> SQS
    DS --> SQS
    PS --> SQS
    LS --> SQS
    AS --> SQS

    classDef frontend fill:#3498db
    classDef service fill:#2ecc71
    classDef infra fill:#95a5a6
    classDef shared fill:#e74c3c

    click WA "https://github.com/jeastham1993/PlantBasedPizza/tree/main/src/frontend"
    click OS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Orders"
    click KS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Kitchen.Node"
    click RS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Recipes.Java"
    click DS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Delivery"
    click PS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Payments"
    click LS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.LoyaltyPoints"
    click AS "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/PlantBasedPizza.Account"
    click SI "https://github.com/jeastham1993/PlantBasedPizza/tree/main/shared-infrastructure"
    click EV "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/shared/PlantBasedPizza.Events"
    click IC "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/shared/PlantBasedPizza.Infra.Constructs"
    click SC "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/shared/PlantBasedPizza.Shared"
    click IT "https://github.com/jeastham1993/PlantBasedPizza/blob/main/src/shared/PlantBasedPizza.IntegrationTest.Helpers"
    click BW "https://github.com/jeastham1993/PlantBasedPizza/tree/main/src/PlantBasedPizza.Orders/application/BackgroundWorkers"
```
