So Kohinata
← Back to works

Work / Team Project

Hamakoku (team 301)

A transit app that guides you by the fastest route from Yokohama National University to Yokohama Station.

Team of 4 1.5 years (ongoing) Role: backend overall Entering the Open Data Challenge for Public Transportation 2026

Why we built it

Getting from Yokohama National University to Yokohama Station involves many transport options, and the station is far away.

A diagram of ways to get from Yokohama National University to Yokohama Station: walking, rental bikes, Sotetsu buses, city buses, the municipal subway and the Sotetsu Line, a mix of several public transport options
From the university to Yokohama Station, there are many ways to go: walking, rental bikes, buses, the subway and the Sotetsu Line. We wanted to answer "which one gets me there fastest?" on the spot. (The diagram's labels are in Japanese.)
A diagram showing that the university is far from stations and hilly: travel times to the nearest stations and a route map with the slopes
The campus was originally a golf course, and rail access was never part of its planning. Stations and gates are far away and the terrain is hilly, so walking distance and time have to be part of the choice. (The diagram's labels are in Japanese.)

Two apps

Flyers our team made to introduce them (in Japanese).

Flyer for Hamakoku Exp.: the fastest route from campus to Yokohama Station, right away
Hamakoku Exp. Choose a starting point and a time, and it shows the fastest routes, combining bus, train, bike share and walking, in order of arrival time. You can also see transfers, fares and delay information together.
Flyer for Hamakoku Map: transport around the university on one map
Hamakoku Map Bike-share availability, bus positions and timetables, and rail information beyond Yokohama Station, all on a single map.

My role

I was responsible for the backend overall.

The part that finds the shortest route

It splits the work by route pattern, runs them at the same time, and returns up to 6 results in order of arrival time. If one pattern fails, the other results are still returned.

How the whole app is divided into parts

One gateway (adapter) per source of data absorbs the differences in data formats between operators. Fares, stop and station IDs, and operator settings are gathered in one place.

A general-purpose debugging system

I built a shared debugging module: anyone on the team can add a single line in their own part to see the search results and the flow of data at that point. View on GitHub →

Connecting to the frontend

I connected the screens to the backend and built the flow that receives search conditions and returns results.

How it works (architecture)

Drawn based on the design described in the README of the public repository.

Architecture of Hamakoku Exp. The flow from the screen to the search endpoint, route search, running route patterns at the same time, one adapter per external data source, and the data sources. Settings are gathered in config. Screen (form) EJS (server-rendered) / React 19 Search endpoint Express 5 / input validation (express-validator) Route search Run patterns at the same time → top 6 by arrival time Pattern A Walk → subway Pattern B Uses a bike Pattern C… Bus, etc. adapter (one per external data source) Absorbs each operator's data format differences ODPT API Bus / rail Timetable Local GBFS Bike share config/ : fares, stop/station IDs, operator settings

Each route pattern is one file. If one pattern fails, the other results are still returned.

Data and technology

Data

  • Yokohama Municipal Bus, Sotetsu Bus, Yokohama Municipal Subway, Sotetsu Line: Open Data for Public Transportation (ODPT)
  • Kanagawa Chuo Kotsu: published timetables
  • Bike share: availability from HELLO CYCLING and Docomo Bike Share (GBFS)
  • Map: OpenStreetMap

Technology

Node.jsExpress 5 EJSReact 19 Viteexpress-validator helmet

Late-night times past 24:00, such as "25:30", are handled as values that do not wrap back to 0 partway through.