The source of hyoban.cc: a personal site built with Astro and plain CSS, with posts, a calendar and map of Moments and trips, and search over both. It also holds the API and apps that record and serve them.
.
├─ apps/web/ the Astro site (@hyoban/web; its DESIGN.md describes how it looks)
├─ data/ the car's records, and a local copy of the API's (docs/data.md)
├─ apps/api/ Cloudflare Worker serving the records from D1 (@hyoban/api)
├─ apps/android/ Here, the Android app that reads and writes Moments, and its start on the Mac (Gradle)
├─ apps/apple/ Here on the Mac in SwiftUI, and HereKit for iPhone and iPad to come (Swift)
├─ packages/data-spec/ the Zod schemas every side shares (@hyoban/data-spec)
├─ packages/trip-map/ the map page and trip player (@hyoban/trip-map)
├─ packages/drawer/ the calendar's and map's drawers (@hyoban/drawer)
├─ packages/design-tokens/ the app's design tokens, springs and icons
├─ scripts/ data, asset and media scripts, run as `vp run <name>`
└─ docs/ data.md, assets.md and deploy.md
Android app ──POST /v2/changes──▶ API Worker (D1 + R2) ──deploy hook──▶ site build
│ ▲ │
data:export │ │ data:push / data:import ▼
▼ │ hyoban.cc (static)
data/ (local copy, out of git)
- The API (
apps/api) keeps records (entries and collections), places, routes and the car's statistics in D1. Photos and videos are in theblog-imagesR2 bucket, served fromhttps://image.hyoban.cc. Every request needs a token. - The site is static. Its build reads the API's export with
MOMENTS_API_TOKEN. In CI it fails without one; locally it falls back to made-up records. data/keeps the car's records in git. The rest is a local copy of the API's, out of git (docs/data.md).
See FORKING.md. Everything about who owns the site and where it lives is in
site.config.json.
A pnpm workspace driven by Vite+ (vp); see AGENTS.md.
vp install
vp run dev # the site, from the API with MOMENTS_API_TOKEN in .env, else made-up records
vp check # format, lint and type check, packages and API included
vp test
vp run build # the static site into apps/web/dist/.env (see .env.example) may hold:
| Variable | Used for |
|---|---|
VITE_MAPBOX_TOKEN |
the map page's Mapbox tiles |
MAPBOX_STATIC_TOKEN |
the map pages' placeholders, if VITE_MAPBOX_TOKEN is URL-restricted |
MOMENTS_API_TOKEN |
building the site from the API, data:export and data:push |
CI |
if set, the build draws every Moment's share card (slow) |
Scripts that upload to R2 use Wrangler's login or CLOUDFLARE_API_TOKEN.
media:generate needs TMDB_API_TOKEN or TMDB_API_KEY.
Other parts have their own guides:
- API, run locally: apps/api.
- Android app, built with its own
./gradlew: apps/android. - Native Mac app and HereKit: apps/apple, built with
apps/apple/scripts/mac-app.shand checked withswift test.
Workers Builds deploys the site and the API from main. GitHub Actions verify every push
and release the Android and Mac apps from tags. See docs/deploy.md.
The 3D car's speed mode (apps/web/src/car-model-speed.ts) follows
GameMCU's Xiaomi SU7 showroom: its
tunnel of streaks, reflections, glossy floor and camera. It appears in the year review and
the 20,000 km post, where a line credits it.