Skip to content

Comments

"Add complete admin dashboard with Overview, Users, LLM Settings, and API Keys"#38

Open
makayo wants to merge 8 commits intoOC-Chatbot:mainfrom
makayo:feature/admin-dashboard-complete
Open

"Add complete admin dashboard with Overview, Users, LLM Settings, and API Keys"#38
makayo wants to merge 8 commits intoOC-Chatbot:mainfrom
makayo:feature/admin-dashboard-complete

Conversation

@makayo
Copy link
Contributor

@makayo makayo commented Dec 18, 2025

Summary

Complete admin dashboard implementation with all core features.

Features Added

Overview Tab

  • Total users, conversations, messages, active users statistics
  • Real-time data fetching from backend

Users Tab

  • User list table with sorting and search
  • Add/Edit/Delete user modals
  • Role management (user, admin, super-admin)
  • Pagination support

LLM Settings Tab

  • Model selection dropdown (GPT-2, GPT-3.5, GPT-4, GPT-4o Mini)
  • Temperature slider (0-2)
  • Max tokens input with validation
  • Rate limiting configuration
  • System prompt customization
  • Save settings with confirmation

API Keys Tab

  • Secure API key generation
  • Key masking (show last 4 chars only)
  • Key revocation/deletion
  • Usage logging

Authentication & Security

  • Universal test user for development
  • Mock authentication for local testing
  • Role-based access control (RBAC)
  • Password hashing with SHA-256

UI/UX Improvements

  • Modern, clean interface design
  • Consistent styling across all pages
  • Responsive design
  • Loading states and error handling

Testing

  • ✅ All tabs render correctly
  • ✅ CRUD operations working
  • ✅ API endpoints responding (200 OK)
  • ✅ Mock auth functioning properly
  • ✅ Frontend/backend integration verified

Screenshots

(Optional: Add screenshots of the admin dashboard)

- Removed next.config.ts and added next.config.mjs using ESM export style
- Defined rewrites to proxy /api/* requests from Next.js frontend to FastAPI backend
- Updated .gitignore to exclude Python cache files (__pycache__, *.pyc) and virtual environments
- Ensured node_modules and .next remain ignored
- Keeps repository clean by preventing build artifacts and compiled files from being tracked
- Introduced /admin/stats route with placeholder JSON for system metrics
- Added /admin/users route returning empty user list
- Added /admin/settings route returning empty settings object
- Ensures admin endpoints are visible in FastAPI docs for future expansion
…agement, and user management

- Add Overview, Users, LLM Settings, and API Keys tabs to admin dashboard
- Implement LLM Control Settings: model dropdown, temperature slider, max tokens, rate limit, system prompt
- Add API Key Management: secure key generation (sk_ prefixed), key hashing, masked display (last 4 chars)
- Create API endpoints: /admin/stats, /admin/settings, /admin/users, /admin/api-keys
- Implement mock auth bypass for development to prevent 401 errors
- Fix race condition in ProtectedRoute to wait for auth initialization
- Add recovery flows (password reset, username recovery)
- Wire frontend API client to backend with proper error handling and confirmation messages
- All settings persist in-memory on backend with optional usage logging
Consolidate to single test-user with admin role for consistent auth flow
@givecoffee givecoffee linked an issue Dec 18, 2025 that may be closed by this pull request
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.

User Story: Add Admin Page for Adjusting Prompt Parameters

1 participant