Skip to content

feat(backoffice): add superuser sanity-checks dashboard - #107

Draft
geourjoa wants to merge 1 commit into
mainfrom
feat/sanity-checks-backoffice-page
Draft

feat(backoffice): add superuser sanity-checks dashboard#107
geourjoa wants to merge 1 commit into
mainfrom
feat/sanity-checks-backoffice-page

Conversation

@geourjoa

@geourjoa geourjoa commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Cross-repo dependency: requires backend PRs archetype-pal/backend#151 (sanity-checks endpoint) and archetype-pal/backend#153 (SMTP test-email endpoint) to return real data — the UI is otherwise complete and independently testable.

There was previously no frontend surface at all for the backend's sanity-checks/SMTP-test endpoints (this project's "admin" is the Next.js backoffice, not Django admin).

  • services/backoffice/sanity-checks.ts — typed client for GET /api/v1/management/common/sanity-checks/ and POST .../test-email/, built on the existing api-client.ts pattern.
  • components/backoffice/sanity-checks-dashboard.tsx — migrations/services/storage/permissions cards plus an SMTP test-email form (hidden/explained when SMTP isn't configured, matching the backend's own short-circuit).
  • lib/format-bytes.ts — no byte-formatting utility existed in the repo; added one.
  • New page at /backoffice/sanity-checks, sidebar entry gated on is_superuser (not just is_staff, since the backend endpoints are superuser-only).
  • Translation keys added to both messages/en.json and messages/fr.json.

Test plan

  • vitest run — full suite 117 files / 1180 tests passed (includes en/fr key-parity test)
  • tsc --noEmit clean
  • eslint / prettier --check clean
  • Smoke test against the real backend once #151/#153 are merged

No new dependencies.

Surfaces the previously UI-less /management/common/sanity-checks/ endpoints:
pending migrations, dependent-service health (database/redis/meilisearch/
celery), DB and media storage sizes, filesystem writability, and an SMTP
status + send-test-email action. Calls the backend directly via the
existing api-client.ts pattern (no internal proxy route needed).

The sidebar link is gated on is_superuser rather than is_staff, since the
backend endpoints are superuser-only and would 403 for staff-only users.

Adds a small formatBytes() utility (lib/format-bytes.ts) since no
byte-formatting helper existed yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant