Skip to content

Add Admin Dashboard for user management#3

Merged
Harrolee merged 3 commits intomainfrom
admin-dashboard
Dec 27, 2025
Merged

Add Admin Dashboard for user management#3
Harrolee merged 3 commits intomainfrom
admin-dashboard

Conversation

@Harrolee
Copy link
Copy Markdown
Owner

Summary

  • Add admin dashboard at /admin route for viewing and managing users
  • Implement admin-api Cloud Function with endpoints for user listing, detail, update, and chat history
  • Add admin authorization via email/phone allowlist (env vars) or is_admin JWT claim
  • Include Terraform configuration for deploying admin-api function
  • Add database migration for is_admin column on user_profiles

Features

  • User list: Paginated, searchable table of all users with key info
  • User detail: View/edit user settings (coach, spice level, image preference, active status)
  • Chat history: View a user's conversation history from GCS
  • Role-based access: Only admins can access the dashboard

Configuration Required

Add to terraform.tfvars:

admin_emails = "admin@example.com"
admin_phones = "+15551234567"

Add to webapp .env:

VITE_ADMIN_EMAILS=admin@example.com
VITE_ADMIN_PHONES=+15551234567

Test plan

  • Run Supabase migration: 20250815120001_add_is_admin_to_user_profiles.sql
  • Deploy admin-api function via Terraform
  • Configure admin email/phone in env vars
  • Log in as admin user and navigate to /admin
  • Verify user list loads with pagination
  • Test search functionality
  • Click a user to view details and chat history
  • Edit user fields and verify save works

🤖 Generated with Claude Code

Harrolee and others added 3 commits August 13, 2025 18:53
… 3 weeks. Not sure what they are or whether they work
…shboard

- Add Toaster component at app root so toast notifications work on all pages
- Remove redundant useEffect that was causing double API calls on initial load

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Harrolee Harrolee merged commit 747cb5a into main Dec 27, 2025
1 check passed
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