# briantoalexandre/packagetracker architecture

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

- Interactive diagram: https://gitdiagram.com/briantoalexandre/packagetracker
- Repository: https://github.com/briantoalexandre/packagetracker

## Overview

Package Tracker is a C++ desktop prototype inspired by Packet Tracer, with an emerging network-device object model. The source currently returns from a placeholder test before initializing its window, so the GLFW/OpenGL/ImGui loop is present but unreachable at runtime. If that early return is removed, the documented loop creates a window and context, initializes GLAD and ImGui, polls events, draws the UI frame, and cleans up. The device hierarchy is represented by PC and Object; the tree has other device directories, but their implementations were not sampled.

Main entry points: [`src/main.cpp`](https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp) (Window and events), [`include/objects/Devices/End/End_Devices/PC.h`](https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Devices/End/End_Devices/PC.h) (PC device), [`src/glad.c`](https://github.com/briantoalexandre/packagetracker/blob/main/src/glad.c) (GLAD loader), [`include/glad/glad.h`](https://github.com/briantoalexandre/packagetracker/blob/main/include/glad/glad.h) (GLAD API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_main["Application entry<br/>[main.cpp]"]
  node_window["Window and events<br/>[main.cpp]"]
  node_ui["ImGui frame UI<br/>[main.cpp]"]
end

subgraph group_graphics["Graphics runtime"]
  node_glad["GLAD loader<br/>[glad.c]"]
  node_gladheader["GLAD API<br/>[glad.h]"]
end

subgraph group_domain["Device model"]
  node_pc["PC device<br/>[PC.h]"]
  node_object["Base object<br/>[Object.h]"]
  node_counter["Name counter<br/>[Counter.h]"]
end

node_user(("Desktop user"))
node_glfw["GLFW"]
node_opengl["OpenGL"]

node_user -->|"starts"| node_main
node_main -->|"runs loop"| node_window
node_window -->|"initializes and polls"| node_glfw
node_window -->|"loads functions"| node_glad
node_glad -.->|"implements API"| node_gladheader
node_window -->|"sets viewport"| node_opengl
node_ui -->|"renders draw data"| node_opengl
node_main -->|"draws frames"| node_ui
node_pc -->|"inherits"| node_object
node_pc -->|"increments names"| node_counter

click node_main "https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp"
click node_window "https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp"
click node_ui "https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp"
click node_glad "https://github.com/briantoalexandre/packagetracker/blob/main/src/glad.c"
click node_gladheader "https://github.com/briantoalexandre/packagetracker/blob/main/include/glad/glad.h"
click node_pc "https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Devices/End/End_Devices/PC.h"
click node_object "https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Object.h"
click node_counter "https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Counter.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_window,node_ui,node_user toneBlue
class node_glad,node_gladheader toneAmber
class node_pc,node_object,node_counter toneMint
class node_glfw,node_opengl toneIndigo
```

## Components

### Desktop application

- [Application entry](https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp): `src/main.cpp`
- [Window and events](https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp): `src/main.cpp`
- [ImGui frame UI](https://github.com/briantoalexandre/packagetracker/blob/main/src/main.cpp): `src/main.cpp`

### Graphics runtime

- [GLAD loader](https://github.com/briantoalexandre/packagetracker/blob/main/src/glad.c): `src/glad.c`
- [GLAD API](https://github.com/briantoalexandre/packagetracker/blob/main/include/glad/glad.h): `include/glad/glad.h`

### Device model

- [PC device](https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Devices/End/End_Devices/PC.h): `include/objects/Devices/End/End_Devices/PC.h`
- [Base object](https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Object.h): `include/objects/Object.h`
- [Name counter](https://github.com/briantoalexandre/packagetracker/blob/main/include/objects/Counter.h): `include/objects/Counter.h`

### Other components

- **Desktop user**
- **GLFW**
- **OpenGL**

## Connections

- Desktop user → Application entry: starts (evidence: `readme.md`)
- Application entry → Window and events: runs loop (evidence: `src/main.cpp`)
- Window and events → GLFW: initializes and polls (evidence: `src/main.cpp`)
- Window and events → GLAD loader: loads functions (evidence: `src/main.cpp`)
- GLAD loader → GLAD API: implements API
- Window and events → OpenGL: sets viewport (evidence: `src/main.cpp`)
- ImGui frame UI → OpenGL: renders draw data (evidence: `src/main.cpp`)
- Application entry → ImGui frame UI: draws frames (evidence: `src/main.cpp`)
- PC device → Base object: inherits (evidence: `include/objects/Devices/End/End_Devices/PC.h`)
- PC device → Name counter: increments names (evidence: `include/objects/Devices/End/End_Devices/PC.h`)
