Skip to content

Architecture

graph TB
    subgraph presentation [Presentation Layer]
        HTTP[HTTP Protocol]
        Handler[Request Handler]
        Registry[Handler Registry]
    end

    subgraph application [Application Layer]
        Service[Shortener Service]
        BaseService[Base Shortener]
    end

    subgraph domain [Domain Layer]
        Encoder[Base62 Encoder]
        Exceptions[Business Exceptions]
    end

    subgraph infrastructure [Infrastructure Layer]
        Storage[Storage Implementations]
        HTTPUtils[HTTP Utils]
        Config[Configuration]
        Factory[Factory Functions]
    end

    HTTP --> Handler
    Handler --> Registry
    Registry --> Service
    Service --> BaseService
    BaseService --> Storage
    Service --> Encoder
    Service --> Exceptions
    Storage --> Factory
    HTTPUtils --> Factory
    Config --> Factory
    Factory --> Service

Layer Responsibilities

Layer Purpose Key Files
Presentation HTTP protocol, request routing api.py, handlers.py
Application Business logic orchestration service.py
Domain Core business rules encoder.py, exceptions.py
Infrastructure External concerns (storage, config) storage.py, config.py