$ show turms-im/turms
Turms is a production-grade, open-source instant messaging engine designed for 100K to 10M concurrent users. The system follows a microservices architecture with two core Java/Spring Boot servers: turms-gateway (handles client connections, authentication, session management, and push) and turms-service (implements business logic for messaging, groups, users, conversations, storage, and admin API). Both servers are built on a reactive stack (Project Reactor, Netty) for non-blocking I/O and high throughput. The platform includes a Vue.js admin UI (turms-admin), multiple client SDKs (JavaScript, Kotlin, Swift, Dart, C++), a Flutter chat demo, and a plugin system for extensibility (anti-spam, push notifications, MinIO storage, Rasa chatbot, LiveKit conferencing). Data is stored in MongoDB (sharded), Redis (session, blocklist, sequence IDs), and optionally Elasticsearch for full-text search. The codebase demonstrates strong engineering practices: custom RPC codecs for cluster communication, a property metadata framework for configuration validation, thread-safe rate limiting, and a well-defined plugin extension point system. While primarily an application, it includes an AI serving module (PaddleOCR) for content moderation, but this is a minor component. The repository is actively maintained with frequent commits, comprehensive CI/CD pipelines, and Terraform deployment scripts.
The LLM identified 4 files worth highlighting for reuse:
A thread-safe token bucket rate limiter using atomic CAS operations for refill and consumption. It is self-contained, requires no external dependencies, and can be extracted into any Java project needing rate limiting. Demonstrates non-obvious skill in lock-free concurrency and precise timing.
A record that validates property constraints such as @Min, @Max, @ValidCron, and @NoWhitespace. It is isolated and can be reused in any configuration framework to enforce constraints on annotated fields. Demonstrates clean separation of validation logic from property loading.
An abstract base class for RPC request codecs that defines a consistent pattern for serializing and deserializing RPC requests with trace ID support. The codec pattern is reusable across any distributed system requiring custom binary serialization. Demonstrates non-obvious skill in designing extensible codec hierarchies.
An invoker that executes the first matching extension point among registered plugins. It is part of a trio (First, Sequential, Simultaneous) that provides flexible plugin execution strategies. The pattern is reusable in any plugin system requiring ordered or conditional extension invocation. Demonstrates clean separation of plugin orchestration from business logic.