Enterprise-grade React dashboard for VRIN's Hybrid RAG system, featuring interactive knowledge graph visualization, real-time updates, and user-defined AI specialization management.
VRIN's frontend is a Next.js 15 application that provides a comprehensive dashboard for managing AI-powered knowledge graphs and expert specializations.
- Framework: Next.js 15 with App Router
- Runtime: React 19 with concurrent features
- Language: TypeScript with strict typing
- Styling: Tailwind CSS + shadcn/ui components
- State Management: TanStack Query + custom hooks
- Real-time: Socket.IO client for live updates
- Visualization: Cytoscape.js for knowledge graphs
app/ # Next.js App Router
βββ layout.tsx # Root layout with providers
βββ page.tsx # Landing page
βββ dashboard/ # Main dashboard interface
βββ auth/ # Authentication pages
βββ api/ # API route handlers
βββ knowledge-graph/ # Graph visualization pages
components/ # Feature-organized components
βββ dashboard/ # Dashboard-specific components
β βββ sections/ # Main dashboard sections
β βββ knowledge-graph/ # Graph visualization
β βββ layout/ # Navigation and layout
β βββ providers.tsx # Context providers
βββ ui/ # shadcn/ui base components
βββ [feature-components] # Landing page components
hooks/ # Custom React hooks
βββ use-auth.ts # Authentication state
βββ use-api-keys.ts # API key management
βββ use-knowledge-graph.ts # Graph data fetching
βββ use-real-time-updates.ts # Live updates
config/ # Configuration
βββ api.ts # Centralized API endpoints
types/ # TypeScript definitions
βββ knowledge-graph.ts # Core data models
TanStack Query for server state:
- API caching and synchronization
- Optimistic updates
- Background refetching
- Error handling and retries
Custom Hooks for domain logic:
use-auth.ts- User authentication and session managementuse-knowledge-graph.ts- Graph data fetching and real-time updatesuse-api-keys.ts- API key CRUD operationsuse-vrin-service.ts- Backend service integration
Real-time Updates:
- Socket.IO client for live graph updates
- Conflict resolution for simultaneous edits
- Real-time statistics and status indicators
- Real-time Visualization: Live graph updates using Cytoscape.js
- Multi-section Interface: Home, API Docs, API Keys, Settings
- Temporal Timeline: Time-based knowledge graph operations
- Conflict Resolution: Automatic handling of contradictory information
- Node Details: Interactive exploration of entities and relationships
- Custom Expert Configuration: Define domain-specific AI reasoning
- Specialization Management: Save and manage multiple expert profiles
- Analysis Depth Control: Surface, detailed, or expert-level analysis
- Reasoning Focus: Cross-document synthesis, causal chains, pattern detection
- Multi-key Support: Users can create multiple API keys
- Bearer Token Authentication: Secure JWT-based authentication
- User Isolation: Complete data separation by user_id
- Account Management: Registration, login, email verification
- shadcn/ui Foundation: Accessible, customizable component library
- Radix UI Primitives: Headless UI components with full accessibility
- Theme Support: Dark/light mode with next-themes
- Responsive Design: Mobile-first approach with Tailwind CSS
- Node.js 18+
- npm/yarn/pnpm
- Git
# Clone the repository
git clone <repository-url>
cd vrin
# Install dependencies
npm install
# Start development server
npm run dev- Development server:
npm run dev(http://localhost:3000) - Production build:
npm run build - Start production:
npm start - Lint code:
npm run lint
The frontend connects to VRIN's production AWS infrastructure:
- Auth API:
https://gp7g651udc.execute-api.us-east-1.amazonaws.com/Prod - RAG API:
https://thuiu23t0c.execute-api.us-east-1.amazonaws.com/dev - Authentication: Bearer token with JWT
- Real-time: Socket.IO for live updates
// Centralized API configuration
export const apiCall = async (endpoint: string, options: RequestInit = {}, apiKey?: string) => {
const url = `${API_CONFIG.BASE_URL}${endpoint}`;
const response = await fetch(url, {
headers: getAuthHeaders(apiKey),
...options
});
return response.json();
};
// Custom hooks for data fetching
export const useKnowledgeGraph = () => {
return useQuery({
queryKey: ['knowledge-graph'],
queryFn: () => apiCall('/graph'),
refetchInterval: 30000, // Real-time updates
});
};// Temporal knowledge graph with provenance
interface Triple {
subject: string;
predicate: string;
object: string;
confidence?: number;
timestamp?: Date;
source?: string;
status?: 'active' | 'deprecated' | 'conflicted';
}
// Interactive graph visualization
interface Node {
id: string;
name: string;
type: string;
connections?: number;
position?: { x: number; y: number };
}
// Real-time updates
interface GraphUpdate {
type: 'node_added' | 'edge_updated' | 'conflict_resolved';
timestamp: Date;
data: Node | Edge | ConflictResolution;
}- Atomic Design: Atoms (buttons) β Molecules (forms) β Organisms (sections)
- Feature Organization: Components grouped by dashboard sections
- Consistent Theming: CSS variables with Tailwind for dark/light modes
- Accessibility: ARIA compliance through Radix UI primitives
// Tailwind with custom theme configuration
const config: Config = {
darkMode: "class",
theme: {
extend: {
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
// ... comprehensive design tokens
}
}
}
}- Authentication: JWT tokens with secure storage
- API Security: Bearer token authentication for all requests
- Data Isolation: User-specific data filtering
- Input Validation: Client-side validation with server verification
- Next.js 15: Latest optimizations and concurrent features
- TanStack Query: Intelligent caching and background updates
- Code Splitting: Automatic route-based splitting
- Asset Optimization: Next.js built-in image and font optimization
- Platform: Vercel (recommended) or any Node.js hosting
- Build: Static generation with dynamic API routes
- Environment: Production API endpoints configured
- Monitoring: Real-time error tracking and performance monitoring
# Production environment variables
NEXT_PUBLIC_API_URL=https://api.vrin.cloud
NEXT_PUBLIC_AUTH_URL=https://auth.vrin.cloud
NEXT_PUBLIC_SOCKET_URL=https://realtime.vrin.cloud- β Real-time Knowledge Graphs - Live visualization of AI memory
- β User-Defined Experts - Customize AI reasoning for any domain
- β Temporal Intelligence - Time-aware fact management
- β Conflict Resolution - Automatic handling of contradictory information
- β Interactive Visualization - Cytoscape.js graph exploration
- β Modern React Architecture - Next.js 15 with latest features
- β Enterprise Authentication - Multi-key, secure user management
- β Production-Ready - Full AWS integration with real-time updates
- Architecture: See
CLAUDE.mdfor development guidelines - API Integration: Check
config/api.tsfor endpoint configuration - Component Library: shadcn/ui documentation for UI components
- State Management: TanStack Query docs for data fetching patterns
π VRIN Frontend represents the next generation of AI dashboard interfaces - combining real-time knowledge graph visualization with user-defined AI specialization management in a production-ready Next.js application.
Last updated: August 16, 2025 - Next.js 15 with React 19