# antoninj/luxembook architecture

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

- Interactive diagram: https://gitdiagram.com/antoninj/luxembook
- Repository: https://github.com/antoninj/luxembook

## Overview

##### Main Components
- CLI Application: This is the primary entry point executed via the command line (represented mainly by src/luxembook.py and src/runner.py).
- Selenium Automation Module: This encapsulates the logic that interacts with the web browser (using Selenium and a downloaded chromedriver).
- External Booking Service: The FFT online booking platform where the booking actions are performed.
- Environment/Configuration: This includes environment variables (username and password) and any runtime settings/configurations. Also note the Docker configuration if containerized deployment is considered.
- Docker Container (optional): Represents the containerization layer when running via Docker (Dockerfile and related environment setups).

##### Out Component Relationships
- The CLI component launches the application and triggers booking actions.
- It invokes the Selenium Automation module to simulate browser interactions.
- Selenium (via chromedriver) interacts directly with the external booking platform (FFT website).
- Configuration details (environment variables) are passed to the CLI at runtime.
- In Docker deployments, the application is encapsulated along with OS-level dependencies (via Dockerfile).

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project is well structured into distinct responsibilities (CLI, automation logic).
- External Service Integration: The design clearly abstracts the interaction with the external FFT booking platform.
- Containerization: Using Docker for consistent runtime environments.
- Automation and Configuration: Use of environment variables and configuration files (pyproject.toml, pre-commit-config.yaml) for dependency management and code quality.

##### Relevant Technologies and Tools
- Python as the programming language.
- Selenium for web browser automation.
- Chromedriver as the WebDriver executable.
- Docker for containerization.
- Poetry (indicated by pyproject.toml) for dependency management.
- GitHub Actions for CI/CD (in .github/workflows).

## Diagram (Mermaid)

```mermaid
graph TD
    %% CI/CD and Deployment Layer
    CI["CI/CD Workflow"]:::external
    DOCK["Docker Container"]:::internal

    %% Environment/Configuration Layer
    subgraph "Environment/Configuration"
        PROJECT["pyproject.toml"]:::config
        PRECOMMIT[".pre-commit-config.yaml"]:::config
    end

    %% CLI Application Layer
    subgraph "CLI Application"
        LUX["luxembook.py"]:::internal
        RUN["runner.py"]:::internal
    end

    %% Selenium Automation Module
    SA["Selenium Automation Module"]:::internal
    CHRO["Chromedriver"]:::internal

    %% External Booking Platform
    FFT["FFT Booking Platform (FFT)"]:::external

    %% Connections
    CI -->|"builds_and_publishes"| DOCK
    DOCK -->|"executes"| LUX
    PROJECT -->|"configures"| LUX
    PRECOMMIT -->|"configures"| RUN
    LUX -->|"triggers"| SA
    SA -->|"initializes"| CHRO
    CHRO -->|"interacts_with"| FFT

    %% Click Events
    click LUX "https://github.com/antoninj/luxembook/blob/main/src/luxembook.py"
    click RUN "https://github.com/antoninj/luxembook/blob/main/src/runner.py"
    click PROJECT "https://github.com/antoninj/luxembook/blob/main/pyproject.toml"
    click PRECOMMIT "https://github.com/antoninj/luxembook/blob/main/.pre-commit-config.yaml"
    click DOCK "https://github.com/antoninj/luxembook/tree/main/Dockerfile"
    click CI "https://github.com/antoninj/luxembook/blob/main/.github/workflows/build-and-publish.yml"

    %% Styles
    classDef internal fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef external fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef config fill:#FFE4B5,stroke:#000,stroke-width:2px;
```
