# kousiknath/lowleveldesign architecture

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

## Overview

##### High-Level Project Structure

a. Core Systems (Group the implementations into categories):
- Gaming Systems (Snake, Tic-tac-toe, Connect Four)
- Booking Systems (BookMyShow, Meeting Room)
- Infrastructure Systems (Thread Pool, Connection Pool, Logger)
- E-commerce Systems (Amazon)
- Communication Systems (Chat, Notification)
- Transportation Systems (Uber, Elevator)
- Financial Systems (Stock Broker)

##### Common Architectural Patterns

a. Standard Layers (vertical layers):
- Models (Domain Objects)
- Services (Business Logic)
- Repositories (Data Access)
- Constants (Enums/Types)
- Exceptions (Error Handling)

b. Common Components (horizontal layers):
- Main Application
- Configuration
- Controllers/Handlers
- Workers/Threads

##### Specific Implementation Details
For each system, show:

a. Core Components:
- Use rectangles for services
- Use hexagons for models
- Use circles for workers/threads

b. Relationships:

##### Implementation-Specific Elements

For example, for the Thread Pool implementation:
**ThreadPool**
- Components
- FixedThreadPool
- WorkerThread
- ThreadPoolFactory
- States
- ThreadState
- State
- Exception Handling
- RequestRejectionException

##### Interaction Patterns
Common patterns like:
- Producer-Consumer pattern (Kafka, BlockingQueue)
- Observer pattern (Notification system)
- Factory pattern (Multiple implementations)
- Strategy pattern (Gaming systems)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph LLD["Low Level Design Project"]
        subgraph Gaming["Gaming Systems"]
            Snake["Snake Game"]:::gaming
            TicTac["Tic-tac-toe"]:::gaming
            Connect["Connect Four"]:::gaming
        end

        subgraph Booking["Booking Systems"]
            BMS["BookMyShow"]:::booking
            Meeting["Meeting Room"]:::booking
        end

        subgraph Infra["Infrastructure Systems"]
            Thread["Thread Pool"]:::infra
            Conn["Connection Pool"]:::infra
            Logger["Logger"]:::infra
        end

        subgraph Ecom["E-commerce Systems"]
            Amazon["Amazon"]:::ecom
            subgraph AmazonLayers["Amazon Architecture"]
                Models["Models"]:::model
                Services["Services"]:::service
                Constants["Constants"]:::constant
                Exceptions["Exceptions"]:::exception
                ServiceImpl["Service Implementations"]:::service
            end
        end

        subgraph Comm["Communication Systems"]
            Chat["Chat Application"]:::comm
            Notif["Notification System"]:::comm
        end

        subgraph Trans["Transportation Systems"]
            Uber["Uber Driver Dispatch"]:::trans
            Elevator["Elevator System"]:::trans
        end

        subgraph Fin["Financial Systems"]
            Stock["Stock Broker"]:::finance
        end
    end

    %% Relationships
    Amazon --> Models
    Amazon --> Services
    Services --> ServiceImpl
    Amazon --> Constants
    Amazon --> Exceptions

    %% Click Events
    click Snake "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/snakegame"
    click TicTac "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/tictactoe"
    click Connect "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/connectfourgame"
    click BMS "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/bookmyshow"
    click Thread "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/threadpool"
    click Conn "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/connectionpool"
    click Logger "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/multithreadedlogging"
    click Amazon "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon"
    click Chat "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/chatapplication"
    click Uber "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/uberdriverdispatch"
    click Stock "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/stockbroker"
    click Models "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon/model"
    click Services "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon/service"
    click Constants "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon/constant"
    click Exceptions "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon/exception"
    click ServiceImpl "https://github.com/kousiknath/LowLevelDesign/tree/main/src/com/lld/amazon/service/impl"

    %% Styling
    classDef gaming fill:#6C8EBF,stroke:#2F5597
    classDef booking fill:#FFB366,stroke:#C65911
    classDef infra fill:#A8D08D,stroke:#548235
    classDef ecom fill:#C3B4E0,stroke:#7030A0
    classDef comm fill:#F4B183,stroke:#C55A11
    classDef trans fill:#9CC3E5,stroke:#2E75B6
    classDef finance fill:#FFD966,stroke:#BF9000
    classDef model fill:#70AD47,stroke:#385723
    classDef service fill:#4472C4,stroke:#162641
    classDef constant fill:#A5A5A5,stroke:#404040
    classDef exception fill:#FF0000,stroke:#C00000

    %% Legend
    subgraph Legend
        L1["Gaming Systems"]:::gaming
        L2["Booking Systems"]:::booking
        L3["Infrastructure"]:::infra
        L4["E-commerce"]:::ecom
        L5["Communication"]:::comm
        L6["Transportation"]:::trans
        L7["Financial"]:::finance
    end
```
