feat(backoffice): add superuser sanity-checks dashboard - #107
Draft
geourjoa wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forGET /api/v1/management/common/sanity-checks/andPOST .../test-email/, built on the existingapi-client.tspattern.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./backoffice/sanity-checks, sidebar entry gated onis_superuser(not justis_staff, since the backend endpoints are superuser-only).messages/en.jsonandmessages/fr.json.Test plan
vitest run— full suite 117 files / 1180 tests passed (includes en/fr key-parity test)tsc --noEmitcleaneslint/prettier --checkcleanNo new dependencies.