A separate, production-grade admin panel for managing the Agentify platform.
This admin panel is built as a separate Next.js application that connects to the same Supabase database as the main application. This provides:
- Security: Isolated from main app, reduces attack surface
- Performance: Dedicated resources, no interference with user traffic
- Scalability: Can scale independently
- Maintenance: Updates don't affect main app
- Access Control: Different authentication, different domains
cd admin-panel
npm installCreate a .env.local file with the same environment variables as the main app:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Email Service (Resend)
RESEND_API_KEY=your_resend_api_key
# Admin Panel URL (for email tracking)
NEXT_PUBLIC_ADMIN_URL=http://localhost:3001
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/npm run devThe admin panel will run on http://localhost:3001
- Go to
http://localhost:3001(admin panel) - Sign in with your admin account
- You should now have access to the admin dashboard
Security Note: Admin promotion functionality has been disabled. Admin users are managed directly in the database for security purposes.
- Real-time analytics overview
- User statistics
- Waitlist management
- Beta invite tracking
- Conversion rate monitoring
- First-time sends: Send approval emails to newly approved users
- Resend functionality: Send emails multiple times to the same user
- Full tracking: Each send is tracked separately in the database
- Resend analytics: Track first-time vs resend email statistics
- Status tracking: Monitor delivery, open, and failure rates
- View all waitlist entries
- Send individual beta invites
- Send batch beta invites
- Track invite status
- Resend emails - Send approval emails multiple times with full tracking
- User growth metrics
- Conversion tracking
- Source attribution
- Role-based analytics
- Feature flags
- System configuration
- Admin user management
- Multi-factor Authentication: Via Clerk
- IP Whitelisting: Can be configured
- Session Management: Secure session handling
- Audit Logging: All admin actions logged
- Rate Limiting: API rate limiting
- CORS Configuration: Secure cross-origin requests
Main App: https://agentify.com
Admin Panel: https://admin.agentify.com
Main App: https://agentify.com
Admin Panel: https://agentify.com/admin
# Production URLs
NEXT_PUBLIC_APP_URL=https://agentify.com
NEXT_PUBLIC_ADMIN_URL=https://admin.agentify.com
# Security
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/admin-panel/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ └── admin/ # Admin-specific APIs
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Dashboard page
├── components/ # React components
│ └── ui/ # UI components
├── lib/ # Utilities
│ └── utils.ts # Helper functions
├── package.json # Dependencies
├── tailwind.config.ts # Tailwind config
└── tsconfig.json # TypeScript config
- Create API Routes: Add new endpoints in
app/api/admin/ - Create Pages: Add new pages in
app/ - Create Components: Add reusable components in
components/ - Update Types: Add TypeScript types as needed
The admin panel uses the same Supabase database as the main app, but with admin privileges through the service role key.
Uses Clerk for authentication, with admin status checked against the profiles.is_admin field in the database.
- Admin Access: Only users with
is_admin: truecan access the admin panel - API Protection: All admin APIs check for admin privileges
- Session Security: Secure session management via Clerk
- Audit Trail: All admin actions are logged for security
- Rate Limiting: API endpoints are rate-limited to prevent abuse
- Error Tracking: Integrate with Sentry or similar
- Performance Monitoring: Use Vercel Analytics or similar
- Uptime Monitoring: Monitor admin panel availability
- Security Monitoring: Monitor for suspicious activity
To update the admin panel:
- Pull latest changes
- Install new dependencies:
npm install - Run migrations if needed
- Deploy to production
- Test admin functionality
The admin panel can be updated independently of the main application.