# satyamprakash09/iss_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/satyamprakash09/iss_tracker
- Repository: https://github.com/satyamprakash09/iss_tracker

## Overview

##### Project Type and Purpose
- Type: A lightweight Python utility (open‐source tool) that continuously fetches ISS position data from an external API, renders it on a Turtle‐graphics world map, and logs each data point to CSV.
- Purpose: Real‐time visualization plus persistent logging of ISS telemetry.

##### File Structure
- Top‐level files only:
- main.py (the “iss_tracker.py” or “main.py” script driving everything)
- iss_data.csv (persistent storage)
- iss.gif, world.png (static assets for visualization)
- stations.txt (unused or reference data)
- No frontend/backend split—everything runs in one process.
- External config: none beyond hard‐coded API URL and file names.

##### README Insights
- Core modules implicitly described:
- API Client (requests to wheretheiss.at)
- Data Logger (writes CSV)
- Visual Renderer (Turtle Graphics)
- Update loop frequency: every 3 seconds
- Error‐retry logic: on API failure, wait 10 seconds, then retry.

##### Main Components & Their Interactions
a. External Service
- wheretheiss.at API
- Data format: JSON (latitude, longitude, velocity, timestamp)
b. API Client Module (inside main.py)
- Sends HTTP GET → receives JSON
- Error handling / retry back-off
c. Data Processor / Logger
- Parses JSON fields
- Appends a new row to iss_data.csv
d. Visualization Module
- Loads world.png as background
- Converts lat/long → screen coordinates
e. Core Control Loop
- Sleeps 3 seconds between iterations
- Coordinates API call → parse → log → render

##### Architectural Patterns & Principles
- Single‐process, event loop pattern
- Separation of concerns within main.py:
- Networking vs. Parsing vs. UI vs. Persistence
- Extensibility point: you could swap out the CSV logger for a database adapter or add additional visualization widgets.

## Diagram (Mermaid)

```mermaid
flowchart TD
    API_EXT["wheretheiss.at REST API"]:::external
    SCHED["Scheduler/Timer\n(3s interval)"]:::module
    API["API Client Module"]:::module
    PROC["Data Processor/Logger"]:::module
    ADAPT["Storage Adapter\n(interface)"]:::module
    CSV["iss_data.csv"]:::storage
    VIS["Visualization Module\n(Turtle UI)"]:::module
    IMG1["world.png"]:::asset
    IMG2["iss.gif"]:::asset
    UI["Turtle UI Window"]:::ui
    README["README.md"]:::doc
    ST["stations.txt"]:::doc
    TEMP["tempCodeRunnerFile.py"]:::doc

    SCHED -->|"Trigger fetch"| API
    API -->|"HTTP GET"| API_EXT
    API_EXT -->|"JSON payload"| API
    API -->|"JSON payload"| PROC
    PROC -->|"append row"| CSV
    PROC -->|"parsed lat/long/vel/timestamp"| VIS
    PROC -->|"use adapter"| ADAPT
    IMG1 -->|"background image"| VIS
    IMG2 -->|"Turtle shape"| VIS
    VIS -->|"render commands"| UI

    click API "https://github.com/satyamprakash09/iss_tracker/blob/main/iss_tracker.py"
    click PROC "https://github.com/satyamprakash09/iss_tracker/blob/main/iss_tracker.py"
    click CSV "https://github.com/satyamprakash09/iss_tracker/blob/main/iss_data.csv"
    click VIS "https://github.com/satyamprakash09/iss_tracker/blob/main/iss_tracker.py"
    click SCHED "https://github.com/satyamprakash09/iss_tracker/blob/main/iss_tracker.py"
    click README "https://github.com/satyamprakash09/iss_tracker/blob/main/README.md"
    click ST "https://github.com/satyamprakash09/iss_tracker/blob/main/stations.txt"
    click TEMP "https://github.com/satyamprakash09/iss_tracker/blob/main/tempCodeRunnerFile.py"

    classDef external fill:#D6EAF8,stroke:#1F618D,color:#1B4F72
    classDef module fill:#D5F5E3,stroke:#27AE60,color:#1E8449
    classDef storage fill:#FCF3CF,stroke:#D68910,color:#B9770E
    classDef asset fill:#F4ECF7,stroke:#BB8FCE,color:#8E44AD
    classDef ui fill:#FADBD8,stroke:#E74C3C,color:#C0392B
    classDef doc fill:#E8DAEF,stroke:#A569BD,color:#6C3483
```
