Hazle

An open-source Android AI chatbot fully written in Kotlin, backend to frontend

Hazle is yet another AI chatbot assistant designed with Android system integration in mind. Instead of switching apps, users can highlight text anywhere in the Android system, process it through the context menu, and receive an AI-generated response via a background notification.

The project is under active development and the code can be found in hazle-android and hazle-backend repos. The code of the landing page is also available in hazle-web repo.

Project Architecture

deepseek_mermaid_20250530_7533cb

Tech Stack

  1. Android Client:
  • Jetpack Compose: Material 3 dynamic UI with dark/light theme
  • Koin: Dependency injection for clean architecture
  • Ktor: API handling from client-side
  • Coroutines: Background message processing
  • Room: Local caching for offline support
  1. Ktor Backend (Middleware):
  • Auth API: JWT token handling
  • Chat API: Message queue management
  • OpenAI API: AI integration for message responses
  1. Supabase Services:
  • Auth: Email/password + social logins
  • Realtime DB: PostgreSQL for chat history (roadmap)
  • Storage: File attachments (roadmap)

MVP Features

ComponentFunctionality
Auth FlowApp → Ktor → Supabase Auth → JWT token → Session management
Chat ProcessUser message → Ktor → OpenAI → Ktor → Push notification
NotificationTap opens chat thread with context-aware history

Phase Roadmap

  1. MVP (Current): [Progress tracker]
  • Auth + basic chat
  • Notification system
  • Compose UI with themes
  • English, Sinhala and German languages
  1. V2 (Quality of life features): [Progress tracker]
  • Supabase realtime chat sync
  • Prompt engineering dashboard
  • Message history
  • File attachment support
  • More localization
  1. V3 (Cross-platform): [Progress tracker]
  • Shared KMP core module
  • iOS UI with Compose Multiplatform
  • Configurable AI personalities
  • Usage analytics

Learning Opportunities

TechnologyKey Concepts Learned
ComposeMaterial 3 Expressive theming, custom animations
KoinCleaner modular code with Dependency injection
KtorREST API development, middleware
SupabaseFirebase alternative, Authentication, PostgreSQL management
LocalizationMulti-language support with Compose UI, German language