# navigine/indoor-routing-library architecture

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

- Interactive diagram: https://gitdiagram.com/navigine/indoor-routing-library
- Repository: https://github.com/navigine/indoor-routing-library

## Overview

##### Project type and purpose
- This is a C++ open-source library (“Indoor Routing Library”) providing graph-based routing algorithms (graph construction, connectivity checks, shortest-path).
- It is not a full-stack app or service but a reusable algorithmic library with unit tests.

##### File structure
- Top level:
- CMakeLists.txt / Makefile – build orchestration
- / – public headers (navigine/route_graph)
- src/ – implementation of graph, router, utilities
- geometry/ – (presumably helper geometry code or external submodule)
- tests/ – unit tests and test data
- Patterns: clear separation of API (include), implementation (src), and verification (tests).
- Build: CMake with optional JSON_CI integration.

##### README for additional insights
- Core features: graph building, connectivity (Kosaraju), shortest route (Dijkstra), multilevel support, start/end projection, route “events.”
- Example usage shows a simple procedural API: instantiate RouteGraph, add levels/vertices/edges, validate, then getPath.

##### Elements
- Clear labels: e.g., “Graph Builder,” “Validation Module,” “Pathfinding Module,” “Client Code,” “Tests”
- Core modules (green)
- Data structures (yellow)
- Tests (orange)
- Build system (gray)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client Application"]:::client
    RouteAPI["RouteGraph API"]:::api

    Client -->|uses| RouteAPI

    subgraph "Public API Layer"
        RouteAPI
    end

    subgraph "Core Modules"
        GB["Graph Builder Module"]:::core
        VM["Validation Module"]:::core
        PM["Pathfinding Module"]:::core
    end

    subgraph "Data Structures"
        DS1["Graph, Vertex, Edge"]:::data
        DS2["LevelPoint"]:::data
    end

    RouteAPI -->|constructs| GB
    RouteAPI -->|validates| VM
    RouteAPI -->|findsPath| PM

    GB -->|populates| DS1
    GB -->|populates| DS2

    VM -->|readsWrites| DS1
    VM -->|readsWrites| DS2

    PM -->|reads| DS1
    PM -->|reads| DS2

    subgraph "Tests Harness"
        TH["Tests Harness"]:::test
    end

    TH -->|invokes| RouteAPI
    TH -->|verifies| VM
    TH -->|verifies| PM

    subgraph "Build System"
        BS1["CMakeLists.txt & Makefile"]:::build
        BS2["src/CMakeLists.txt"]:::build
        BS3["tests/CMakeLists.txt"]:::build
    end

    BS1 -->|orchestrates| src
    BS1 -->|orchestrates| include
    BS1 -->|orchestrates| tests
    BS2 -->|builds| src
    BS3 -->|builds| tests

    click RouteAPI "https://github.com/navigine/indoor-routing-library/tree/main/include/navigine/route_graph/"
    click GB "https://github.com/navigine/indoor-routing-library/blob/main/src/route_graph.cpp"
    click GB "https://github.com/navigine/indoor-routing-library/tree/main/geometry/"
    click VM "https://github.com/navigine/indoor-routing-library/blob/main/src/route_graph_utils.cpp"
    click PM "https://github.com/navigine/indoor-routing-library/blob/main/src/router.cpp"
    click PM "https://github.com/navigine/indoor-routing-library/blob/main/src/route_path.cpp"
    click DS1 "https://github.com/navigine/indoor-routing-library/blob/main/include/navigine/route_graph/graph.h"
    click DS1 "https://github.com/navigine/indoor-routing-library/blob/main/src/graph.cpp"
    click DS2 "https://github.com/navigine/indoor-routing-library/blob/main/include/navigine/route_graph/level_point.h"
    click TH "https://github.com/navigine/indoor-routing-library/blob/main/tests/main.cpp"
    click TH "https://github.com/navigine/indoor-routing-library/tree/main/tests/"
    click BS1 "https://github.com/navigine/indoor-routing-library/blob/main/CMakeLists.txt"
    click BS1 "https://github.com/navigine/indoor-routing-library/tree/main/Makefile"
    click BS2 "https://github.com/navigine/indoor-routing-library/blob/main/src/CMakeLists.txt"
    click BS3 "https://github.com/navigine/indoor-routing-library/blob/main/tests/CMakeLists.txt"
    click Client "https://github.com/navigine/indoor-routing-library/blob/main/README.md"

    classDef client fill:#E3F2FD,stroke:#0288D1;
    classDef api fill:#E1F5FE,stroke:#0277BD;
    classDef core fill:#E8F5E9,stroke:#388E3C;
    classDef data fill:#FFFDE7,stroke:#FBC02D;
    classDef test fill:#FFF3E0,stroke:#F57C00;
    classDef build fill:#ECEFF1,stroke:#455A64;
```
