A Pocket MCD Train Board in Vanilla JavaScript and PWA: Vibe-Coding a Tool Around One ScenarioNote · digest for November 23
Handheld smartphone showing a clean two-column train departure board in front of a station platform
Note3 sections≈ 4 min

A Pocket MCD Train Board in Vanilla JavaScript and PWA: Vibe-Coding a Tool Around One Scenario

You are walking toward an MCD (Moscow Central Diameters) platform with two minutes to spare and need one quick answer: can you walk calmly, or do you need to run? In a typical transit app, a mini-quest begins—pick your departure station, pick your destination, wait for routes. By the time you finish tapping, the doors are closing.

To cut out that friction, industrial automation engineer Alexey (Weron2) used AI to build the web app MCD Board (source code is open in the Boolkin/MCD repo). Open the page, and you immediately see the nearest station and trains going both ways.

One screen instead of a route planner

Aggregators like Yandex Schedules and Tutu.ru are built for multi-leg trips and infrequent long-distance trains. On the Moscow Central Diameters, things work differently: trains run frequently, stop almost everywhere, and riders already know their direction. All you need is a station board with two columns: "To Moscow" and "From Moscow."

The UI revolves around one scenario—walking to the platform. On launch, it detects the nearest station and shows upcoming trains. The list expands up to 10 departures, and clicking a train pulls detailed live data from the server. You can switch lines at the top, tap a station to view the rest of the route ahead, and pin favorite stops to the top with a blue pin. Settings let you adjust how many trains load initially and switch themes.

CriterionSchedule aggregatorSingle-purpose PWA board
ScenarioMulti-transfer routeQuick glance on the move
Path to answerPick origin and destinationOne screen immediately
GeolocationOften sent to serverLocal in the browser
Complex tripsFull supportRequires standard apps

This everyday problem yields a solid rule for side projects: don't try to out-feature the giants. Cut every extra screen around one frequent scenario, and a lightweight utility wins on speed.

Local geolocation and PWA installation

Under the hood, it is plain HTML5 and vanilla JavaScript. Stations live in a client-side coordinate table. The browser's Geolocation API (navigator.geolocation) grabs your current position, and the script finds the nearest station and walking distance locally. Your coordinates never leave the device.

One detail shows real-world field testing: coming out of the metro or a building, phone GPS often stays stuck on an old point. So right next to the schedule update time, the app displays a geo timestamp (Updated 17:37 (geo 17:36)) and a manual location refresh button. You can tell at a glance whether the point is fresh or your phone still thinks you are at home.

Private geolocation right in the browser

When you only need to find the nearest spot from a small list, don't ship the user's GPS coordinates to your backend. Send the coordinate table to the client and compute the distance in JavaScript—less server load and zero location leaks.

The project is packaged as a PWA (Progressive Web App)—a site with a manifest.webmanifest file that installs to a phone's home screen without the App Store or Google Play. The manifest defines standalone portrait mode (display: "standalone", orientation: "portrait"), dark theme color #0c0f14, 192/512 icons (including maskable), and offline support, while the theme choice is saved in localStorage under mcd.theme.

Estimated times for MCD-3 and the honest cost of simplicity

Simplicity has its price. Live server feeds aren't available for every station, and MCD-3 has none at all—manifest.webmanifest only lists MCD-1, MCD-2, MCD-4, and MCD-5. For missing stops, the script calculates estimated arrival times from previous stations, coordinate distances, and average train speed. That workaround holds up on normal days, though it misses sudden delays or cancellations between stops. Browser permissions are the other limit: deny location access, and you have to pick your station manually.

Alexey built a similar tool earlier when language models were weaker and routine code had to be written by hand. He built this new version through vibe-coding—iteratively prompting AI agents around a crisp scenario. Modern models sped up expanding the station list, wiring themes, assembling the PWA manifest, and documenting features in the repository README.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 5