feat(admin): add gated admin panel with orders, KYC, and user views#337
Open
Emmanard wants to merge 1 commit into
Open
feat(admin): add gated admin panel with orders, KYC, and user views#337Emmanard wants to merge 1 commit into
Emmanard wants to merge 1 commit into
Conversation
- guard /admin routes in middleware via aframp_role cookie - add admin layout with sidebar nav and mobile scroll bar - add overview dashboard with metric cards - add orders, KYC review, and users pages (mock data) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Emmanard is attempting to deploy a commit to the kelly musk's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Emmanard Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
/adminroutes inmiddleware.tsviaaframp_rolecookie check; admin requests short-circuit before the existing rate-limit logic; matcher extended to['/api/:path*', '/admin/:path*']app/admin/layout.tsx— fixed 240px sidebar (desktop) + horizontal scroll nav bar (mobile) with links to Overview, Orders, KYC Review, Users, and Exit Adminapp/admin/page.tsx— overview dashboard with four metric cards (Total Orders, Pending KYC, Active Users, Total Volume) matching the glassmorphism pattern fromcomponents/bills/transaction-stats.tsxapp/admin/orders/page.tsx— order management table usingOnrampOrder/OrderStatustypes; quick-filter pills (All / Pending / Minting / Completed / Failed); sortable columns; pagination at 10/pageapp/admin/kyc/page.tsx— KYC review queue usingKycSubmission/KycStatustypes; defaults to Pending Review filter; Approve / Reject buttons update local state immediately; reviewed rows reflect new status in badgeapp/admin/users/page.tsx— user list with KYC tier, order count, volume, join date, last active; filterable by KYC status; sortable columnsAll pages follow existing codebase patterns:
'use client'components, native HTML<table>, framer-motion row stagger, shadcnBadge/Button/Card,cn()utility, lucide-react icons.Auth note
/adminis gated by anaframp_rolecookie check in middleware. This is placeholder access control for pre-launch scaffolding only — it stops casual navigation but is trivially bypassable client-side and binds to no user identity. All admin pages currently render mock data; no real data is exposed. Before real data is wired in, this must be replaced with proper session-based auth (issued + verified server-side, with per-request authorization enforced at the data-fetch layer, not solely in middleware).Test plan
/adminwithoutaframp_role=admincookie redirects to/dashboardaframp_role=admincookie allows access to all/admin/*routes/api/*rate limiting is unaffectedCloses #331