# 0xc1pher/geolocalizacion architecture

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

- Interactive diagram: https://gitdiagram.com/0xc1pher/geolocalizacion
- Repository: https://github.com/0xc1pher/geolocalizacion

## Overview

##### Main Components

a) Client Layer:
- HTTP clients making REST calls
- Supported request types (GET/POST)

b) API Layer:
- Three main endpoints:
- /geolocalizacion/ip
- /geolocalizacion/wifi
- /geolocalizacion/celular

c) Service Layer (Core Components):
- IP Geolocation Service (geoIP.py)
- WiFi Geolocation Service (geoMAC.py)
- Cellular Tower Geolocation Service (geoCID.py)
- Main Geolocation Orchestrator (geolocation.py)

d) External Services Integration:
- Google Geolocation API
- OpenCelliD Service
- Mozilla Location Service

- [Client Layer]
- ↓
- [API Layer]
- ↓
- [Service Layer]
- ↓
- [External Services]

##### Component Relationships

- REST API calls from clients to endpoints
- Internal service calls between components
- External API calls to third-party services

##### Specific Details

a) For each endpoint, show:
- HTTP method (GET/POST)
- Request/Response data types
- Main parameters (IP, MAC addresses, cell tower info)

b) For each service component:
- Main functionality
- Dependencies on other components
- External service integration points

##### Additional Elements

a) Configuration:
- Config.py as a supporting component
- Relationship to service components

- Authentication/Security layer
- Monitoring and logging system

##### Technical Specifications

- File names corresponding to each component
- External API keys and configuration requirements
- Data flow directions
- Request/Response formats (JSON)

##### Implementation Details

- main.py as the application entry point
- Individual service files (geoIP.py, geoMAC.py, geoCID.py)
- HTML5 interface (geoHTML5.html) for potential browser-based interactions

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph Clients
        HTTP[HTTP Clients]
        HTML["HTML5 Interface"]:::client
    end
    click HTML "https://github.com/0xC1pher/Geolocalizacion/blob/main/geoHTML5.html"

    %% API Layer
    subgraph API
        MAIN["Main API Entry Point"]:::api
        IP["/geolocalizacion/ip"]:::endpoint
        WIFI["/geolocalizacion/wifi"]:::endpoint
        CELL["/geolocalizacion/celular"]:::endpoint
    end
    click MAIN "https://github.com/0xC1pher/Geolocalizacion/blob/main/main.py"

    %% Service Layer
    subgraph Services
        GEO["Geolocation Orchestrator"]:::service
        GEOIP["IP Geolocation Service"]:::service
        GEOMAC["WiFi Geolocation Service"]:::service
        GEOCID["Cellular Tower Service"]:::service
        CONFIG["Configuration Manager"]:::config
    end
    click GEO "https://github.com/0xC1pher/Geolocalizacion/blob/main/geolocation.py"
    click GEOIP "https://github.com/0xC1pher/Geolocalizacion/blob/main/geoIP.py"
    click GEOMAC "https://github.com/0xC1pher/Geolocalizacion/blob/main/geoMAC.py"
    click GEOCID "https://github.com/0xC1pher/Geolocalizacion/blob/main/geoCID.py"
    click CONFIG "https://github.com/0xC1pher/Geolocalizacion/blob/main/config.py"

    %% External Services
    subgraph External
        GOOGLE["Google Geolocation API"]:::external
        OPENCELL["OpenCelliD Service"]:::external
        MOZILLA["Mozilla Location Service"]:::external
    end

    %% Relationships
    HTTP --> IP & WIFI & CELL
    HTML --> IP & WIFI & CELL
    IP & WIFI & CELL --> MAIN
    MAIN --> GEO
    GEO --> GEOIP & GEOMAC & GEOCID
    CONFIG --> GEOIP & GEOMAC & GEOCID
    GEOIP --> GOOGLE
    GEOMAC --> GOOGLE & MOZILLA
    GEOCID --> OPENCELL

    %% Styles
    classDef client fill:#2196F3,stroke:#1565C0,color:white
    classDef api fill:#4CAF50,stroke:#2E7D32,color:white
    classDef endpoint fill:#81C784,stroke:#4CAF50,color:white
    classDef service fill:#FF9800,stroke:#F57C00,color:white
    classDef config fill:#9E9E9E,stroke:#616161,color:white
    classDef external fill:#E91E63,stroke:#C2185B,color:white

    %% Legend
    subgraph Legend
        L1["Client Components"]:::client
        L2["API Components"]:::api
        L3["Service Components"]:::service
        L4["External Services"]:::external
        L5["Configuration"]:::config
    end
```
