rewrite phase 6

This commit is contained in:
2026-05-09 16:13:29 +02:00
parent b1c3cb99bd
commit a8700cedc8
6 changed files with 204 additions and 280 deletions
+10 -10
View File
@@ -14,7 +14,7 @@
## Phase 1 — Scaffold Next.js Project (~30 min)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 1 | Initialize Next.js with App Router, TypeScript, Tailwind CSS | [x] | [x] |
| 2 | Set up `tsconfig.json` with strict mode | [x] | [x] |
| 3 | Create `.env.example` with `PORT`, `HAFAS_URL`, `NOMINATIM_URL`, `OSRM_URL` | [x] | [x] |
@@ -27,7 +27,7 @@
## Phase 2 — Types + Library Layer (~2 hours)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 7 | Define TypeScript types in `src/types/index.ts` | [x] | [x] |
| 8 | Port `lib/hafas-client.ts` — HAFAS API client functions with proper types | [x] | [x] |
| 9 | Port `lib/calendar-utils.ts``extractEvents` + `cleanLocation` | [x] | [x] |
@@ -40,7 +40,7 @@
## Phase 3 — API Routes (~45 min)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 13 | `src/app/api/hafas/route.ts` — POST handler, same logic as Express | [x] | [x] |
| 14 | `src/app/api/calendar/route.ts` — GET handler for remote ICS | [x] | [x] |
| 15 | `src/app/api/calendar/parse/route.ts` — POST handler for ICS body | [x] | [x] |
@@ -53,7 +53,7 @@
## Phase 4 — Custom Hooks (~2.5 hours)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 19 | `useServerHealth.ts` — polls `/api/health` every 30s | [x] | [x] |
| 20 | `useClock.ts` — interval that updates `now` every 10s | [x] | [x] |
| 21 | `useGeolocation.ts` — wraps `navigator.geolocation` | [x] | [x] |
@@ -68,10 +68,10 @@
## Phase 5 — UI Components (~3.5 hours)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 27 | `ui/Chip.tsx` — small badge component | [x] | [x] |
| 28 | `ui/Button.tsx` — styled button | [x] | [x] |
| 29 | `ui/LoadingSpinner.tsx` — loading indicator | [x] | [ ] |
| 29 | `ui/LoadingSpinner.tsx` — loading indicator | [x] | [x] |
| 30 | `event/LeaveByBadge.tsx` — countdown badge | [x] | [x] |
| 31 | `event/JourneyList.tsx` — departure rows | [x] | [x] |
| 32 | `event/TrainSection.tsx` — train data in event card | [x] | [x] |
@@ -89,7 +89,7 @@
## Phase 6 — Calendar Page (~1 hour)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 41 | `calendar/CalendarView.tsx` — month grid component (NEW) | [x] | [x] |
| 42 | `calendar/DayEvents.tsx` — events for a selected day (NEW) | [x] | [x] |
| 43 | `app/calendar/page.tsx` — calendar route (NEW) | [x] | [x] |
@@ -99,7 +99,7 @@
## Phase 7 — Tests (~2 hours)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 44 | Migrate `server/__tests__/*.test.js``src/app/api/__tests__/*.test.ts` | [ ] | [ ] |
| 45 | Add unit tests for `calendar-utils.ts`, `countdown-utils.ts` in `src/lib/__tests__/` | [ ] | [ ] |
| 46 | Add API tests for `geocode` and `bike-route` in `src/app/api/__tests__/` (NEW) | [ ] | [ ] |
@@ -110,7 +110,7 @@
## Phase 8 — Cleanup (~30 min)
| # | Item | ✅ | ✔️ |
|---|------|----|----|
|---|---|----|-|
| 48 | Delete old `server/` directory | [ ] | [ ] |
| 49 | Delete old `oebb-planner-app/` directory | [ ] | [ ] |
| 50 | Delete `oebb-planner.jsx` | [ ] | [ ] |
@@ -121,4 +121,4 @@
**✅ Implemented** — Code exists and is in the repo.
**✔️ Reviewed** — Code has been reviewed for correctness against the plan.
`[ ]` pending required · `[x]` done · `[~]` optional/deferred (never blocks phase advancement)
`[ ]` pending required · `[x]` done · `[~]` optional/deferred (never blocks phase advancement)