# mdesilva/amazonflexunlimited architecture

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

- Interactive diagram: https://gitdiagram.com/mdesilva/amazonflexunlimited
- Repository: https://github.com/mdesilva/amazonflexunlimited

## Overview

Primary Flow:
- Config Store → FlexUnlimited Engine → Amazon Flex API
- ↓
- Offer Handler
- ↓
- Logging System
- ↓
- Twilio Service

##### Component Interactions

a. Authentication Flow:
- auth.sh → Amazon Flex API → 2FA Challenge → FlexUnlimited Engine

b. Job Search Flow:
- FlexUnlimited Engine → Config Filters → Amazon Flex API → Offer Handler

##### Technical Details

Annotations for:
- Python 3 requirement
- API reverse engineering notes
- Warehouse ID handling
- Schedule filtering logic

##### Architectural Notes

Architectural decisions:
- Single-process automation design
- Continuous polling mechanism
- Configurable filtering system
- Asynchronous notification system

- Configuration management
- Core automation logic
- External service integration
- Notification handling

Remember to include error handling paths and retry mechanisms, as this is a time-sensitive automation system competing with other automated solutions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Core Component]:::core
        L2([External Service]):::external
        L3[(Configuration)]:::config
        L4[/"Status Indicator"/]:::status
    end

    subgraph "Configuration Layer"
        Config[(Config Store)]:::config
    end

    subgraph "Core Application Layer"
        Auth[Authentication Module]:::core
        FlexEngine[FlexUnlimited Engine]:::core
        OfferHandler[Offer Handler]:::core
        Logger[Logging System]:::core
        Entry[Main Application Entry]:::core
    end

    subgraph "External Services"
        AmazonAPI([Amazon Flex API]):::external
        Twilio([Twilio SMS Service]):::external
    end

    subgraph "Process Flow"
        Auth2FA[/"2FA Challenge"/]:::status
        JobDetection[/"Job Detection"/]:::status
        Success[/"Success"/]:::status
        Failure[/"Failure"/]:::status
    end

    Config --> FlexEngine
    Entry --> Auth
    Auth --> Auth2FA
    Auth2FA --> AmazonAPI
    AmazonAPI --> FlexEngine
    FlexEngine --> JobDetection
    JobDetection --> OfferHandler
    OfferHandler --> Success
    OfferHandler --> Failure
    Success & Failure --> Logger
    Logger --> Twilio

    %% Click events for component mapping
    click Auth "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/lib/auth.sh"
    click FlexEngine "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/lib/FlexUnlimited.py"
    click OfferHandler "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/lib/Offer.py"
    click Logger "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/lib/Log.py"
    click Config "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/config.json"
    click Entry "https://github.com/mdesilva/AmazonFlexUnlimited/blob/master/app.py"

    classDef core fill:#a2d2ff,stroke:#333,stroke-width:2px
    classDef external fill:#95d5b2,stroke:#333,stroke-width:2px
    classDef config fill:#ffe5d9,stroke:#333,stroke-width:2px
    classDef status fill:#ffccd5,stroke:#333,stroke-width:2px
```
