Case file · № 05 / 16
TerraCrypt Messenger
Messenger on a custom curve — End-to-end encrypted messenger across iOS, Android, Tauri desktop and a full self-hosted Go backend, with an admin dashboard and a complete observability stack. Group chats, voice, video and file transfer — all under cryptography that runs on the device. The first large system where the one-core-many-clients pattern proved itself, and the ancestor of the post-quantum rework in vChat.
What was built
- Native iOS client in a modular SPM monorepo (Core*, Feature*) with its own crypto packages
- Android client in Kotlin, data/domain/ui architecture, multi-module Gradle
- Tauri desktop for Windows, macOS and Linux (~20 MB installer, no Chromium)
- Go monorepo backend: API, signaling, push, payments, PostgreSQL + Redis migrations
- CoTURN for NAT traversal and MinIO as S3-compatible encrypted media storage
- Admin control plane (RBAC + audit trail) with real-time metrics
- Observability: Grafana, Loki, Fluent-bit, Kibana, APM traces and Prometheus endpoints
Layers of the system
On-device cryptography
SwiftKotlinCJNI- Custom elliptic curve and own primitives, not just a call into someone's library
- CoreCrypto / CoreCryptoDM / CoreCryptoGroup: primitives, DM and group encryption
- Native C layer over JNI on Android — identical behaviour to iOS
- Encrypted local database (SQLCipher) and a biometric vault
Clients
SwiftUICombineComposeTauri 2- iOS: SwiftUI + Combine, WebRTC group calls with own signalling
- Android: Jetpack Compose, Hilt, Room, WorkManager for reliable background work
- Desktop: Rust core + TypeScript/Vite, auto-update and code signing
- A notification extension decrypts push messages before the OS shows them
Backend and observability
GoPostgreSQLRedisDockerGrafana- Go services in a Docker Compose stack, horizontally scalable
- PostgreSQL as the main store with custom migrations, Redis for sessions and rate limiting
- Apache and nginx reverse proxies with a vhost per service
- Zero-downtime live updates on the production server
Technologies
Programming languagesSwift, Kotlin, Rust, TypeScript, Go, PHP, C
Frameworks & toolsSwiftUI, Combine, Jetpack Compose, Hilt, Room, Tauri 2, React, WebRTC
InfrastructurePostgreSQL, Redis, CoTURN, MinIO, Docker Compose, Grafana, Loki, Kibana
Facts
PlatformsiOS · Android · Desktop · Server
Statuslive
Years2022 → present
CategoryFlagship · iOS · Android · Desktop
TerraCrypt — clients on three platforms share the same C crypto layer.
All projects