Skip to content

Modern dual-registry Shadcn/ui component system with AI-powered chat interface and FastAPI backend. Features Google Gemini integration, streaming responses, and production-ready deployment with uv package management.

Notifications You must be signed in to change notification settings

Qredence/hax-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ HAX UI Registry - Advanced Chat Component Library

HAX UI Registry TypeScript FastAPI TailwindCSS uv

A sophisticated chat-optimized component library with FastAPI backend and AI integration.

License: MIT Python Node.js

πŸ“– Documentation β€’ 🧩 Components β€’ πŸš€ Getting Started β€’ ⚑ Features


🌟 Overview

HAX UI Registry is an enterprise-grade component library that combines the power of Shadcn/ui with specialized chat-optimized components. Built with modern React patterns, TypeScript, and FastAPI backend, it provides a comprehensive solution for building sophisticated chat interfaces with AI integration capabilities.

🎯 Key Highlights

  • πŸ”§ Dual-Registry System: Seamlessly use both standard Shadcn/ui and HAX components
  • πŸ’¬ Chat-Optimized: Specialized components for chat interfaces with advanced features
  • πŸ€– AI Integration: Built-in support for Google Gemini API with BYOK architecture
  • ⚑ FastAPI Backend: Modern async Python backend with automatic API documentation
  • 🌊 Real-time Streaming: Server-Sent Events for real-time chat responses
  • πŸ“¦ uv Package Management: Fast, modern Python dependency management
  • β™Ώ Accessibility: WCAG-compliant components with ARIA support
  • πŸ”’ Security: Built-in security scanning and vulnerability detection
  • 🐳 Docker Ready: Production-ready containerization for easy deployment

πŸš€ Getting Started

Prerequisites

  • Node.js: >= 20.0.0
  • Python: >= 3.11
  • pnpm: >= 10.14.0
  • uv: Fast Python package manager
  • Git: For version control

Quick Start

  1. Clone the repository:

    git clone https://github.com/Qredence/hax-ui.git
    cd hax-ui
  2. Install frontend dependencies:

    pnpm install
  3. Setup backend with uv:

    cd backend
    curl -LsSf https://astral.sh/uv/install.sh | sh  # Install uv if needed
    ./start.sh  # Creates .venv and starts FastAPI server
  4. Start frontend (in another terminal):

    pnpm dev
  5. Access the application:

Docker Deployment

# Quick start with Docker Compose
docker-compose up -d

# Access at http://localhost:8080

⚑ Features

πŸ€– AI Integration

  • Google Gemini API: Advanced AI chat with streaming responses
  • BYOK Architecture: Bring Your Own Key for security
  • Thought Processing: Visualize AI reasoning process
  • Real-time Streaming: Instant response streaming via SSE

🎨 Design System

  • Dual Registry: Use both Shadcn/ui and HAX components
  • TailwindCSS: Utility-first styling with custom design tokens
  • Consistent Variants: Unified design language across components
  • Custom Themes: Easy theme customization and dark mode

πŸ”’ Security & Quality

  • Type Safety: Full TypeScript frontend + Pydantic backend
  • Security Headers: CORS, CSP, and other security measures
  • Input Validation: Comprehensive request/response validation
  • Error Handling: Graceful error handling and user feedback

πŸš€ Developer Experience

  • Hot Reload: Instant development feedback
  • Component Registry: Install components via CLI
  • API Documentation: Automatic OpenAPI docs generation
  • Comprehensive Testing: Vitest (frontend) + pytest (backend)

🧩 Components

HAX Chat Components

πŸ’¬ HaxChatInput

Advanced chat input with thinking mode and auto-resize:

import { HaxChatInput } from '@/components/hax/chat/chat-input'

<HaxChatInput
  input={input}
  onInputChange={setInput}
  onSubmit={sendMessage}
  isLoading={isLoading}
  thinkingMode={thinkingMode}
  onToggleThinking={toggleThinking}
/>

πŸ’­ HaxChatMessage

Rich message display with thought processing:

import { HaxChatMessage } from '@/components/hax/chat/chat-message'

<HaxChatMessage
  message={{
    id: '1',
    content: 'Hello! How can I help?',
    role: 'assistant',
    timestamp: new Date(),
    thoughts: 'User is greeting me, I should respond warmly'
  }}
  showActions={true}
/>

πŸ—£οΈ HaxChatConversation

Full conversation interface with auto-scroll:

import { HaxChatConversation } from '@/components/hax/chat/chat-conversation'

<HaxChatConversation
  messages={messages}
  onSendMessage={sendMessage}
  isLoading={isLoading}
/>

HAX UI Components

πŸ”˜ HaxButton

Chat-optimized button variants:

import { HaxButton } from '@/components/hax/ui/button'

<HaxButton variant="chat-send" size="chat-icon">
  <ArrowUp size={16} />
</HaxButton>

Variants: default, chat, chat-send, chat-thinking Sizes: default, sm, lg, icon, chat-icon

πŸ› οΈ Development

Available Scripts

# Frontend Development
pnpm dev              # Start Vite dev server (port 8080)
pnpm build            # Production build
pnpm test             # Run Vitest tests
pnpm typecheck        # TypeScript validation

# Backend Development (uses uv)
cd backend
./start.sh            # Quick start (creates .venv automatically)
uv run pytest        # Run tests
uv sync --dev         # Install dependencies

# Full Stack
docker-compose up     # Start entire stack

Project Structure

β”œβ”€β”€ client/                    # React frontend
β”‚   β”œβ”€β”€ components/hax/        # HAX component system
β”‚   β”‚   β”œβ”€β”€ ui/               # HAX UI components
β”‚   β”‚   β”œβ”€β”€ chat/             # Chat components
β”‚   β”‚   └── layout/           # Layout components
β”‚   β”œβ”€β”€ services/             # API services
β”‚   └── hooks/                # React hooks
β”œβ”€β”€ backend/                  # FastAPI Python backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/v1/          # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”‚   └── schemas/         # Pydantic models
β”‚   └── .venv/               # Local virtual environment
β”œβ”€β”€ hax-registry/            # Component registry definitions
└── docs/                    # Documentation

πŸ“š Documentation

🐳 Deployment

Docker Compose (Recommended)

# Production deployment
cp .env.production .env
docker-compose up -d

Manual Deployment

# Backend
cd backend
uv sync --frozen --no-dev
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000

# Frontend  
pnpm build
# Serve dist/spa/ with your web server

Cloud Deployment

Supported platforms:

  • Railway - Auto-deploy from GitHub
  • Vercel - Frontend deployment
  • DigitalOcean - Full stack deployment
  • AWS/Azure - Enterprise deployment

🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Run tests: pnpm test && cd backend && uv run pytest
  4. Commit changes: git commit -m 'Add amazing feature'
  5. Push to branch: git push origin feature/amazing-feature
  6. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Built with ❀️ using HAX UI Registry

πŸ” Back to top

About

Modern dual-registry Shadcn/ui component system with AI-powered chat interface and FastAPI backend. Features Google Gemini integration, streaming responses, and production-ready deployment with uv package management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published