How kmesfor/skylink works
Project type and purpose
• Skylink is a C++ full-stack desktop application (no web layer) that helps users plan optimal airline routes.
• It consists of:
• A data-processing “graph generator” that ingests raw CSVs → builds a JSON adjacency-list graph.
• A backend of graph datamodels and pathfinding algorithms (Dijkstra, A*) that query that JSON graph.
• A custom SFML-based frontend/UI for user interaction and graph visualization.
• Unit tests for algorithm correctness.
File structure
Top-level directories/files:
• CMakeLists.txt / .gitignore / main.cpp – build & entrypoint
• dist – shipping folder with raw CSVs, generated JSON, and final executables
• src/backend – graph generator, datamodels, algorithms, data manager
• src/frontend – custom SFML UI (windows, components, visualization)
• test – Catch2 unit tests for algorithms
• resources – third-party JSON library, documentation
Patterns and components:
• Graph-generator module (src/backend/graph-generator)
• Algorithms module (src/backend/algorithms)
• Datamodel module (src/backend/datamodels)
• DataManager (handles JSON I/O)
• Frontend: WindowManager, UI components, GraphVisualization
• Build scripts & external deps: CMake, SFML, nlohmann/json, Catch2
README for additional insights
• Confirms JSON graph file as persistent storage.
• Describes how to generate vs. copy the JSON.
• Notes tech stack: C++17, CMake, SFML, Catch2, nlohmann/json.
a. Main components
1. Raw Data Storage (dist/data/raw CSV files)
2. Graph Generator (executable GenerateGraphFiles)
3. Generated Graph Storage (skylinkgraph.json)
4. Backend Engine
– DataManager
– Datamodels (Airport, Route, Graph)
– Algorithms (Dijkstra, A*)
– AlgorithmComparator
5. Frontend UI
– WindowManager & Windows (Primary, Result)
– UI Components (Button, Textbox)
– GraphVisualization Module
6. Unit Test Suite (Catch2 tests for A*, Dijkstra, comparator)
7. Build & Deployment (CMake, CLion, dist folder)
8. External Libraries (SFML, nlohmann/json, Catch2)
b. Relationships & interactions
• Raw CSV files → (Graph Generator) → JSON graph
• Frontend instantiates DataManager → loads JSON graph
• Frontend issues user queries (origin/destination) → calls Backend Engine
• Backend Engine uses Datamodels + Algorithms → produces AlgorithmResult
• Frontend GraphVisualization renders the result graph and statistics
• Tests isolate Algorithms & Comparator—no UI involvement
• CMake orchestrates build of Generator, Skylink executable, and Tests
c. Architectural patterns & design principles
• Layered architecture: Data layer (CSV/JSON), Backend logic, Presentation/UI
• Separation of concerns: graph generation vs. runtime pathfinding vs. UI
• Modular algorithms: each algorithm implements a common interface (Algorithm.h)
• MVC-like pattern in UI: WindowManager & windows = controller/view; GraphVisualization = view; DataManager/backend = model
• Dependency injection of DataManager & Algorithm implementations
d. Key technologies/frameworks
• C++17, CMake (build & dependency fetch)
• nlohmann/json (JSON serialization)
• SFML (UI rendering, events)
• Catch2 (unit testing)
Detail
• Every sub-module: AlgorithmComparator, AStar, Dijkstra, WindowManager, GraphVisualization, etc.
• Data formats (e.g., “CSV → JSON”) and file locations (dist/data/raw, dist/data/generated)