Skip to content

πŸ“± Fluent is a real-time secure chat app built with Jetpack Compose, powered by WebSockets, RSA end-to-end encryption, and FastAPI backend.

Notifications You must be signed in to change notification settings

jishnu70/Fluent-Secure-E2E-Chat-App-Kotlin-Compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—¨οΈ Fluent - Secure Chat App with End-to-End Encryption

Fluent is a secure, real-time Android chat application built with Jetpack Compose and Kotlin. It features end-to-end encrypted messaging, token-based authentication, and real-time communication using Ktor WebSockets β€” all backed by a FastAPI server.


✨ Features

  • πŸ” End-to-End Encrypted Messaging (RSA via Android Keystore)
  • 🌐 Real-Time Messaging using Ktor WebSockets
  • πŸ”‘ JWT Authentication with Refresh Token Support
  • πŸ“± Jetpack Compose UI (Material 3) with smooth UX
  • πŸ’¬ Message List & One-on-One Chat
  • 🧩 Receiver-Side RSA Decryption via AndroidKeyStore
  • πŸš€ Message Streaming via WebSocket Flow Collector
  • 🎯 Auto Key Generation + Storage via Android Keystore
  • ☁️ EncryptedSharedPreferences for Secure Token Storage
  • πŸ‘€ User Profiles & Sidebar Drawer
  • 🧭 Custom Bottom Navigation with Slide Menu
  • 🧠 MVVM + Clean Architecture
  • πŸ”§ Dependency Injection via Koin
  • πŸ“¦ Structured Modular Codebase

πŸ“Έ Screenshots

πŸ” Login & Register

πŸ’¬ Chat List & Messages

πŸ” User Search


🧱 Architecture Overview

presentation/
    β”œβ”€β”€ authentication/
    β”œβ”€β”€ chatList/
    β”œβ”€β”€ message/
    β”œβ”€β”€ splashOpening/
    β”œβ”€β”€ profile/
data/
    β”œβ”€β”€ dto/
    β”œβ”€β”€ remote/
    β”œβ”€β”€ mapper/
    β”œβ”€β”€ network/
domain/
    β”œβ”€β”€ models/
    β”œβ”€β”€ repository/
    β”œβ”€β”€ utility/
di/
    β”œβ”€β”€ Koin modules (network, encryption, viewmodel, repository)
  • Jetpack Compose for UI
  • Ktor HTTP/WebSocket for networking
  • Android Keystore for RSA encryption
  • StateFlow & SharedFlow for reactive state management

πŸ” End-to-End Encryption Details

Each device generates an RSA keypair securely stored via the Android Keystore System.

  • Messages are encrypted with the recipient's public key.
  • Messages are decrypted using the user’s private key on-device.
  • No plaintext is stored or transmitted at any point.
  • Message decryption runs on a dedicated coroutine scope with SupervisorJob and Mutex for serialized, thread-safe access.

πŸ§ͺ Real-Time Communication

  • Messages are received over WebSocket (Ktor client)
  • Decryption occurs on a background coroutine (Dispatchers.Default) using a Mutex
  • Flow collector emits to the UI using SharedFlow to support real-time updates

βš™οΈ Tech Stack

  • 🧬 Kotlin + Jetpack Compose
  • 🌐 Ktor HTTP/WebSocket Client
  • 🧩 Koin (DI)
  • πŸ›‘οΈ EncryptedSharedPreferences
  • πŸ” Android Keystore (RSA)
  • 🧠 StateFlow + SharedFlow
  • πŸ–₯️ FastAPI (Python Backend)
  • πŸ“œ JWT Authentication (Access + Refresh Tokens)

🧱 Improvements Made

  • βœ… RSA decryption now safely runs in a background coroutine with a Mutex to avoid IllegalBlockSizeException
  • βœ… Decryption bug fixed: messages now decrypt properly when received live (even without screen navigation)
  • βœ… SupervisorJob added to isolate failure of decrypt jobs
  • βœ… Scoped coroutine (wsScope) handles WebSocket lifecycle reliably
  • βœ… WebSocket reconnect and lifecycle cleanup improved

🚧 Future Work

  • User Search API integration
  • Real-Time Message Sync using Flow
  • Push Notifications (FCM integration)
  • Typing Indicators
  • Media Sharing (images, files, voice notes)
  • Offline-first with Room DB
  • Read receipts, chat status

▢️ How to Run

  1. Clone this repo:

    git clone https://github.com/jishnu70/Fluent-Secure-E2E-Chat-App-Kotlin-Compose.git
  2. Open in Android Studio (Kotlin 1.9+, Compose Compiler 1.5+)

  3. Run the FastAPI backend

    (Backend repo: cryptalkfastapi)

  4. Launch on a device or emulator (Android 8.0+ required)


🀝 Contributing

This project is built solo for now.
Feel free to open issues, suggest improvements, or send PRs if you're passionate about privacy-first messaging apps.

About

πŸ“± Fluent is a real-time secure chat app built with Jetpack Compose, powered by WebSockets, RSA end-to-end encryption, and FastAPI backend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages