The source of hyoban.cc: a personal site built with Astro and plain CSS, with posts, a calendar and map of Moments and trips, a search over both, and the pieces around it 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 the records (entries and collections), places, routes and the car's statistics in D1, and the photos and videos 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, and a local build without one shows made-up records. data/holds the car's records in git; the rest of it is a local copy of the API's, out of git (docs/data.md).
FORKING.md says how to make it your own: who the site belongs to and where it
lives is all in site.config.json, which the site, scripts, API and app read, and a local
build without a token shows made-up records.
This is 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 |
set, the build draws every Moment's share card (slow; off locally) |
The scripts that upload to R2 use Wrangler's login, or CLOUDFLARE_API_TOKEN;
media:generate needs TMDB_API_TOKEN or TMDB_API_KEY.
To run the API locally, see apps/api; for the app,
apps/android, built with its own ./gradlew; for the native Mac
app and the Apple apps' shared package, apps/apple, built with
apps/apple/scripts/mac-app.sh and checked with swift 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, held down in the year review and the 20,000 km post, where a line
credits it (apps/web/src/car-model-speed.ts), follows GameMCU's
Xiaomi SU7 showroom: its tunnel of streaks, its reflections laid
crisp over the paint, its glossy floor and its camera.