A production-ready, fully-featured dashboard for VantageEdge API Gateway with synchronized authentication, real-time data, and modern UI/UX.
All features implemented, tested, and deployed to production (Vercel).
- Space Grotesk Font - Modern, geometric sans-serif typography
- Purple/Pink Gradient Theme - Distinctive color palette with dark mode
- Glassmorphism Effects - Modern frosted glass UI components
- Framer Motion Animations - Smooth, delightful page transitions
- Grid & Dot Patterns - Subtle background textures
- Gradient Text - Eye-catching headings with gradient effects
- Custom Animations - Shimmer loading, fade, scale effects
- Auto-sync with Backend - User and tenant automatically synced on login
- Clerk Integration - Beautiful, secure authentication UI
- Organization Support - Multi-tenant with Clerk organizations
- Token Management - Automatic JWT token handling in all API calls
- API Key Authentication - Support for service-to-service auth
- Type-Safe API Client - Full TypeScript support with proper types
- Auth Sync Service - Dedicated service for backend synchronization
- Dual API Clients - Separate clients for auth and tenant operations
- Theme Support - Dark mode with system preference detection
- State Management - React Query for server state, Zustand for client state
- Error Handling - Comprehensive error interceptors and user feedback
- Install dependencies
npm install- Configure environment
cp .env.example .env.local
# Add your Clerk keys and API URL- Run development server
npm run dev- β Landing Page - Modern hero section with gradient effects
- β Auth Pages - Glassmorphic sign-in/sign-up with Clerk
- β Dashboard Overview - Real-time stats, top routes, quick actions
- β Services Management - Full CRUD for backend origins
- β Routes Configuration - Create, edit, delete routes with auth modes
- β API Keys - Generate, view, and manage API keys securely
- β Analytics Dashboard - Real-time metrics and request analytics
- β Cache Explorer - View and manage cached entries
- β Settings - Tenant settings with tenant ID display
- β Button - Multiple variants (default, outline, ghost, destructive)
- β Card - Glassmorphic cards with hover effects
- β Badge - Status indicators and labels
- β Input - Form inputs with proper styling
- β Label - Form labels
- β Dialog - Modal dialogs for forms
- β Dashboard Shell - Sidebar navigation with active states
- β Add Origin Dialog - Create/edit backend services
- β Add Route Dialog - Configure routing rules
- β Automatic User/Tenant Sync - Seamless backend synchronization
- β JWT Token Handling - Automatic token injection in API calls
- β API Key Authentication - Support for X-API-Key header
- β Real-time Data Fetching - All data from live API endpoints
- β CRUD Operations - Create, read, update, delete for all resources
- β Search & Filtering - Search functionality across resources
- β Responsive Design - Mobile-first, works on all devices
- β Loading States - Shimmer effects and skeleton loaders
- β Error Handling - User-friendly error messages with retry
- β Toast Notifications - Success/error feedback with Sonner
- β Copy to Clipboard - Easy tenant ID and API key copying
- User signs in with Clerk
- Frontend automatically syncs with backend:
- POST /api/v1/auth/sync-user (creates user record)
- POST /api/v1/auth/sync-tenant (creates tenant if needed)
- Tenant ID resolved from Clerk user/org ID
- All API calls include JWT token in Authorization header
- Backend validates token and maps to internal user/tenant
- User can access all dashboard features
- Framework: Next.js 14.2.5 (App Router)
- Language: TypeScript 5.4.5
- Styling: Tailwind CSS 3.4.4 + Custom animations
- UI Library: Radix UI primitives (shadcn/ui)
- Auth: Clerk 5.1.0 (with org support)
- Animations: Framer Motion 11.2.10
- Data Fetching: TanStack Query 5.40.0
- API Client: Axios 1.7.2 with interceptors
- Theme: next-themes 0.3.0
- Toast: Sonner 1.4.41
- Forms: React Hook Form 7.51.5 + Zod 3.23.8
- Icons: Lucide React 0.395.0
app/
βββ auth/
β βββ sign-in/[[...sign-in]]/ # Clerk sign in page
β βββ sign-up/[[...sign-up]]/ # Clerk sign up page
βββ dashboard/
β βββ layout.tsx # Dashboard shell with sidebar
β βββ page.tsx # Overview with real-time stats
β βββ services/ # Origin/Service management
β βββ routes/ # Route configuration
β βββ api-keys/ # API key management
β βββ analytics/ # Real-time analytics
β βββ cache/ # Cache explorer
β βββ settings/ # Tenant settings
βββ layout.tsx # Root layout with providers
βββ page.tsx # Landing page
βββ globals.css # Custom styles & animations
components/
βββ dashboard/
β βββ shell.tsx # Sidebar + header navigation
β βββ add-origin-dialog.tsx # Create/edit origins
β βββ add-route-dialog.tsx # Create/edit routes
βββ ui/
β βββ button.tsx # Button component
β βββ card.tsx # Card component
β βββ badge.tsx # Badge component
β βββ input.tsx # Input component
β βββ label.tsx # Label component
β βββ dialog.tsx # Dialog component
βββ providers.tsx # Query + Theme + Auth providers
lib/
βββ api/
β βββ client.ts # Server-side API client
β βββ client-api.ts # Browser API client (tenant-based)
β βββ auth-sync.ts # Auth synchronization service
βββ auth/
β βββ sync.ts # User/tenant sync utilities
βββ contexts/
β βββ tenant-context.tsx # Tenant context provider
βββ types/
β βββ index.ts # TypeScript type definitions
βββ utils.ts # Utility functions
# Clerk (REQUIRED)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_SECRET_KEY=sk_test_xxx
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/auth/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/auth/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# API
NEXT_PUBLIC_API_URL=https://vantageedge.onrender.com
NEXT_PUBLIC_GATEWAY_URL=http://localhost:8000- Primary: Purple (hsl(262 83% 58%))
- Secondary: Slate
- Success: Green (#22C55E)
- Warning: Orange (#F97316)
- Destructive: Red (#EF4444)
- Muted: Subtle grays for backgrounds
- Font: Space Grotesk (geometric sans-serif)
- Headings: Bold with tight tracking
- Gradient Text: Purple to pink gradient for emphasis
- Monospace: For code, IDs, and technical data
- Glassmorphism:
bg-background/80 backdrop-blur-xl - Shadows: Subtle, layered shadows for depth
- Animations: Smooth transitions (300ms)
- Patterns: Grid and dot backgrounds
- Hover Effects: Scale and shadow on interactive elements
# Install dependencies
npm install
# Run dev server
npm run dev
# Type check
npm run type-check
# Build for production
npm run build
# Start production server
npm start- Push to GitHub
- Import in Vercel
- Add environment variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYNEXT_PUBLIC_API_URL
- Deploy automatically on push
Current Production URL: https://vantageedge.vercel.app
docker build -t vantageedge-frontend .
docker run -p 3000:3000 vantageedge-frontendFully integrated with VantageEdge Go backend:
β Auth Endpoints
- POST /api/v1/auth/sync-user
- POST /api/v1/auth/sync-tenant
- GET /api/v1/auth/me
- GET /api/v1/auth/tenant
β Resource Endpoints
- Tenants: CRUD operations
- Origins: Full CRUD with health checks
- Routes: Create, update, delete with auth modes
- API Keys: Generate, list, delete with secure hashing
- Analytics: Real-time metrics and statistics
- Cache: View and manage cached entries
β Authentication
- JWT tokens validated by backend
- API key authentication supported
- Clerk user/org IDs mapped to internal tenant IDs
- All dashboard data fetched from live API
- No hardcoded data - everything is dynamic
- Auto-refresh for analytics (30s interval)
- Loading states with shimmer effects
- Smooth page transitions with Framer Motion
- Responsive sidebar navigation
- Search functionality across all resources
- Copy-to-clipboard for IDs and keys
- Toast notifications for all actions
- Error handling with retry options
- Automatic tenant creation on signup
- Tenant ID visible in settings
- All resources scoped to tenant
- Clerk organization support
- Build Status: β Compiles successfully
- Type Safety: β 100% TypeScript coverage
- Linting: β No errors
- Deployment: β Live on Vercel
- Backend: β Deployed on Render
- Database: β PostgreSQL with 6 migrations
- Cache: β Redis integration
- β Auth sync happens automatically on every sign-in
- β All API calls include JWT token automatically
- β Theme persists across sessions (dark mode)
- β Responsive design works on all devices
- β All CRUD operations fully functional
- β Real-time analytics with auto-refresh
- β Cache management with search
- β Tenant ID display and copying
- β API key generation with secure prefixes
- β Complete user authentication flow
- β Automatic backend synchronization
- β Full CRUD for all resources
- β Real-time analytics dashboard
- β Cache exploration and management
- β API key generation and management
- β Route configuration with multiple auth modes
- β Service/origin management with health checks
- β Settings page with tenant information
- β Production deployment on Vercel