Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

inja-online/inja_chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

InjaChat: Advanced Client-First AI Chat Platform πŸš€

πŸ“ 1. Project Overview

Welcome to InjaChat! This project is our official entry into the T3 Chat Cloneathon, an exciting open-source competition initiated by Theo (@theo on X/Twitter). Our goal is to build a client-first, performance-optimized AI chat application that not only mirrors T3 Chat's functionality but surpasses it through innovative features and architecture.

Built entirely with Svelte 5 and SvelteKit, InjaChat leverages cutting-edge web technologies to deliver an unparalleled chat experience optimized for both LLM conversations and AI image generation workflows.

🎯 2. Purpose & The Cloneathon

This project exists to participate in and win the T3 Chat Cloneathon by showcasing the superior capabilities of Svelte in building complex, real-time AI applications.

About the T3 Chat Cloneathon:

The T3 Chat Cloneathon is an open-source competition challenging developers to build their best clone of T3 Chat, emphasizing strong UI/UX and innovative features.

πŸ—οΈ 3. Architecture Philosophy

Client-First Design

InjaChat is built with a client-first architecture that prioritizes:

  • Local State Management: Advanced client-side state with minimal server dependencies
  • Offline Capabilities: Core functionality works without internet connection
  • Progressive Enhancement: Features gracefully degrade/enhance based on capabilities
  • Edge Computing: Leveraging Cloudflare Workers for global performance
  • Zero-Latency UI: Optimistic updates and instant user feedback

Performance-First Approach

  • Sub-100ms Response Times: Optimized for lightning-fast interactions
  • Minimal Bundle Size: Tree-shaking and code-splitting for optimal loading
  • Memory Efficiency: Smart garbage collection and resource management
  • Battery Optimization: Efficient algorithms that preserve device battery life

πŸš€ 4. How to Run This Project

Prerequisites:

  • Node.js (LTS version recommended)
  • pnpm, bun, or npm

Setup Instructions:

  1. Clone the repository:

    git clone git@github.com:inja-online/inja_chat.git
    cd inja_chat
  2. Install dependencies:

    pnpm install
    # or bun install
    # or npm install
  3. Configure Environment Variables: Create a .env file in the root directory:

    # LLM Providers
    OPENAI_API_KEY=your_openai_key
    ANTHROPIC_API_KEY=your_anthropic_key
    GOOGLE_AI_API_KEY=your_google_key
    
    # Image Generation
    STABILITY_API_KEY=your_stability_key
    MIDJOURNEY_API_KEY=your_midjourney_key
    
    # Database & Auth
    DATABASE_URL=your_database_url
    AUTH_SECRET=your_auth_secret
  4. Run the development server:

    pnpm dev
    # or bun dev
    # or npm run dev

    Access the application at http://localhost:5173

🌟 5. Core Features

🎯 Mandatory Cloneathon Requirements

  • Multi-LLM Chat Integration: Support for OpenAI GPT-4, Claude, Gemini, and local models
  • Authentication & Sync: Secure user auth with real-time chat synchronization

πŸš€ Client-First Architecture Features

  • Offline-First Operation: Core chat functionality works without internet
  • Local Model Support: Run smaller LLMs directly in the browser via WebAssembly
  • Edge-Optimized Routing: Smart request routing through global CDN
  • Progressive Web App: Full PWA with app-like experience
  • Client-Side Encryption: End-to-end encryption for sensitive conversations
  • Smart Caching: Intelligent conversation and model response caching
  • Background Sync: Seamless sync when connection returns

πŸ€– Advanced LLM Optimization

  • Streaming Response UI: Real-time typing indicators with character-by-character display
  • Context Window Management: Smart context pruning and conversation summarization
  • Multi-Model Conversations: Switch models mid-conversation seamlessly
  • Custom System Prompts: User-defined AI personas and behavior templates
  • Conversation Templates: Pre-built prompts for common use cases
  • Token Usage Analytics: Real-time cost tracking and usage optimization
  • Response Quality Scoring: AI-powered response evaluation and ranking
  • Auto-Retry Logic: Smart retry mechanisms for failed requests
  • Model Performance Benchmarking: Built-in speed and quality comparisons
  • Custom Fine-Tuned Model Support: Integration with user's fine-tuned models

🎨 Image Generation & Visual AI

  • Multi-Provider Image Generation: Stable Diffusion, DALL-E, Midjourney integration
  • Real-Time Image Editing: In-chat image modification and enhancement
  • Style Transfer Capabilities: Apply artistic styles to generated images
  • Image-to-Image Translation: Transform existing images with AI
  • Batch Image Generation: Generate multiple variations simultaneously
  • Custom Image Models: Support for specialized image generation models
  • Image Upscaling & Enhancement: AI-powered image quality improvement
  • Visual Prompt Builder: Drag-and-drop interface for complex image prompts
  • Image History & Galleries: Organized collections of generated artwork
  • Advanced Parameter Control: Fine-tune generation settings per request

πŸ’¬ Enhanced Chat Experience

  • Chat Branching & Forking: Create alternative conversation paths
  • Message Editing & Regeneration: Edit messages and regenerate responses
  • Conversation Search: Full-text search across all chat history
  • Smart Suggestions: AI-powered next message suggestions
  • Voice Input/Output: Speech-to-text and text-to-speech integration
  • Collaborative Chats: Share conversations for team collaboration
  • Chat Export/Import: Backup and transfer conversations
  • Conversation Analytics: Insights into chat patterns and productivity

πŸ“Ž File & Media Handling

  • Universal File Upload: Support for 50+ file formats
  • PDF Analysis & Chat: Intelligent document parsing and Q&A
  • Image Recognition & Description: AI-powered image analysis
  • Code File Understanding: Smart code analysis and suggestions
  • Audio/Video Transcription: Convert media to text for chat context
  • Large File Processing: Efficient handling of files up to 100MB
  • OCR Integration: Extract text from images and documents
  • File Versioning: Track changes in uploaded documents

πŸ”§ Developer & Power User Features

  • API Playground: Built-in testing interface for different models
  • Custom Shortcuts: Keyboard shortcuts for power users
  • Plugin System: Extensible architecture for custom features
  • Webhook Integration: Connect with external services and workflows
  • CLI Interface: Command-line tools for advanced users
  • Bulk Operations: Process multiple chats/files simultaneously
  • Advanced Export Options: JSON, CSV, Markdown export formats
  • Development Tools: Built-in debugging and performance monitoring

🎨 UI/UX Excellence

  • Adaptive Themes: Dynamic themes that adjust to content and time
  • Accessibility First: Full WCAG 2.1 AA compliance
  • Mobile-Optimized: Native mobile app experience
  • Gesture Controls: Intuitive touch and mouse gestures
  • Customizable Layouts: Personalized interface arrangements
  • Focus Modes: Distraction-free chat environments
  • Advanced Syntax Highlighting: Support for 200+ programming languages
  • Math Rendering: LaTeX and MathML support for equations

πŸ”’ Security & Privacy

  • Zero-Knowledge Architecture: Server never sees unencrypted messages
  • Local Data Storage: Sensitive data stays on user device
  • GDPR Compliance: Full European privacy regulation compliance
  • Audit Logs: Comprehensive logging for enterprise users
  • Two-Factor Authentication: Enhanced account security
  • Session Management: Advanced session control and monitoring

🌐 Integration & Extensibility

  • Web Search Integration: Real-time search results in conversations
  • Calendar Integration: Schedule and manage tasks through chat
  • Email Integration: Send and receive emails via chat interface
  • Social Media Posting: Share content across platforms
  • Cloud Storage Sync: Integrate with Google Drive, Dropbox, etc.
  • Database Query Interface: Chat with your databases
  • Custom API Integrations: Connect any REST/GraphQL API

πŸ† 6. Competitive Advantages

Why InjaChat Will Win the Cloneathon:

  1. Performance: Sub-100ms response times through client-first architecture
  2. Innovation: Unique features like local model support and offline operation
  3. User Experience: Intuitive interface with advanced customization options
  4. Scalability: Edge-optimized infrastructure for global performance
  5. Extensibility: Plugin system allowing unlimited customization
  6. Security: End-to-end encryption with zero-knowledge architecture

πŸ› οΈ 7. Technology Stack

  • Frontend: Svelte 5, SvelteKit, TypeScript
  • Styling: Tailwind CSS, Shadcn/ui components
  • State Management: Svelte 5 runes, Zustand for complex state
  • Real-time: WebSockets, Server-Sent Events
  • Database: Turso (SQLite), Prisma ORM
  • Authentication: Auth.js, WebAuthn
  • Deployment: Cloudflare Pages, Workers
  • AI Integration: OpenAI, Anthropic, Google AI SDKs
  • Image Processing: Canvas API, WebGL, WASM

πŸ”„ 8. Development Roadmap

Phase 1: Foundation (Weeks 1-2)

  • Core chat interface
  • Basic LLM integration
  • User authentication

Phase 2: Enhancement (Weeks 3-4)

  • Image generation features
  • File upload capabilities
  • Advanced UI components

Phase 3: Optimization (Weeks 5-6)

  • Performance tuning
  • Client-first features
  • Security hardening

Phase 4: Polish (Weeks 7-8)

  • Advanced features
  • Testing and QA
  • Final optimizations

πŸ“Š 9. Success Metrics

  • Performance: <100ms initial load, <50ms interaction response
  • User Experience: >95% user satisfaction score
  • Feature Completeness: 100% of mandatory + 80% of bonus features
  • Code Quality: >90% test coverage, <5 critical issues
  • Accessibility: WCAG 2.1 AA compliance

🀝 10. Contributing

We welcome contributions from the community! Please read our contributing guidelines and join us in building the best AI chat application for the T3 Cloneathon.

πŸ“œ 11. License

This project is licensed under the AGPL-3.0-or-later license - see the LICENSE file for details.

About

:) clone of t3.chat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors