Hazle

Highlight text anywhere in Android and get an AI answer back as a notification. Every line of it Kotlin.

Hazle cover art
Role
Solo - client, backend, landing page
Integration
System-wide text selection context menu
Hard part
Auth and message queue across three services
Reach
English, Sinhala and German at MVP

At a glance

Android clientJetpack Compose (Material 3) · Koin · Room · Coroutines
MiddlewareKtor — auth, chat queue and OpenAI integration
ServicesSupabase auth, PostgreSQL, storage
Landing pagehazle.tashila.me, open source in hazle-web

Engineering notes

Auth flow

App → Ktor → Supabase Auth → JWT token → session management, so the client never holds a provider key.

Chat process

User message → Ktor → OpenAI → Ktor → push notification. Tapping it opens the thread with context-aware history.

Why middleware

Putting Ktor between app and OpenAI keeps prompt engineering and rate limiting server-side, where they can change without a release.

Where it's going

V2 adds Supabase realtime sync and attachments; V3 moves the core to a shared KMP module with a Compose Multiplatform iOS UI.

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