# jak010/backend-playground-python-src architecture

> Architecture diagram of the GitHub repository jak010/backend-playground-python-src, 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/jak010/backend-playground-python-src
- Repository: https://github.com/jak010/backend-playground-python-src

## Overview

##### Main Components Identification

The project can be broken down into these major components:

a) Core Services:
- AWS Services Integration (aws_poc)
- Cache Systems (Redis, Kafka)
- Database Systems (MongoDB, Multi-category)
- Demonstration APIs
- Side Projects

b) Infrastructure Components:
- Database Layer
- Caching Layer
- Message Brokers
- External Services Integration

##### Architectural Patterns

The project implements several architectural patterns that should be represented:
- Domain-Driven Design (evident in the folder structure)
- Layered Architecture
- Event-Driven Architecture (seen in Kafka implementation)
- Microservices Architecture (multiple independent APIs)

**API Layer (Controllers/Endpoints)**
**↓**
**Service Layer (Business Logic)**
**↓**
**Repository Layer (Data Access)**
**↓**
**Infrastructure Layer (Databases/Cache/Message Brokers)**

##### Connection Types

Different types of connections:

##### Specific Implementation Details

Specialized components:
- CDC (Change Data Capture) implementation
- Coupon System
- Movie Application
- Ranking Service
- Chat System

##### Cross-Cutting Concerns

Aspects across all components:
- Authentication/Authorization
- Logging
- Error Handling
- Configuration Management

##### Notes for Implementation

The principal software engineer should:
- Maintain consistent spacing and alignment
- Related components together
- Version information
- Brief descriptions for complex interactions
- Document all external service dependencies

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Service]:::service
        L2[/API/]:::api
        L3[(Database)]:::database
        L4{{Cache}}:::cache
        L5[[AWS Service]]:::aws
        L6[External Service]:::external
    end

    subgraph "External Services"
        AWS[[AWS Services]]:::aws
        DynamoDB[[DynamoDB]]:::aws
        SES[[SES]]:::aws
        LocalStack[LocalStack]:::external
        Schemas[Schemas]:::external

        AWS --> DynamoDB
        AWS --> SES
    end

    subgraph "Cache Layer"
        Redis{{Redis Cache}}:::cache
        Kafka{{Kafka}}:::cache
        RedisWorker[Redis Worker]:::service
        Redis --> RedisWorker
    end

    subgraph "Database Layer"
        MongoDB[(MongoDB)]:::database
        MultiCatDB[(Multi-Category DB)]:::database
    end

    subgraph "Demo Applications"
        CDC[/CDC Demo API/]:::api
        Coupons[/Coupons System/]:::api
        Movies[/Movie Application/]:::api
        Ranking[/Ranking Service/]:::api
        Chat[/Redis PubSub Chat/]:::api
        Result[/Result Pattern/]:::api
    end

    subgraph "Application Layer"
        Controllers[Controllers]:::service
        UseCases[Use Cases]:::service
        DomainServices[Domain Services]:::service
    end

    subgraph "Infrastructure Layer"
        DBRepos[Database Repositories]:::service
        EventHandlers[Event Handlers]:::service
    end

    %% Relationships
    CDC --> Controllers
    Controllers --> UseCases
    UseCases --> DomainServices
    DomainServices --> DBRepos
    UseCases --> EventHandlers
    DBRepos --> MongoDB
    Chat --> Redis
    EventHandlers --> Kafka

    %% Click Events
    click AWS "https://github.com/jak010/backend-playground-python-src/tree/main/aws_poc"
    click DynamoDB "https://github.com/jak010/backend-playground-python-src/blob/main/aws_poc/dynamo_db.py"
    click SES "https://github.com/jak010/backend-playground-python-src/blob/main/aws_poc/ses_v1.py"
    click Redis "https://github.com/jak010/backend-playground-python-src/tree/main/cache/redis"
    click Kafka "https://github.com/jak010/backend-playground-python-src/tree/main/cache/kafka"
    click RedisWorker "https://github.com/jak010/backend-playground-python-src/tree/main/cache/redis/worker"
    click MongoDB "https://github.com/jak010/backend-playground-python-src/tree/main/database/mongodb_usage"
    click MultiCatDB "https://github.com/jak010/backend-playground-python-src/tree/main/database/multi-category"
    click CDC "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo"
    click Coupons "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/coupons"
    click Movies "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/movie_application_api"
    click Ranking "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/ranking_service_api"
    click Chat "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/redis_pubsub_chat_api"
    click Result "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/result_pattern_concept"
    click Controllers "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo/legacy_dsp_application/src/apis"
    click DomainServices "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo/legacy_dsp_application/src/domain"
    click UseCases "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo/legacy_dsp_application/src/application"
    click DBRepos "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo/legacy_dsp_application/src/infrastructure/repositories"
    click EventHandlers "https://github.com/jak010/backend-playground-python-src/tree/main/demonstration_apis/cdc_demo/legacy_dsp_application/src/application/events"
    click LocalStack "https://github.com/jak010/backend-playground-python-src/tree/main/1_resource/2_localstack"
    click Schemas "https://github.com/jak010/backend-playground-python-src/tree/main/1_resource/1_schemas"

    %% Styles
    classDef service fill:#a8d1ff,stroke:#000
    classDef api fill:#ffb3b3,stroke:#000
    classDef database fill:#c2f0c2,stroke:#000
    classDef cache fill:#ffd9b3,stroke:#000
    classDef aws fill:#b3b3ff,stroke:#000
    classDef external fill:#d9d9d9,stroke:#000
```
