svelte-langgraph Svelte Themes

Svelte Langgraph

A production-ready SvelteKit dashboard for interacting with multiple AI assistants via LangGraph backends. Features real-time chat, Socket.IO integration, and Docker deployment support.

Svelte LangGraph

Build beautiful AI chat applications with SvelteKit, Flowbite UI, and LangGraph in minutes, not months.

A complete, production-ready framework for creating real-time AI chat applications with professional Flowbite components, advanced LangGraph assistants, streaming responses, and enterprise-grade deployment capabilities.

🎨 Beautiful by Default with Flowbite

Experience the power of professional design systems with our integrated Flowbite theme:

  • 🎯 50+ Pre-built Components - Buttons, cards, modals, forms ready to use
  • πŸŒ™ Dark/Light Mode - Automatic theme switching with user preferences
  • πŸ“± Mobile-First Design - Responsive components that work everywhere
  • β™Ώ Accessibility Built-in - WCAG compliant out of the box
  • 🎨 Customizable Themes - Easy branding and styling system
<!-- Beautiful AI chat in one component -->
<script>
  import { LangGraphFrontend } from 'svelte-langgraph';
</script>

<LangGraphFrontend 
  userId="user123" 
  theme="flowbite"
  darkMode={true}
/>

✨ Enterprise Features

πŸ€– Advanced LangGraph System

  • 6 Specialized Graphs: Chatbot, Persistent Chatbot, Code Assistant, Data Analyst, Creative Writer, Research Assistant
  • Open-Source LangGraph: Uses standard StateGraph/CompiledGraph - no Platform dependency required
  • Optional Platform Support: Can be extended to use LangGraph Platform if desired
  • Thread-based Conversations: Stateful conversations with automatic persistence (in-memory or external)
  • Multiple AI Providers: OpenAI GPT-4, Anthropic Claude, with easy extensibility
  • Streaming Responses: Real-time token-by-token response rendering
  • Tool Integration: Web search, data analysis, and custom tools with intelligent routing

πŸ” Production Security

  • JWT Authentication: Secure token-based auth with role-based access control
  • Rate Limiting: Built-in protection against abuse and spam
  • Input Validation: Comprehensive sanitization and validation
  • Security Headers: CORS, CSP, and other security best practices

⚑ Real-time Communication

  • Modular Socket.IO Architecture: Clean, maintainable WebSocket implementation
  • Conversation Management: Thread-based conversation persistence (configurable backend)
  • Graph Health Monitoring: Real-time status tracking for all LangGraph instances
  • Memory Management: Advanced streaming with automatic cleanup
  • Connection Resilience: Automatic reconnection and graceful error handling

🐳 Deployment Ready

  • Docker Compose: One-command deployment with optional Postgres + Redis
  • Production Config: Nginx, SSL, monitoring, and comprehensive health checks
  • Flexible Persistence: In-memory (default) or PostgreSQL for conversation storage
  • Optional Task Queue: Redis support for advanced workflows
  • Cloud Ready: AWS, GCP, Azure deployment examples
  • CI/CD Pipelines: GitHub Actions workflows included

πŸ“‹ Requirements

  • Node.js: 22.x or later (Current LTS)
  • pnpm: 9.x or later
  • Python: 3.12+ (for backend)
  • Docker: Latest version (recommended for deployment)

Note: Node.js 20 and earlier versions are not supported. This project requires Node.js 22+ for optimal performance and latest ECMAScript features.

πŸš€ Quick Start

Get everything running in under 2 minutes:

# 1. Clone and setup
git clone https://github.com/synergyai-nl/svelte-langgraph.git
cd svelte-langgraph

# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys:
# OPENAI_API_KEY=your-key-here
# ANTHROPIC_API_KEY=your-key-here
# LANGSMITH_API_KEY=your-langsmith-key

# 3. Launch everything
docker-compose up -d

# 4. Open your browser
open http://localhost:3000

Demo credentials: demo / secret

Option 2: Development Setup

For customization and development:

# Optional: Infrastructure for persistence (Terminal 1)
docker-compose up -d postgres redis

# Backend (Terminal 2)
cd examples/langgraph-backend
uv run serve

# Frontend (Terminal 3)  
cd examples/dashboard
pnpm install && pnpm dev

# Visit http://localhost:5173

πŸ“– Comprehensive Documentation

Our worldclass documentation covers everything from 5-minute quickstart to enterprise deployment:

πŸš€ Getting Started

πŸ“– Guides

πŸ“‹ API Reference

πŸ”§ Advanced

πŸ—οΈ Architecture Overview

Built with modern, scalable architecture patterns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    WebSocket    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    HTTP/Streaming    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Browser       β”‚ ◄─────────────► β”‚   SvelteKit     β”‚ ◄──────────────────► β”‚   FastAPI       β”‚
β”‚   (Flowbite UI) β”‚                 β”‚   Frontend      β”‚                      β”‚   LangGraph     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚                                         β”‚
                                            β–Ό                                         β–Ό
                                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                    β”‚    Socket.IO    β”‚                      β”‚ LangGraph Serverβ”‚
                                    β”‚     Server      β”‚                      β”‚ + AI Assistants β”‚
                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Modern Tech Stack

  • Frontend: SvelteKit 2.0 + Svelte 5 + TypeScript + Tailwind CSS v4
  • UI Components: Flowbite Svelte with comprehensive theme system
  • Backend: FastAPI + LangGraph (open-source) + LangChain + Socket.IO
  • AI Integration: OpenAI GPT-4, Anthropic Claude, extensible agent system
  • Database: Optional PostgreSQL + Redis (in-memory by default)
  • Deployment: Docker Compose + Nginx + SSL + monitoring

🎯 Use Cases

Perfect for building:

  • πŸ€– AI Chat Applications - Customer support, personal assistants
  • πŸ’» Code Assistant Tools - Developer productivity, code review
  • πŸ“Š Data Analysis Platforms - Business intelligence, reporting
  • ✍️ Content Creation - Writing assistants, creative tools
  • πŸ” Research Applications - Information gathering, analysis
  • 🏒 Enterprise Chatbots - Internal tools, knowledge management

πŸ“¦ Package Structure

Monorepo Organization

svelte-langgraph/
β”œβ”€β”€ packages/
β”‚   └── svelte-langgraph/           # πŸ“¦ Complete library package
β”‚       β”œβ”€β”€ components/             #    Flowbite UI components
β”‚       β”œβ”€β”€ stores/                 #    Socket.IO & state management  
β”‚       β”œβ”€β”€ themes/                 #    Flowbite theme system
β”‚       └── types.ts                #    LangChain-compatible types
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ dashboard/                  # 🎨 SvelteKit frontend example
β”‚   └── langgraph-backend/          # πŸš€ FastAPI backend example
β”œβ”€β”€ docs/                           # πŸ“š Comprehensive documentation
β”œβ”€β”€ nginx/                          # 🌐 Production nginx config
└── docker-compose.yml              # 🐳 Full-stack deployment

Key Features by Package

πŸ“¦ svelte-langgraph Package:

  • Complete Svelte integration for LangGraph
  • Socket.IO client with automatic reconnection
  • Flowbite theme system with dark mode
  • TypeScript definitions for LangChain compatibility
  • Reactive stores for real-time state management

🎨 Frontend Example:

  • Professional Flowbite UI components
  • Real-time chat with streaming responses
  • Multi-conversation management
  • User authentication and authorization
  • Internationalization with Inlang/Paraglide

πŸš€ Backend Example:

  • 6 specialized LangGraph StateGraph implementations
  • FastAPI with open-source LangGraph integration
  • JWT authentication with RBAC
  • Socket.IO server for real-time communication
  • Production-ready logging and monitoring

🌟 Flowbite Integration Highlights

Professional Design System

<!-- Automatic Flowbite theming -->
<LangGraphFrontend userId="user123" theme="flowbite" />

<!-- Custom theme variants -->
<ThemeProvider theme={flowbiteTheme} variant="dark">
  <ChatInterface />
</ThemeProvider>

<!-- Runtime theme customization -->
<ThemeProvider theme={customTheme} override={brandColors}>
  <LangGraphFrontend userId="user123" />
</ThemeProvider>

Component Examples

  • Chat Interface: Professional message bubbles with avatars
  • Sidebar Navigation: Collapsible conversation list with search
  • Settings Panel: Form controls with validation and feedback
  • Loading States: Skeleton screens and progress indicators
  • Error Handling: Toast notifications and error boundaries

Responsive Design

  • Desktop: Full-featured layout with sidebars and panels
  • Tablet: Adaptive layout with collapsible navigation
  • Mobile: Touch-optimized interface with bottom navigation

πŸš€ Getting Started Paths

Choose your journey:

I want to... Start here Time needed
Try it quickly Quick Start 5 minutes
Learn step-by-step Complete Tutorial 30 minutes
Customize the UI Flowbite Theme Guide 15 minutes
Deploy to production Deployment Guide 1 hour
Understand the architecture Architecture Deep Dive 20 minutes

πŸ’‘ Live Examples

Explore these demo routes in the example app:

  • / - Main dashboard with Flowbite components
  • /flowbite - Flowbite theme showcase
  • /demo/paraglide - Internationalization demo
  • /api/health - Backend health check endpoint

πŸ› οΈ Development

Quick Development Setup

# Install all dependencies (monorepo)
pnpm install

# Start backend
cd examples/langgraph-backend && uv run serve

# Start frontend (new terminal)
cd examples/dashboard && pnpm dev

# Visit http://localhost:5173

Package Development

# Build library package
cd packages/svelte-langgraph && pnpm build

# Run all tests
nx run-many -t test

# Lint and type check
nx run-many -t lint,check

Quality Assurance

# Run all quality checks
nx run-many -t test,lint,check --output-style=stream

# Frontend-specific
cd examples/dashboard
pnpm test        # Unit tests
pnpm test:e2e    # End-to-end tests
pnpm check       # TypeScript check
pnpm lint        # ESLint
pnpm format      # Prettier

# Backend-specific  
cd examples/langgraph-backend
uv run pytest           # Unit tests
uv run ruff check .     # Lint
uv run ruff format .    # Format
uv run pyright          # Type check

🐳 Production Deployment

# Production deployment
cp .env.example .env  # Configure with real API keys
docker-compose -f docker-compose.prod.yml up -d

# Includes:
# - Nginx reverse proxy with SSL
# - PostgreSQL database
# - Redis for session storage  
# - Prometheus + Grafana monitoring

Cloud Platforms

  • AWS: ECS + RDS deployment example
  • Google Cloud: Cloud Run + Cloud SQL example
  • Vercel: Frontend deployment with serverless backend
  • Kubernetes: Complete K8s manifests with ingress

See the Deployment Guide for detailed instructions.

πŸ”’ Security & Authentication

  • JWT Tokens: Secure authentication with configurable expiration
  • Role-Based Access: User, moderator, and admin permission levels
  • Rate Limiting: API protection against abuse and spam
  • Input Validation: Comprehensive sanitization with Pydantic
  • Security Headers: CORS, CSP, and other security best practices
  • SSL/TLS: Production-ready HTTPS configuration

πŸ“Š Monitoring & Observability

  • Health Checks: Comprehensive endpoint monitoring
  • Structured Logging: JSON logs with correlation IDs
  • Metrics Collection: Prometheus metrics for all services
  • Error Tracking: Sentry integration for error monitoring
  • Performance Monitoring: Response time and throughput tracking

🀝 Contributing

We welcome contributions! See our Contributing Guide for:

  • Development Setup: Local environment configuration
  • Code Standards: TypeScript, ESLint, and formatting rules
  • Testing Guidelines: Unit, integration, and E2E testing
  • Pull Request Process: Review and merge workflow

πŸ“„ License

MIT Β© Svelte LangServe Contributors

πŸ†˜ Support

πŸŽ‰ What's Next?

Ready to build amazing AI applications? Start with our 5-minute Quick Start Guide β†’


Built with ❀️ using SvelteKit, Flowbite, and LangGraph

Documentation β€’ Quick Start β€’ Live Demo β€’ GitHub

Top categories

Loading Svelte Themes