PathCraft is a modular, open-source routing engine built in Go, designed for understanding, extension, and deployment without vendor lock-in. It functions as a reusable library, CLI application, HTTP server, and embeddable engine. The core philosophy prioritizes correctness over raw performance, emphasizing readability and maintainability through a clear architecture. The chosen tech stack leverages Go's performance, simplicity and concurrency features. PathCraft's structure constitutes a modular monolith, dividing code into distinct modules like /internal, /graph, /osm, /gtfs, and /pkg/pathcraft/engine for the public API. The walking router uses a custom A* search implementation combined with the Haversine distance heuristic. Public transit routing utilizes the RAPTOR algorithm, working directly with timetable data for efficient pathfinding. The engine's public API is the Engine struct that orchestrates the routing processes, avoiding algorithm-specific details. Development principles included pure and deterministic core algorithms, testability, and avoiding premature abstraction. PathCraft currently supports OSM parsing, A* routing, CLI interface, and GTFS ingestion. The project aims to integrate walk + transit, time-dependent routing, and performance benchmarking moving forward. The author learned the importance of starting simple, investing in tooling, documenting as a design practice, and that data management presents the biggest challenges.
dev.to
dev.to
