# siranjeevi2001/problemsolving-skygo-drone-delivery architecture

> Architecture diagram of the GitHub repository siranjeevi2001/problemsolving-skygo-drone-delivery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siranjeevi2001/problemsolving-skygo-drone-delivery
- Repository: https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery

## Overview

##### Project type and purpose
- This is a Python‐based CLI tool (“Drone Delivery System”) that:
- Reads order data from JSON (testcase1/2.json)
- Assigns orders to drones and computes routes using the A* pathfinding algorithm
- Outputs results to output.json and visualizes the warehouse and drone paths via Matplotlib

##### File structure
- Top‐level files:
- requirements.txt  – Python deps (matplotlib, etc.)
- testcase1.json, testcase2.json – sample input data
- output.json       – computed assignment/routes
- src/              – contains generated output images (case1-op.png, case2-op.png)
- README.md         – project overview & usage
- There is no multi‐service or client/server split: it’s a single‐process pipeline.

##### Key insights from README
- Core components: order‐assignment logic, A* pathfinder, Matplotlib visualization
- Data flow: JSON in → algorithm → JSON out + plot display

##### Main components
a. Input Layer
- JSON Parser
- Data Models (orders, drone fleet, warehouse)
b. Core Processing
- Assignment Engine (allocates orders to drones)
- Pathfinding Module (A* search on grid/map)
c. Output Layer
- JSON Writer (output.json)
- Visualization Module (Matplotlib)
d. Infrastructure/Environment
- File System (input/output JSON, images in src/)
- Python Runtime & Libraries (requirements.txt)

##### Relationships and data flow
- The CLI (main.py) loads JSON → constructs data models → passes to Assignment Engine
- For each assigned order, the Pathfinding Module computes a route → returns path data
- Main orchestrator writes aggregated results to output.json
- Main invokes Visualization Module to render paths on a 2D plot
- Visualization outputs PNG files into src/ and displays figures

##### Architectural patterns & principles
- Single‐process pipeline (no network calls)
- Clear separation of concerns: parsing ↔ computing ↔ I/O/visualization
- Modular algorithm implementation (swap A* for another heuristic if needed)
- Stateless computation per invocation (no persistent state beyond JSON)

##### Technologies and libraries
- Python 3.x (main runtime)
- Matplotlib (visualization)
- JSON (data interchange)

##### Detailed elements
- JSON Parser → Data Models → Assignment Engine → Pathfinding Module
- File system layer to show where inputs live and where outputs are written
- Python runtime block hosting all modules, with dependencies (Matplotlib, stdlib json, etc.)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Input Layer"
        JSONFiles["Testcase JSON Files"]:::datastore
        Orchestrator["CLI Orchestrator (main.py)"]:::module
        JSONParser["JSON Parser & Data Models"]:::module
    end

    subgraph "Core Processing"
        AssignmentEngine["Assignment Engine"]:::module
        PathfindingModule["Pathfinding Module (A* Search)"]:::module
    end

    subgraph "Output Layer"
        JSONWriter["JSON Writer"]:::module
        OutputData["Output JSON"]:::datastore
        VisualizationModule["Visualization Module"]:::module
        Images["Visualization Outputs (PNG)"]:::datastore
    end

    subgraph "Environment"
        PythonRuntime["Python Runtime & Dependencies"]:::runtime
        Documentation["Project Documentation"]:::runtime
    end

    JSONFiles -->|"Input JSON"| Orchestrator
    Orchestrator -->|"Parse Request"| JSONParser
    JSONParser -->|"Order List"| AssignmentEngine
    AssignmentEngine -->|"Assigned Orders"| PathfindingModule
    PathfindingModule -->|"Route Coordinates"| JSONWriter
    JSONWriter -->|"Write Results"| OutputData
    JSONWriter -->|"Notify Completion"| Orchestrator
    Orchestrator -->|"Invoke Visualization"| VisualizationModule
    VisualizationModule -->|"Generate Plots"| Images

    PythonRuntime -.-> JSONParser
    PythonRuntime -.-> AssignmentEngine
    PythonRuntime -.-> PathfindingModule
    PythonRuntime -.-> JSONWriter
    PythonRuntime -.-> VisualizationModule
    Documentation -.-> Orchestrator

    click Orchestrator "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/main.py"
    click JSONParser "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/main.py"
    click AssignmentEngine "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/main.py"
    click PathfindingModule "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/main.py"
    click JSONWriter "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/main.py"
    click JSONFiles "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/testcase1.json"
    click OutputData "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/output.json"
    click Images "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/tree/main/src/"
    click PythonRuntime "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/requirements.txt"
    click Documentation "https://github.com/siranjeevi2001/problemsolving-skygo-drone-delivery/blob/main/README.md"

    classDef module fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef datastore fill:#FFA500,stroke:#333,stroke-width:1px
    classDef runtime fill:#90EE90,stroke:#333,stroke-width:1px
```
