You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,20 @@ Additional features:
109
109
-**Fully responsive** layout (mobile, tablet, desktop) with safe-area support for iPhone
110
110
-**Animated space background** with twinkling stars and shooting stars
111
111
-**Image lightbox** for all galleries
112
+
-**Error Testing Lab** — Easter egg to demonstrate error handling (triple-click SPACEX in header)
113
+
114
+
## Error Testing Lab
115
+
116
+
The dashboard includes an **Error Testing Lab** to demonstrate how errors are handled across the stack. Useful for QA, demos, and onboarding.
117
+
118
+
**How to open:** Triple-click the "SPACEX" brand in the header (three clicks within ~500 ms).
119
+
120
+
**What it demonstrates:**
121
+
-**ErrorState** — Inline error panel with RETRY button (used across all views)
122
+
-**NotificationToast** — Toast notifications for non-blocking errors
123
+
-**API errors** — Real HTTP responses (404, 500, 502, 503, timeout) from the backend
124
+
125
+
The backend endpoint `GET /api/dev/trigger-error?code=404|500|502|503|timeout` returns simulated errors. The timeout variant waits 5 seconds before responding. See [Frontend README](frontend/README.md#error-testing-lab-easter-egg) and [Backend README](backend/README.md#error-testing-dev-endpoint) for details.
112
126
113
127
## API Endpoints
114
128
@@ -135,6 +149,7 @@ Additional features:
135
149
| GET |`/api/ai/fun-fact`| Random AI-generated SpaceX fun fact |
136
150
| GET |`/api/notifications/stream`| Server-Sent Events stream for real-time notifications |
137
151
| POST |`/api/notifications/send`| Send test notification (admin/internal) |
152
+
| GET |`/api/dev/trigger-error`| Easter egg: simulated errors (404, 500, 502, 503, timeout) for error-handling demos |
138
153
139
154
For detailed query parameters and response schemas, see the [Backend README](backend/README.md).
|`code`| string |`404`, `500`, `502`, `503`, `timeout`| Error type to simulate (default: `500`) |
228
+
229
+
**Behavior:**
230
+
-`404`, `500`, `502`, `503` — Returns immediately with the corresponding HTTP status and structured body `{ code, message, trace_id }`
231
+
-`timeout` — Waits 5 seconds, then returns 504 Gateway Timeout
232
+
233
+
**Use case:** The frontend Error Testing Lab (triple-click SPACEX) uses this endpoint to demonstrate `ErrorState`, `NotificationToast`, and API error handling. Also useful for manual testing via curl or browser. Rate limited to 30 requests per minute per IP.
Tests cover all 14 API route modules, all 15 service modules, error handling, caching behavior, and the AI service. Requires Redis running locally — the CI pipeline uses a Redis service container.
274
292
@@ -286,7 +304,7 @@ ruff format . # Auto-format
286
304
backend/
287
305
├── app/
288
306
│ ├── api/
289
-
│ │ ├── routes/ # One file per resource (14 route modules)
307
+
│ │ ├── routes/ # One file per resource (15 route modules, including dev.py)
| ErrorState | Error message with retry button and `retrying` spinner state |
106
107
| FunFact | AI-generated curiosity banner on site load with auto-dismiss (lazy-loaded via `defineAsyncComponent`) |
107
108
| ImageLightbox | Full-screen image viewer with keyboard navigation and focus trap |
@@ -181,6 +182,7 @@ frontend/
181
182
│ │ └── index.ts # 11 routes with lazy loading
182
183
│ ├── stores/
183
184
│ │ ├── dashboard.ts
185
+
│ │ ├── errorLab.ts
184
186
│ │ ├── fleet.ts
185
187
│ │ ├── launches.ts
186
188
│ │ ├── notifications.ts
@@ -239,6 +241,29 @@ Every view has a tailored loading state that mirrors its actual content structur
239
241
240
242
The `ErrorState` component includes a `retrying` prop that shows a spinner and "RETRYING..." label during automatic retry operations, avoiding UI flicker.
241
243
244
+
## Error Testing Lab (Easter Egg)
245
+
246
+
The dashboard includes a hidden **Error Testing Lab** to demonstrate error handling. See also the [Backend dev endpoint](backend/README.md#error-testing-dev-endpoint).
247
+
248
+
**How to open:** Triple-click the "SPACEX" brand in the header (three clicks within ~500 ms).
249
+
250
+
**Panel options:**
251
+
-**Show ErrorState** — Simulates an inline error on Overview with a RETRY button
252
+
-**Show error toast** — Displays a NotificationToast with type `error` (auto-dismisses after 12 s)
253
+
-**API errors (404, 500, 502, 503, timeout)** — Calls the backend `/api/dev/trigger-error` and shows the resulting error on Overview
0 commit comments