# johanbook/meet architecture

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

- Interactive diagram: https://gitdiagram.com/johanbook/meet
- Repository: https://github.com/johanbook/meet

## Overview

##### Main System Components

The system consists of several microservices:
- Web UI (React-based frontend)
- API Service (NestJS backend)
- Auth API (Authentication service)
- Auth UI (Authentication frontend)
- Tracking Service
- Homepage Service
- Mobile App

##### Infrastructure Components

Key infrastructure elements:
- PostgreSQL Database
- Kubernetes Cluster
- MinIO (Object Storage)
- Traefik (Ingress Controller)
- Loki (Logging)
- Grafana (Monitoring)
- SuperTokens (Authentication)

##### Key Interactions to Highlight

- Authentication flow through SuperTokens
- API Gateway routing
- Service-to-service communication
- Database interactions
- Object storage for photos/files
- WebSocket connections for chat/notifications

##### Additional Elements

Include:
- Service ports and protocols
- Security boundaries
- Scaling indicators
- Health check paths
- Monitoring points

##### Architectural Patterns to Emphasize

Implementation of:
- Microservices architecture
- Event-driven communication
- CQRS pattern (visible in API service structure)
- Repository pattern
- Authentication/Authorization flows

Remember to include:
- Version numbers for major components
- Environment separation (dev/prod)
- Security zones
- Data flow directions
- API endpoints grouping
- Monitoring and logging flow

This will provide a comprehensive view of the system while maintaining clarity and usefulness for development and operations teams.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef infrastructure fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef security fill:#e74c3c,stroke:#c0392b,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        WebUI["Web UI"]:::frontend
        AuthUI["Auth UI"]:::frontend
        Homepage["Homepage"]:::frontend
        MobileApp["Mobile App"]:::frontend
    end

    %% API Gateway Layer
    subgraph GatewayLayer["API Gateway Layer"]
        Traefik["Traefik Ingress"]:::infrastructure
    end

    %% Service Layer
    subgraph ServiceLayer["Service Layer"]
        APIService["API Service"]:::backend
        AuthAPI["Auth API"]:::backend
        TrackingService["Tracking Service"]:::backend
        SuperTokens["SuperTokens"]:::security
    end

    %% Data Layer
    subgraph DataLayer["Data Layer"]
        PostgreSQL["PostgreSQL"]:::database
        MinIO["MinIO Storage"]:::database
    end

    %% Monitoring Layer
    subgraph MonitoringLayer["Monitoring Layer"]
        Grafana["Grafana"]:::infrastructure
        Loki["Loki"]:::infrastructure
    end

    %% Relationships
    WebUI --> Traefik
    AuthUI --> Traefik
    Homepage --> Traefik
    MobileApp --> Traefik

    Traefik --> APIService
    Traefik --> AuthAPI
    Traefik --> TrackingService

    APIService --> PostgreSQL
    APIService --> MinIO
    AuthAPI --> SuperTokens
    TrackingService --> PostgreSQL

    APIService --> Loki
    AuthAPI --> Loki
    TrackingService --> Loki
    Loki --> Grafana

    %% Click events
    click WebUI "https://github.com/johanbook/meet/tree/main//services/web-ui"
    click AuthUI "https://github.com/johanbook/meet/tree/main//services/auth-ui"
    click Homepage "https://github.com/johanbook/meet/tree/main//services/homepage"
    click MobileApp "https://github.com/johanbook/meet/tree/main//services/mobile-app"
    click APIService "https://github.com/johanbook/meet/tree/main//services/api"
    click AuthAPI "https://github.com/johanbook/meet/tree/main//services/auth-api"
    click TrackingService "https://github.com/johanbook/meet/tree/main//services/tracking"
    click PostgreSQL "https://github.com/johanbook/meet/tree/main//config/postgres"
    click MinIO "https://github.com/johanbook/meet/blob/main//kubernetes/manifests/infrastructure/deployments/minio.yaml"
    click Traefik "https://github.com/johanbook/meet/blob/main//kubernetes/helm/values/traefik.yaml"
    click Loki "https://github.com/johanbook/meet/blob/main//kubernetes/helm/values/loki.yaml"
    click SuperTokens "https://github.com/johanbook/meet/blob/main//kubernetes/manifests/apps/deployments/supertokens.yaml"
    click Grafana "https://github.com/johanbook/meet/blob/main//kubernetes/manifests/infrastructure/ingress-routes/grafana.yaml"

    %% Legend
    subgraph Legend
        Frontend["Frontend"]:::frontend
        Backend["Backend"]:::backend
        Infrastructure["Infrastructure"]:::infrastructure
        Database["Database"]:::database
        Security["Security"]:::security
    end
```
