# shrutika-panchal/streamingapp architecture

> Architecture diagram of the GitHub repository shrutika-panchal/streamingapp, 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/streamingapp
- Repository: https://github.com/shrutika-panchal/streamingapp

## Overview

##### Project type and purpose
- This is a full-stack, cloud-native, microservices-based “Collaborative Streaming” application.
- The frontend is a React single-page app. The backend consists of four Node.js/Express microservices (AuthService, ChatService, CoreAPIService, StreamingService).
- It uses MongoDB for persistence, AWS S3 for video storage, Docker for containerization, Kubernetes (with Helm charts) for orchestration, Terraform for infra provisioning, Jenkins and Argo CD for CI/CD.

##### File structure
- backend/ contains four subfolders:
- authService – user authentication, JWT issuance, user model
- chatService – real-time chat API (likely via WebSockets or REST)
- coreAPIService – aggregates or proxies calls to other services
- streamingService – serves media streams from AWS S3
- frontend/ is a Create React App; package.json, public/, src/
- k8s/ defines Namespaces, Deployments, Services, Secrets for auth, streaming, database (Mongo), frontend. Also a Helm chart under k8s/streamingapp.
- terraform/ provisions the underlying infrastructure (e.g., cloud resources, VPC, EKS cluster, or managed MongoDB).
- Argo CD app manifest and Jenkinsfile automate build & deployment pipelines.

##### README
- Confirms streaming focus and lists AuthService environment variables (Mongo URI, JWT secret, AWS credentials).

##### Elements
- Clear labels for each component (e.g., “AuthService (Node.js)”).
- Cluster boundary: Kubernetes
- Annotation of ports (e.g., 3001 for AuthService) and protocols (HTTP, WebSocket, S3).

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Infrastructure Provisioning"
        Terraform["Terraform"]:::infra
    end

    subgraph "CI/CD Layer"
        Jenkins["Jenkins"]:::cicd
        DockerRegistry["Docker Registry"]:::cicd
        ArgoCD["Argo CD"]:::cicd
    end

    subgraph "Kubernetes Cluster"
        direction TB

        subgraph "Namespace: frontend"
            Frontend["React SPA (Frontend)"]:::frontend
        end

        subgraph "Namespace: backend"
            CoreAPI["CoreAPIService (API Gateway)"]:::backend
            Auth["AuthService"]:::backend
            Chat["ChatService"]:::backend
            Streaming["StreamingService"]:::backend
        end

        subgraph "Namespace: database"
            MongoDB["MongoDB StatefulSet & PVC"]:::db
        end
    end

    S3["AWS S3 Bucket"]:::storage

    User["User"]:::frontend
    User -->|"HTTP/HTTPS"| Frontend
    Frontend -->|"REST API"| CoreAPI
    CoreAPI -->|"JWT Validation / User CRUD"| Auth
    CoreAPI -->|"Chat Endpoints / WebSockets"| Chat
    CoreAPI -->|"Stream Endpoints"| Streaming
    Auth -->|"Reads/Writes"| MongoDB
    Chat -->|"Reads/Writes"| MongoDB
    CoreAPI -->|"Reads/Writes"| MongoDB
    Streaming -->|"Reads/Writes Metadata"| MongoDB
    Streaming -->|"Fetch/Upload Media (S3 API)"| S3

    commit["Git Commit"]:::cicd
    commit -->|"Webhook Trigger"| Jenkins
    Jenkins -->|"Build & Push Images"| DockerRegistry
    DockerRegistry -->|"Image Pull"| ArgoCD
    ArgoCD -->|"Deploy via Helm Charts"| Terraform
    ArgoCD -->|"Sync to Cluster"| KubernetesCluster((Cluster Boundary))

    %% Click Events
    click Terraform "https://github.com/shrutika-panchal/streamingapp/tree/main/terraform/"
    click Jenkins "https://github.com/shrutika-panchal/streamingapp/tree/main/Jenkinsfile"
    click DockerRegistry "https://github.com/shrutika-panchal/streamingapp/blob/main/docker-compose.yml"
    click ArgoCD "https://github.com/shrutika-panchal/streamingapp/blob/main/argocd-application.yaml"
    click Frontend "https://github.com/shrutika-panchal/streamingapp/tree/main/frontend/"
    click Auth "https://github.com/shrutika-panchal/streamingapp/tree/main/backend/authService/"
    click Chat "https://github.com/shrutika-panchal/streamingapp/tree/main/backend/chatService/"
    click CoreAPI "https://github.com/shrutika-panchal/streamingapp/tree/main/backend/coreAPIService/"
    click Streaming "https://github.com/shrutika-panchal/streamingapp/tree/main/backend/streamingService/"
    click MongoDB "https://github.com/shrutika-panchal/streamingapp/tree/main/k8s/database/"
    click HelmChart "https://github.com/shrutika-panchal/streamingapp/tree/main/k8s/streamingapp/"
    click K8sAuth "https://github.com/shrutika-panchal/streamingapp/tree/main/k8s/backend/auth/"
    click K8sStreaming "https://github.com/shrutika-panchal/streamingapp/tree/main/k8s/backend/streaming/"
    click K8sFrontend "https://github.com/shrutika-panchal/streamingapp/tree/main/k8s/frontend/"
    click Drawio "https://github.com/shrutika-panchal/streamingapp/blob/main/Capstone_arch_diagram.drawio"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#333,stroke-width:1px
    classDef db fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef storage fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef cicd fill:#f8d7da,stroke:#333,stroke-width:1px
    classDef infra fill:#d1ecf1,stroke:#333,stroke-width:1px
```
