# kantancoding/microservices-python architecture

> Architecture diagram of the GitHub repository kantancoding/microservices-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kantancoding/microservices-python
- Repository: https://github.com/kantancoding/microservices-python

## Overview

##### Main Components Identification

- Gateway Service (API Gateway)
- Auth Service
- Converter Service
- Notification Service
- RabbitMQ Message Broker
- MongoDB (implied by the stack mention)
- MySQL (visible in auth/init.sql)

##### Component Relationships

- Clients → Gateway Service (HTTP/REST)
- Gateway Service → Auth Service (Authentication/Authorization)
- Gateway Service → Storage Component (File handling)
- Services → RabbitMQ (Message publishing/consuming)
- Auth Service → MySQL
- Other Services → MongoDB

##### Specific Details

For each service, show:

Gateway Service:
- Authentication middleware
- File storage handling
- Request routing

Auth Service:
- JWT token management
- User authentication
- Database interactions

Converter Service:
- File conversion logic
- Message queue consumer
- MP3 conversion capability

Notification Service:
- Email notification system
- Message queue consumer

##### Infrastructure Elements

Kubernetes-specific components:
- Deployments (indicated by *-deploy.yaml files)
- Services (indicated by service.yaml files)
- ConfigMaps and Secrets
- Ingress controllers
- PersistentVolumeClaims (for RabbitMQ)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        CL[Client]
    end

    subgraph Gateway
        GS["Gateway Service"]:::service
        AV["Auth Validation"]:::component
        SU["Storage Utility"]:::component
        AA["Auth Service Access"]:::component
        GS --> AV
        GS --> SU
        GS --> AA
    end

    subgraph Services
        AS["Auth Service"]:::service
        CS["Converter Service"]:::service
        NS["Notification Service"]:::service
    end

    subgraph MessageQueue
        RMQ[("RabbitMQ")]:::queue
    end

    subgraph Databases
        MYSQL[(MySQL)]:::database
        MONGODB[(MongoDB)]:::database
    end

    subgraph K8s["Kubernetes Infrastructure"]
        GD["Gateway Deploy"]:::k8s
        AD["Auth Deploy"]:::k8s
        CD["Converter Deploy"]:::k8s
        ND["Notification Deploy"]:::k8s
        RSS["RabbitMQ StatefulSet"]:::k8s
        PVC["PersistentVolumeClaim"]:::k8s
        ING["Ingress Controller"]:::k8s
    end

    %% Relationships
    CL --> GS
    GS --> AS
    GS --> CS
    GS --> NS
    AS --> MYSQL
    CS --> MONGODB
    NS --> MONGODB
    CS --> RMQ
    NS --> RMQ

    %% K8s Relationships
    GS --> GD
    AS --> AD
    CS --> CD
    NS --> ND
    RMQ --> RSS
    RSS --> PVC
    GS --> ING
    RMQ --> ING

    %% Styles
    classDef service fill:#3498db
    classDef component fill:#95a5a6
    classDef queue fill:#f1c40f
    classDef database fill:#2ecc71
    classDef k8s fill:#7f8c8d

    %% Click Events
    click GS "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/server.py"
    click AV "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/auth/validate.py"
    click SU "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/storage/util.py"
    click AA "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/auth_svc/access.py"
    click GD "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/manifests/gateway-deploy.yaml"
    click AS "https://github.com/kantancoding/microservices-python/blob/main/src/auth/server.py"
    click MYSQL "https://github.com/kantancoding/microservices-python/blob/main/src/auth/init.sql"
    click AD "https://github.com/kantancoding/microservices-python/blob/main/src/auth/manifests/auth-deploy.yaml"
    click CS "https://github.com/kantancoding/microservices-python/blob/main/src/converter/consumer.py"
    click CD "https://github.com/kantancoding/microservices-python/blob/main/src/converter/manifests/converter-deploy.yaml"
    click NS "https://github.com/kantancoding/microservices-python/blob/main/src/notification/consumer.py"
    click ND "https://github.com/kantancoding/microservices-python/blob/main/src/notification/manifests/notification-deploy.yaml"
    click RSS "https://github.com/kantancoding/microservices-python/blob/main/src/rabbit/manifests/statefulset.yaml"
    click PVC "https://github.com/kantancoding/microservices-python/blob/main/src/rabbit/manifests/pvc.yaml"
    click ING "https://github.com/kantancoding/microservices-python/blob/main/src/gateway/manifests/ingress.yaml"
```
