# handreassa/prenotami architecture

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

## Overview

##### Main Components

a. Client Layer:
- Python Script (main.py)
- Configuration Files (parameters.yaml, .env)
- File Storage (files directory for PDF documents)

b. External Systems:
- Prenotami Web Application
- Selenium WebDriver
- Browser Instance

##### Component Relationships

- Configuration loading
- Browser automation flow
- External system interaction
- File system interactions

##### Specific Elements

a. Input Components (Left side):
- parameters.yaml
- .env (credentials)
- residencia.pdf
- identidade.pdf

b. Core Processing (Center):
- Selenium WebDriver Controller
- Authentication Handler
- Form Submission Logic

c. External Systems (Right side):
- Browser Instance
- Prenotami Web Application

##### Data Flow Indicators

- Configuration loading (from yaml/env to main script)
- Document upload flow (from files to web application)
- Authentication flow (credentials to web application)
- Form submission flow

##### Additional Elements

- Version/environment information
- Security considerations for credential handling
- Automated vs. manual processes

##### Technical Details to Highlight

- Selenium WebDriver integration
- File system interactions
- Configuration management
- Authentication flow
- PDF document handling

Key Considerations:
- Separation between configuration, execution, and external system interaction
- Security boundary between the local system and the external web application
- Error handling and retry logic if implemented
- Logging or monitoring components if present

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        Config["Configuration Files"]
        YAML["parameters.yaml"]:::config
        ENV[".env (Credentials)"]:::config
        Config --> YAML
        Config --> ENV
        
        Storage["Document Storage"]:::storage
        PDF1["residencia.pdf"]:::file
        PDF2["identidade.pdf"]:::file
        Storage --> PDF1
        Storage --> PDF2
    end

    subgraph Core
        Main["Main Script"]:::core
        Selenium["Selenium WebDriver\nController"]:::core
        Auth["Authentication\nHandler"]:::core
        Form["Form Submission\nLogic"]:::core
        
        Main --> Selenium
        Main --> Auth
        Main --> Form
    end

    subgraph External
        Browser["Browser Instance"]:::external
        WebApp["Prenotami Web\nApplication"]:::external
        Browser --> WebApp
    end

    subgraph Testing
        Tests["Test Suite"]:::test
        UnitTests["Unit Tests"]:::test
        Tests --> UnitTests
    end

    %% Connections
    YAML --> Main
    ENV --> Auth
    Storage --> Form
    Selenium --> Browser
    Auth --> WebApp
    Form --> WebApp

    %% Click Events
    click Main "https://github.com/handreassa/prenotami/blob/main/main.py"
    click YAML "https://github.com/handreassa/prenotami/blob/main/parameters.yaml"
    click Tests "https://github.com/handreassa/prenotami/tree/main/tests/"
    click UnitTests "https://github.com/handreassa/prenotami/blob/main/tests/test_main.py"

    %% Styling
    classDef core fill:#2374ab
    classDef config fill:#57a773
    classDef external fill:#ff8c42
    classDef storage fill:#808080
    classDef file fill:#d3d3d3
    classDef test fill:#7d4e57

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Configuration"]:::config
        L3["External Systems"]:::external
        L4["Storage"]:::storage
        L5["Files"]:::file
        L6["Testing"]:::test
    end
```
