How xtzi9859/departure-board works
Project Type and Purpose
• This is a small, static full-stack-in-miniature web application: a simulated departure display (“発車標”) for JR Ashikaga Station using the 2023 weekday timetable.
• There is no dynamic backend or database server at runtime; all data files and logic are shipped as static assets.
High-Level Architecture Components
a. Static File Host (Web Server or CDN)
b. Client Browser (User’s Frontend)
c. Data Assets (Timetable, Car formations, Destination codes, Number glyphs, Train types)
d. Build/Preprocessing Step (CSV → JSON conversion)
Relationships and Data Flows
• The build step ingests timetable/inbound.csv and timetable/outbound.csv and outputs corresponding JSON (already present in timetable/*.json).
• At runtime, the browser loads index.html from the static host.
• The HTML references disp.js, disp.css, and main.css.
• disp.js (Controller) requests the JSON timetable and supporting assets from folders cars/, dest/, num/, and type/.
• On receiving the JSON timetable (Model), disp.js renders the departure board UI into the DOM (View), applying styles from the CSS files.
Architectural Patterns and Principles
• MVC-like separation:
• Model = JSON timetable + asset directories
• View = HTML + CSS (main.css and disp.css)
• Controller = disp.js
• Static-site approach: no server-side computation at runtime.
• Preprocessing pipeline: CSV → JSON for easier client-side consumption.