Summary
When the backend is in maintenance mode, it returns 503 Service unavailable. The frontend currently treats this like any other error — showing a generic "Błąd podczas ładowania quizu" (quiz loading error) page. We should detect the 503 and display a proper, user-friendly maintenance page instead.
Current behavior
When maintenance mode is active, the backend middleware (maintenance/middleware.py) returns:
503 with JSON body {"detail": "Service is unavailable"} (for Content-Type: text/plain requests)
503 with plain text "Service unavailable" (for other requests)
The frontend doesn't distinguish this from other errors and shows the generic error page with a misleading message about the quiz not existing or connection problems (see screenshot below).
What the user sees now:

This is confusing — the quiz exists, the backend is just temporarily down for maintenance.
Expected behavior
When any API call returns a 503 status code, the frontend should:
- Show a dedicated maintenance page/overlay with a clear message, e.g.:
- "Testownik jest w trakcie przerwy technicznej" / "Testownik is undergoing maintenance"
- "Wrócimy wkrótce!" / "We'll be back soon!"
- Not show error-specific UI like "quiz not found" or "try logging in"
- Optionally auto-retry — poll the backend every ~30s and automatically reload when it comes back (the backend lets
/api/login/ through even during maintenance, so a lightweight health-check could use that)
- Apply globally — this should be handled at the HTTP client interceptor level, not per-page, since any route can trigger it
Design suggestions
- A simple centered page with an illustration/icon (wrench, construction, etc.)
- The app header can remain visible
- Should feel intentional and calm, not like something broke
Backend context
The maintenance mode is toggled via django-constance (config.MAINTENANCE_MODE). The following paths are exempt and always work:
/api/admin/
/api/login/
/api/authorize/
Staff/superuser users are also exempt (they get normal responses even during maintenance).
Summary
When the backend is in maintenance mode, it returns
503 Service unavailable. The frontend currently treats this like any other error — showing a generic "Błąd podczas ładowania quizu" (quiz loading error) page. We should detect the 503 and display a proper, user-friendly maintenance page instead.Current behavior
When maintenance mode is active, the backend middleware (
maintenance/middleware.py) returns:503with JSON body{"detail": "Service is unavailable"}(forContent-Type: text/plainrequests)503with plain text"Service unavailable"(for other requests)The frontend doesn't distinguish this from other errors and shows the generic error page with a misleading message about the quiz not existing or connection problems (see screenshot below).
What the user sees now:

This is confusing — the quiz exists, the backend is just temporarily down for maintenance.
Expected behavior
When any API call returns a 503 status code, the frontend should:
/api/login/through even during maintenance, so a lightweight health-check could use that)Design suggestions
Backend context
The maintenance mode is toggled via
django-constance(config.MAINTENANCE_MODE). The following paths are exempt and always work:/api/admin//api/login//api/authorize/Staff/superuser users are also exempt (they get normal responses even during maintenance).