Skip to content

feat: implement fully functional admin panel, express api endpoints, …#369

Open
Brayan114 wants to merge 1 commit into
SecureBananaLabs:mainfrom
Brayan114:brayan-admin-panel-fix
Open

feat: implement fully functional admin panel, express api endpoints, …#369
Brayan114 wants to merge 1 commit into
SecureBananaLabs:mainfrom
Brayan114:brayan-admin-panel-fix

Conversation

@Brayan114
Copy link
Copy Markdown

Summary

Resolves #29

This PR implements a fully functional, highly secure, and accessible Admin Panel dashboard to replace the placeholder page.

Changes Made:

  • Database Layer (packages/db): Added Dispute (with PENDING, RESOLVED, REJECTED status) and AuditLog models to the Prisma schema.
  • Backend API (apps/api):
    • Implemented adminOnlyMiddleware role-verification middleware inside auth.js.
    • Added protected Express routes under /api/admin/* for /metrics, /disputes, /users/:id/status, and /audit-log matching required test specifications.
    • Configured unit tests verifying that unauthorized roles are blocked with a 403.
  • Frontend UI (apps/web):
    • Created a global api.ts fetch client with authorization headers.
    • Built a high-fidelity, responsive dark-mode dashboard inside page.tsx using custom CSS modules (glassmorphic UI variables, neon grids, and status badges).
    • Added a developer-mode "Generate Admin Session" simulator to easily test and verify mock Admin states locally without running an auth server.
    • Handles empty, loading, and error states gracefully with full ARIA accessibility support.

How did you test this change?

  • Ran the Express integration test suite (node --test apps/api/src/tests/health.test.js apps/api/src/tests/admin.test.js) — all checks passed.
  • Successfully built the Next.js production package (Exit Code 0).

Proof of Work:

Recording.2026-05-20.012558.mp4

Are there any deployment considerations?

Requires running prisma migrate dev on deployment to apply the new Dispute and AuditLog database schemas.

Does this work require review from our design team?

No, the styling was implemented directly with local CSS modules using custom design variables aligned with the existing application theme.


/claim #29

github-actions Bot added a commit that referenced this pull request May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a fully functional Admin Panel

1 participant