Skip to content

Commit 8d4e2d9

Browse files
authored
Add supply point map MVP with SQLite export and local OpenLayers UI (#20)
* feat: 補給地点マップMVPを追加 * fix: レビュー指摘とCI前提を反映 * docs: 主要関数にJSDocを追加 * fix: API上限とページングを追加
1 parent d79e4ca commit 8d4e2d9

14 files changed

Lines changed: 1930 additions & 2 deletions

File tree

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
node-version: [20, 22]
15+
node-version: [22, 24]
1616

1717
steps:
1818
- name: Checkout

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ dataform/.df-credentials.json
88
playwright-report/
99
test-results/
1010
data/
11+
.local/

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
- `apps/`: Cloud Run ジョブ/サービス
5050
- `dataform/`: Dataform 定義
51+
- `frontend/`: 補給地点マップの静的 UI
5152
- `terraform/`: IaC
5253
- `skills/`: 本リポジトリ用の作業スキル
5354

@@ -130,6 +131,34 @@ npm run bq:upsert:geocoded -- \
130131
- 取得元データに存在しない場合、`detail_url` は出力しません
131132
- `bq:upsert:geocoded``schemas/raw/stores_geocoded.json` を使って一時テーブルへロードし、`chain + store_id` 単位で最新 `geocoded_at` を残す Upsert を行います
132133

134+
## 補給地点マップ(ローカルMVP)
135+
136+
`mart.rideoasis_supply_points` をローカル `sqlite` にエクスポートし、GPX 経路の近傍にある補給地点を OpenLayers で確認できます。
137+
138+
1. BigQuery からローカル DB を作る
139+
140+
```bash
141+
npm run export:map-db -- \
142+
--project your-gcp-project \
143+
--output ./.local/rideoasis-map.db
144+
```
145+
146+
2. ローカルサーバを起動する
147+
148+
```bash
149+
npm run map:serve -- --db ./.local/rideoasis-map.db --port 8787
150+
```
151+
152+
3. ブラウザで `http://localhost:8787` を開き、GPX ファイルを選ぶ
153+
154+
MVP の仕様:
155+
156+
- API は `GET /api/supply-points` を返します
157+
- サーバ側では `bbox` / `chains` / `min_point_level` / `limit` で絞り込みます
158+
- 経路からの最短距離判定はブラウザ側で行います
159+
- 近傍距離はメートルで調整できます
160+
- `node:sqlite` を使うため、ローカル実行は Node.js `>=22.5.0` 前提です
161+
133162
## 注意事項
134163

135164
- クローリング対象サイトの利用規約/robots を確認し、アクセス頻度を制限します。

0 commit comments

Comments
 (0)