← Back to Docs

Kuruvi Messenger Architecture

Kuruvi is a reference implementation of a global real-time messenger built on Mana. It showcases how to assemble multiple framework stores into a cohesive production-grade application.

1. User & Account Stores

Kuruvi utilizes Mana's AccountStore for credentials and ProfileStore for user metadata (avatars, status, etc.). These are decoupled to allow for high-performance user lookups without loading sensitive auth data.

2. Message Lifecycle

The messaging lifecycle in Kuruvi involves:

3. End-to-End Encryption (E2EE)

Kuruvi leverages the KeyExchange hub in Mana to store and distribute public keys for E2EE messaging, ensuring that only the sender and receiver can decrypt the message payload. It implements the full **X3DH + Double Ratchet** protocol for all conversations.

4. Mobile-First Responsive UI

The Kuruvi frontend is meticulously designed for high-end mobile experiences, featuring glassmorphism floating call controls, an adaptive single-column layout for small screens, and synchronized signaling for multi-device cross-platform calling.

main.go
package main

import (
    mana "github.com/Aswanidev-vs/mana"
    "github.com/Aswanidev-vs/mana/core"
    "github.com/Aswanidev-vs/mana/storage/db"
)

func main() {
    // 1. Kuruvi uses production-grade SQL batteries
    cfg := core.DefaultConfig()
    cfg.DatabaseDriver = db.SQLite
    cfg.DatabaseDSN    = "data/kuruvi.db"
    cfg.EnableE2EE     = true
    cfg.EnableRTC      = true

    app := mana.New(cfg)

    // 2. Custom hooks for post-persistence logic
    app.OnMessageStored(func(ctx context.Context, msg core.Message) {
        // Trigger push alerts, analytics, or sync
    })

    // 3. Start high-performance server
    log.Fatal(app.Start())
}