Overview
The OpenSight admin panel is a Next.js application located inapps/admin/ that provides platform administrators with tools to manage users, monitor system health, and view analytics.
Accessing the Admin Panel
The admin panel is a separate application from the main web app:- Main App: User-facing dashboard (apps/web)
- Admin Panel: Platform management (apps/admin)
Admin access requires an entry in the
admin_users table. Contact your system administrator for access.Authentication
Admin authentication is handled separately from regular user authentication:apps/admin/app/api/auth/login/route.ts
verifySession() function defined in apps/admin/lib/auth.ts.
Dashboard Overview
The main dashboard (apps/admin/app/(dashboard)/page.tsx) displays key platform metrics:
System Statistics
Total Users
Count of all registered users in the platform
Brands
Total number of brands being monitored
Admins
Number of admin accounts with panel access
System Health
Overall platform operational status
Statistics Implementation
apps/admin/app/(dashboard)/page.tsx
User Management
The Users page (apps/admin/app/(dashboard)/users/page.tsx) provides a complete view of registered users.
User List Features
- User Details: Name, email, plan tier, verification status
- Sorting: Users ordered by creation date (newest first)
- Plan Badges: Visual indicators for Free, Starter, and Growth plans
- Verification Status: Email verification tracking
- Join Date: Account creation timestamp
User Data Structure
apps/admin/app/(dashboard)/users/page.tsx
The user list is currently limited to the 50 most recent users. For full user management, consider implementing pagination.
Reports
The Reports page (apps/admin/app/(dashboard)/reports/page.tsx) is designed for analytics and system metrics.
Settings
The Settings page (apps/admin/app/(dashboard)/settings/page.tsx) will provide platform configuration options.
Settings features are planned to include:
- Admin user management
- System configuration
- Feature flags
- Integration settings
Admin Panel Structure
The admin panel uses a dashboard layout with sidebar navigation:Navigation Components
- AdminHeader (
components/admin-header.tsx): Top navigation bar with user menu - AdminSidebar (
components/admin-sidebar.tsx): Left sidebar with main navigation links
Available Routes
| Route | Purpose | Status |
|---|---|---|
/ | Dashboard overview | ✅ Active |
/users | User management | ✅ Active |
/reports | Analytics and reporting | 🚧 Planned |
/settings | System settings | 🚧 Planned |
Database Access
The admin panel connects directly to the database using Drizzle ORM:apps/admin/lib/db.ts
Admin panel queries have direct database access. Always verify admin authentication before executing queries.
Security Considerations
Authentication Requirements
- Session Verification: All admin routes check authentication via
verifySession() - Admin Table: Only users in
admin_userstable can access the panel - Separate Sessions: Admin sessions are isolated from regular user sessions
Best Practices
Seeding Admin Users
For development, you can seed an admin user using:apps/admin/app/api/auth/seed/route.ts.
Related Resources
Plans & Pricing
View subscription tiers and user plan limits
Integrations
Configure platform integrations and services