Skip to Content

Frontend Architecture

The frontend is a Next.js 15 application using App Router, Tailwind CSS, and Redux Toolkit.

Route Structure

src/app/ β”œβ”€β”€ page.tsx # Landing page β”œβ”€β”€ demo/ β”‚ └── page.tsx # Product demo (no auth required) β”œβ”€β”€ (dashboard)/ # Route group (requires auth) β”‚ β”œβ”€β”€ workspace/ β”‚ β”‚ └── page.tsx # Zettelkasten note editor β”‚ β”œβ”€β”€ graph-view/ β”‚ β”‚ └── page.tsx # Knowledge graph visualization β”‚ β”œβ”€β”€ recall/ β”‚ β”‚ └── page.tsx # AI-powered search β”‚ └── health/ β”‚ └── page.tsx # Graph health monitoring └── api/ └── auth/ └── [...nextauth]/ # NextAuth.js handlers

State Management

Redux Toolkit with the following slices:

SlicePurpose
graphKnowledge graph data (notes, links, stats)
healthGraph health monitoring configuration
importExportImport/export operations
recallSearch queries and results
chatAI assistant conversation
uiUI state (sidebar, demo mode, themes)

Key Components

StoreProvider

Wraps the app in Redux Provider. Includes a StoreInitializer that fetches initial data on mount β€” but skips fetches on /demo routes to avoid 503 errors.

Navigation with tool items (Workspace, Graph View, Recall, etc.) and system items (Health Monitor, Import/Export).

useActivityStream Hook

SSE consumer that connects to /api/activity/stream and pushes events into React state. Auto-reconnects on disconnect.

Styling

  • Tailwind CSS with custom cortex-* color palette
  • CSS Variables for theme consistency
  • Dark theme on landing/demo pages
  • Light theme on dashboard pages
Last updated on