How alae-touba/pathfinding-visualisation works
Project Type and Purpose
• This is a single‐page, static front-end application built with TypeScript, HTML, and CSS.
File Structure
• Top-level:
• src/ — TypeScript source code, divided into algorithms.ts (core algorithms), main.ts (app bootstrap + UI interaction), utils.ts (helper functions).
• build/ — transpiled JavaScript artifacts (algorithms.js, main.js, utils.js).
• static/ — CSS (styles.css), images (app demo), and a video demo.
• index.html — entry point, references build/*.js and static/styles.css.
• tsconfig.json, package.json — build and dependency configs.
Extract Key Architectural Insights from README
• Build pipeline: npm run build ⇒ tsc compiles src → build.
• No backend or external API—everything runs in‐browser.
• Interactivity via DOM events and a grid data structure in memory.
Main Components & Their Relationships
a. Components:
1. Developer Environment & Build Pipeline
• TypeScript Compiler (tsc)
• npm scripts (build, watch)
2. Static Server / Hosting
• index.html + static/ assets served (GitHub Pages)
3. Front-end Modules (loaded in browser)
• Grid Data Model (utils.js): maintains grid cells, start/end coordinates, blocked cells.
• Algorithm Engine (algorithms.js): implements DFS, BFS, Bellman-Ford, Dijkstra logic on the grid model.
4. Static Assets
• CSS for styling (static/styles.css)
• Images & video for documentation (static/images, static/pathfinding-visualisation.mp4)
b. Interactions & Data Flow:
• Developer writes TS in src/
→ (tsc)
→ build/JS
→ index.html loads JS & CSS
→ Browser
• In browser:
• UI Controller captures user events → updates Grid Model
• Renderer takes results → updates the DOM grid
• Static assets (styles.css) affect presentation; images used only in docs, not in runtime.
c. Architectural Patterns & Principles:
• Modular separation:
• Algorithm logic is decoupled from DOM (pure functions in algorithms.js).
• Grid state and utility functions live in a separate module (utils.js).
• UI orchestration and DOM manipulation centralized in main.js.
• Build pipeline separates source from distribution.
• Clear layering: Build tools → Static hosting → Browser execution → User interactions.
d. Technologies & Frameworks:
• TypeScript (tsc)
• Plain HTML/CSS/Vanilla JS (no framework)
• npm for scripts & dependency management
• GitHub Pages (static hosting)