Skip to content

feat(admin): add gated admin panel with orders, KYC, and user views#337

Open
Emmanard wants to merge 1 commit into
kellymusk:mainfrom
Emmanard:feat/issue-331-admin-dashboard
Open

feat(admin): add gated admin panel with orders, KYC, and user views#337
Emmanard wants to merge 1 commit into
kellymusk:mainfrom
Emmanard:feat/issue-331-admin-dashboard

Conversation

@Emmanard

Copy link
Copy Markdown
Contributor

Summary

  • Guard /admin routes in middleware.ts via aframp_role cookie check; admin requests short-circuit before the existing rate-limit logic; matcher extended to ['/api/:path*', '/admin/:path*']
  • Add app/admin/layout.tsx — fixed 240px sidebar (desktop) + horizontal scroll nav bar (mobile) with links to Overview, Orders, KYC Review, Users, and Exit Admin
  • Add app/admin/page.tsx — overview dashboard with four metric cards (Total Orders, Pending KYC, Active Users, Total Volume) matching the glassmorphism pattern from components/bills/transaction-stats.tsx
  • Add app/admin/orders/page.tsx — order management table using OnrampOrder / OrderStatus types; quick-filter pills (All / Pending / Minting / Completed / Failed); sortable columns; pagination at 10/page
  • Add app/admin/kyc/page.tsx — KYC review queue using KycSubmission / KycStatus types; defaults to Pending Review filter; Approve / Reject buttons update local state immediately; reviewed rows reflect new status in badge
  • Add app/admin/users/page.tsx — user list with KYC tier, order count, volume, join date, last active; filterable by KYC status; sortable columns

All pages follow existing codebase patterns: 'use client' components, native HTML <table>, framer-motion row stagger, shadcn Badge / Button / Card, cn() utility, lucide-react icons.

Auth note

/admin is gated by an aframp_role cookie 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

  • Visiting /admin without aframp_role=admin cookie redirects to /dashboard
  • Setting aframp_role=admin cookie allows access to all /admin/* routes
  • Sidebar active state highlights correct link on each route
  • Mobile nav bar renders and scrolls horizontally on small screens
  • Overview metric cards render with stagger animation
  • Orders page: filter pills narrow table rows correctly; sort toggles asc/desc; pagination advances pages
  • KYC page: defaults to Pending Review; Approve/Reject buttons update badge immediately; reviewed rows move to correct tab on filter switch
  • Users page: KYC filter narrows list; sort by Orders/Volume/Joined works correctly
  • Existing /api/* rate limiting is unaffected

Closes #331

- 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>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@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.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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.

[Feature] Add admin dashboard for order management, KYC review, and system monitoring

1 participant