# shrutika-panchal/travel-memory-k8s architecture

> Architecture diagram of the GitHub repository shrutika-panchal/travel-memory-k8s, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shrutika-panchal/travel-memory-k8s
- Repository: https://github.com/shrutika-panchal/travel-memory-k8s

## Overview

##### Project type and purpose
- This is a full-stack “Travel Memory” web application that comprises a frontend UI, a backend API, a persistent database, and Kubernetes manifests for deployment, with an Azure Pipelines CI/CD workflow.

##### File structure
- Top level only shows project-wide configuration and k8s manifests:
- azure-pipelines.yml – CI/CD definition
- db-*.yaml (namespace, deployment, service) – PostgreSQL (or similar) DB setup
- pv.yaml & pvc.yaml – persistent storage for the database
- README.md, LICENSE, .gitignore
- (Implicit) we know there must be subdirectories such as /frontend and /backend containing the application code.

##### README
- Confirms “Full-Stack Solution with Backend, Frontend, and Kubernetes Deployment.”
- No further architectural details, so we infer a standard three-tier web app.

##### Main components
a. User’s Browser (Client) – interacts with the frontend over HTTPS
b. Frontend – single-page app (e.g., React, Angular) served from a container (Nginx, Node)
c. Backend API – REST/GraphQL server (Node.js/Express, Spring Boot, etc.) running in its own container
d. Database – PostgreSQL (or equivalent) in its own Kubernetes namespace, exposed via a ClusterIP Service
e. CI/CD Pipeline – Azure Pipelines orchestrating build, test, image push, and k8s deployment
f. Kubernetes Cluster – hosts frontend, backend, and database workloads
g. PV / PVC – Kubernetes PersistentVolume and PersistentVolumeClaim backing the database’s storage

##### Relationships & interactions
- Browser → Frontend: HTTPS request for UI assets and SPA routes
- Frontend → Backend: REST or GraphQL calls
- Backend → Database: SQL over the internal k8s Service endpoint
- Azure Pipelines → Container registry → Kubernetes API (for rolling updates)

##### Architectural patterns
- Three-tier (Presentation / Business / Data)
- Infrastructure as Code (all k8s objects declared in YAML)
- Continuous Delivery via Azure Pipelines

##### Key technologies & frameworks
- Frontend: React/Angular/Vue, served by Nginx or Node
- Backend: Node.js/Express (or similar)
- Database: PostgreSQL (namespace + service + PVC)
- Kubernetes: Deployments, Services, PV/PVC
- CI/CD: Azure DevOps Pipelines

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Components
    Browser["User's Browser"]:::presentation
    AzurePipelines["Azure Pipelines"]:::cicd
    ContainerRegistry["Container Registry"]:::cicd
    K8sAPI["Kubernetes API"]:::infra

    %% Kubernetes Cluster
    subgraph "Kubernetes Cluster"
        direction TB

        subgraph "Presentation Layer"
            direction TB
            Frontend["Frontend (React/Vue)"]:::frontend
        end

        subgraph "Business Layer"
            direction TB
            Backend["Backend API (Node.js)"]:::backend
        end

        subgraph "Data Layer"
            direction TB
            DBNamespace["Database Namespace"]:::data

            subgraph "DB Objects"
                direction TB
                DBDeployment["DB Deployment (PostgreSQL)"]:::data
                DBService["DB Service (ClusterIP)"]:::data
                PVC["PersistentVolumeClaim"]:::storage
                PV["PersistentVolume"]:::storage
                DB["Database (PostgreSQL)"]:::data
            end
        end
    end

    %% Connections
    Browser -->|"HTTPS"| Frontend
    Frontend -->|"REST API"| Backend
    Backend -->|"TCP/5432"| DBService
    DBService -->|"routes to"| DBDeployment
    DBDeployment -->|"uses"| PVC
    PVC -->|"binds to"| PV

    AzurePipelines -->|"build & push"| ContainerRegistry
    ContainerRegistry -->|"image pull"| K8sAPI
    K8sAPI -->|"deploy"| Frontend
    K8sAPI -->|"deploy"| Backend
    K8sAPI -->|"deploy"| DBDeployment

    %% Click Events
    click AzurePipelines "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/azure-pipelines.yml"
    click DBNamespace "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/db-namespace.yaml"
    click DBDeployment "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/db-deployment.yaml"
    click DBService "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/db-service.yaml"
    click PV "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/pv.yaml"
    click PVC "https://github.com/shrutika-panchal/travel-memory-k8s/blob/main/pvc.yaml"

    %% Styles
    classDef presentation fill:#AEC6CF,stroke:#333,stroke-width:1px
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFD580,stroke:#333,stroke-width:1px
    classDef storage fill:#FFB347,stroke:#333,stroke-width:1px
    classDef cicd fill:#C8A2C8,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
```
