04Case study

Parking Helper

Send your location on LINE and instantly see where there's a free space, what it costs and how long the drive is.

Role
Solo
Year
2025
Type
LINE bot · Node.js service
Data
Taiwan MOTC TDX · Google Maps Platform · Taipei open data
Parking Helper: illustration of a parking sign and a car in a bay
  • 8TDX endpoints queried in parallel per city
  • 2.5 kmsearch radius
  • 5result cards per reply
  • 10 / minwebhook rate limit per IP

The problem

Finding parking usually means hopping between a map app, a car-park app and government data to piece together where there's space, what it costs and how to get there. Parking Helper puts that inside LINE: send one location, get a ranked answer.

How it's used

1. Pick a mode

Type "car park" or "street parking" and the bot remembers which you want.

2. Share a location

Tap the quick reply to send your current location, or type an address or landmark.

3. Get the answer

Cards for the nearest 5 results with name, address, free spaces, pricing, driving distance and time, and one-tap Google Maps navigation.

Architecture

Parking Helper architecture LINE userlocation / addressLINE PlatformWebhookExpress servicesignature check10 req/min/IP limitGoogle Geocodingcoords → cityTDX (MOTC)4 car-park endpoints4 on-street endpointsGoogle Placesextra car parksTaipei open datafallbackMerge · rankdedupe within ~20 mwithin 2.5 kmby distanceDistance Matrixdrive timeFlex cardstop 51-tap nav
Coordinates resolve to a city first; TDX and Google Places are queried in parallel, merged and de-duplicated before driving distances are computed.

Key design decisions

01

Parallel, fault-tolerant queries per city

Reverse geocoding picks the city, then Promise.allSettled calls that city's TDX endpoints in parallel (car parks, facilities, live availability, rates; or road segments, availability, rates, charging hours) so one failing endpoint never sinks the rest.

02

De-duplicating across sources

TDX and Google Places results are merged, points within about 20 m are treated as the same place, and only those within 2.5 km are kept, sorted by distance.

03

Token caching

TDX uses OAuth client credentials; the access token is cached until 60 seconds before it expires.

04

Protecting API quotas

The webhook allows 10 requests per minute per IP. A lookup costs about 3 TDX calls and 5 Distance Matrix elements, which Google's free tier covers for thousands of users a day.

05

Degrade, don't fail

When TDX has no data the bot falls back to Taipei open data, and every reply carries a plain-text summary so results are readable even without cards.

Stack

  • Node.js
  • Express 5
  • LINE Messaging API
  • LIFF
  • axios
  • express-rate-limit
  • TDX API (OAuth 2.0)
  • Google Geocoding
  • Google Places
  • Distance Matrix