Building Lachat: A Decentralized Intranet Chat Application Without Server Dependencies
Introduction: The Origin Story of Lachat
Some time ago, we undertook an interesting project: a military unit approached us with a requirement for an intranet instant messaging software to facilitate internal staff communication and collaboration. The requirements were quite specific and challenging:
Core Requirements:
- Decentralized architecture: No server deployment required, no database setup needed
- No account registration: No username/password login necessary
- Plug-and-play functionality: Ready to use immediately upon installation
- Cross-platform support: Must support both Windows and Chinese domestic operating systems (Galaxy Kylin, UnionTech UOS)
During our initial requirements discussion, we immediately thought of FeiQ (飞秋), a classic LAN messaging tool. However, the client pointed out that FeiQ's user interface looked like it was from twenty years ago—quite outdated by modern standards. Additionally, FeiQ couldn't meet some of their special functional requirements.
Accepting this challenge, we spent two months developing a custom solution. After successful delivery, we removed the military-specific features, redesigned the UI with a modern, generalized aesthetic, and named it Lachat (拉洽). We're now sharing this software with everyone for free permanent use.
Section 1: Lachat User Interface Showcase
Let's explore Lachat's visual design and user experience through its main interface components.
Main Chat Interface
The primary chat window presents a clean, modern design optimized for efficient communication. The interface features:
- Contact list with online status indicators
- Message history display with timestamp marking
- Quick access to common functions (file transfer, emoji, screenshots)
- Minimalist design reducing visual clutter
Personal Information Page
Users can view and manage their profile information including:
- Customizable display name
- Network status and connection information
- Personal settings and preferences
- Local storage management options
Chat History View
The chat history interface provides:
- Searchable message history
- Date-based organization
- Export functionality for important conversations
- Multimedia message preview (images, files)
The overall design philosophy emphasizes simplicity, efficiency, and ease of use—addressing the primary complaint about legacy solutions like FeiQ while maintaining the core functionality that made them valuable.
Section 2: Advantages of Decentralized Intranet Chat Software
Compared to public internet chat applications, decentralized intranet chat software like Lachat offers numerous significant advantages that make it particularly suitable for specific use cases.
2.1 Complete Decentralization: Zero Server Deployment Costs
No Infrastructure Required:
- No need to purchase servers
- No maintenance overhead
- No database administration
- No backend management interface
Network Simplicity:
Any computers connected to the same local area network can communicate directly. The system automatically discovers peers and establishes connections without any central coordination.
Resilience:
Power outages, system restarts, or device additions/removals do not affect overall system usability. The network self-heals and reconfigures automatically.
2.2 Absolute Data Security: Information Never Leaves the Intranet
Privacy Protection:
- Messages never pass through any third-party servers
- No cloud logs are stored
- No risk of monitoring, scraping, or data leaks
- Meets classified information system basic requirements and security protection standards
Compliance Benefits:
Organizations with strict data sovereignty requirements can maintain complete control over their communication data, ensuring compliance with regulatory frameworks.
2.3 No External Network Dependency: Functional Even When Completely Disconnected
Physical Isolation Compatibility:
Communication works even in completely air-gapped environments as long as devices are on the same network segment. This makes it ideal for:
- Closed intranet environments
- Temporary emergency command scenarios
- Field operations with temporary LAN setups
- Secure facilities with no external connectivity
2.4 No Regulatory Risk: No Central Point of Control
Censorship Resistance:
Without a central node, the system cannot be blocked at a single point. This provides inherent resilience against network-level restrictions.
Privacy Features:
Messages can be configured for local deletion with no persistent records, making it suitable for sensitive internal communications where leaving traces is undesirable.
2.5 Low Latency and High Resilience
Direct P2P Communication:
Lachat uses peer-to-peer direct connections, resulting in minimal latency. Messages travel directly between sender and receiver without routing through intermediate servers.
Fault Tolerance:
Any node going offline does not affect communication between other nodes. This distributed architecture is inherently more stable and harder to瘫痪 than traditional client-server architectures.
Comparison with C/S Architecture:
Traditional client-server models have a single point of failure—the server. If the server goes down, all communication stops. In Lachat's P2P model, the network continues functioning as long as at least two nodes remain online.
Section 3: Technical Implementation Principles of Lachat
Building a decentralized intranet chat application requires solving several fundamental technical challenges. Let's explore how Lachat addresses each of these.
3.1 Technology Stack Selection
Cross-Platform Framework:
To support both Windows and Linux-based Chinese domestic operating systems, we selected .NET Core series, specifically .NET 8. This provides:
- Native compilation for multiple platforms
- Consistent behavior across operating systems
- Strong performance characteristics
- Active community support and long-term maintenance
UI Framework:
We chose Avalonia for the user interface layer because it offers:
- True cross-platform UI rendering
- Modern design capabilities
- Hardware acceleration support
- XAML-based declarative UI (familiar to .NET developers)
Local Data Storage:
SQLite was selected for local data storage due to its:
- Zero-configuration setup
- Single-file database format
- Excellent performance for read-heavy workloads
- Wide platform support
- ACID compliance for data integrity
3.2 Core Technical Challenges
Developing a decentralized intranet chat application requires solving five fundamental problems:
Challenge 1: Node Discovery
When a new node joins the intranet, it must automatically discover other online nodes and actively notify existing nodes of its presence. This is the foundation of the self-organizing network.
Challenge 2: Peer-to-Peer Communication
Any two nodes must be able to establish direct P2P connections, with messages transmitted directly without passing through any intermediate nodes. This ensures privacy and reduces latency.
Challenge 3: Dynamic Network Maintenance
Node online/offline status must be synchronized in real-time. Any node failure should not affect the normal operation of the entire network. The system must gracefully handle churn.
Challenge 4: Local Storage
All messages, contact information, group data, and configuration settings must be stored locally on each device. This eliminates the need for central storage while ensuring data persistence.
Challenge 5: Distributed Data Synchronization
This is the most complex challenge. Nodes that come online later must be able to automatically synchronize the latest contact information, group data (such as member additions/removals, group profile modifications), and other shared state.
3.3 Technical Solutions
Solution for Node Discovery: UDP Broadcast/Multicast
Newly online nodes broadcast an "I'm online" message within the local area network using UDP broadcast or multicast. This approach:
- Requires no prior knowledge of network topology
- Works automatically on any standard LAN
- Has minimal overhead
- Reaches all nodes on the same network segment
Solution for Connection Establishment: Active Connection Initiation
When existing online nodes receive the broadcast notification from a new node, they proactively establish P2P connections with the new node and share their own information. This creates a fully connected mesh network where every node can communicate directly with every other node.
Solution for Status Monitoring: Heartbeat Mechanism
A heartbeat mechanism continuously monitors node status:
- Each node periodically sends heartbeat signals to known peers
- Missing heartbeats indicate potential node failure
- Failed nodes are marked as offline and removed from the active node list
- This enables real-time discovery of offline nodes
Solution for Data Persistence: SQLite + JSON Configuration
- User profiles, group information, and chat history: Stored in SQLite database for structured querying and efficient retrieval
- Configuration settings: Stored in JSON format configuration files for easy editing and version control
- This hybrid approach balances performance and flexibility
Solution for Distributed Synchronization: Operation Log Replay
Distributed data synchronization represents the most complex challenge. Our solution uses operation logs to reconstruct and synchronize the latest data state:
- Every change to shared data (contact updates, group modifications, etc.) is recorded as an operation in a local log
- When a new node joins or reconnects after being offline, it requests operation logs from other nodes
- The node replays these operations in sequence to reconstruct the current state
- Conflict resolution strategies handle cases where multiple nodes made conflicting changes
This approach is similar to event sourcing and provides several advantages:
- Complete audit trail of all changes
- Ability to reconstruct state at any point in time
- Natural conflict detection and resolution
- Efficient incremental synchronization
Section 4: Running Lachat on Chinese Domestic Operating Systems
Lachat provides native support for Chinese domestic Linux operating systems, with recommended platforms being:
- Galaxy Kylin V10 SP1 (银河麒麟 V10 SP1)
- UnionTech UOS V22 (统信 UOS V22)
Installation Instructions for Domestic Linux
Step 1: Download Appropriate Package
Download the corresponding Aoruitong client compressed package based on your CPU architecture:
- x64 architecture: Lachat-X64.zip
- ARM64 architecture: Lachat-Arm64.zip
- LoongArch64 architecture: Lachat-Loongarch64.zip
Important: Extract the package directly on the domestic Linux computer. Do not extract on Windows and then copy to Linux, as this may cause permission and line-ending issues.
Step 2: Launch the Application
In the extracted directory, locate the Lachat.sh file. Double-click this file, and a dialog box will appear prompting for execution method.
Step 3: Run Directly
Click the "Run Directly" (直接运行) button. The Lachat main window will appear, and you can begin using the application immediately.
Windows Installation
For Windows users, simply download and run the Lachat.msi installer. The installation wizard will guide you through the setup process, and the application will be ready to use upon completion.
Section 5: Download and Get Started
Lachat is available for free download for all supported platforms:
Windows Version:
- Download: Lachat.msi
- Installation: Standard Windows installer with guided setup
Chinese Domestic Linux Versions:
- x64 Architecture: Lachat-X64.zip
- ARM64 Architecture: Lachat-Arm64.zip
- LoongArch64 Architecture: Lachat-Loongarch64.zip
All downloads are available from the official distribution server.
Section 6: Use Cases and Best Practices
Ideal Deployment Scenarios
Enterprise Internal Communication
Organizations requiring secure internal communication without external dependencies can deploy Lachat across their intranet for team collaboration.
Government and Military
Entities with strict data sovereignty requirements and air-gapped networks benefit from Lachat's decentralized architecture and local-only data storage.
Educational Institutions
Schools and universities can use Lachat for internal communication between departments without concerns about external network access or data privacy.
Emergency Response Teams
Temporary networks set up for disaster response or emergency operations can quickly deploy Lachat for coordination without infrastructure setup.
Best Practices for Deployment
Network Configuration
Ensure all devices are on the same network segment or that UDP broadcast/multicast traffic is allowed to pass between segments if using VLANs.
Firewall Settings
Configure local firewalls to allow Lachat's communication ports. The application will indicate which ports need to be opened during first launch.
Regular Backups
While data is stored locally, implement regular backup procedures for important chat history and configuration files.
User Training
Provide basic training to users on the decentralized nature of the system, emphasizing that messages are only visible to participants and stored locally.
Section 7: Future Development Roadmap
Based on user feedback and evolving requirements, potential future enhancements include:
Enhanced Security Features
- End-to-end encryption for message content
- Digital signature verification for message authenticity
- Secure group key management
Advanced Collaboration Features
- Screen sharing capabilities
- Voice and video calling
- Collaborative whiteboarding
Integration Capabilities
- API for third-party integrations
- Plugin architecture for extensibility
- Webhook support for automated notifications
Management Features
- Optional central management console for enterprise deployments
- User activity auditing (opt-in)
- Policy enforcement capabilities
Conclusion
Lachat represents a practical solution for organizations and individuals requiring secure, decentralized communication within local networks. By eliminating server dependencies, ensuring data never leaves the intranet, and providing cross-platform support, it addresses critical needs that traditional chat applications cannot satisfy.
The technical architecture demonstrates that sophisticated peer-to-peer communication is achievable with modern development tools while maintaining simplicity for end users. The operation log-based synchronization approach provides a robust foundation for distributed state management without central coordination.
We welcome feedback from the community and encourage users to report issues, suggest features, and contribute to the ongoing development of Lachat. Together, we can build a communication tool that truly serves the needs of decentralized, privacy-focused organizations.
For questions, suggestions, or support, please visit the official website and contact the development team. Your input helps shape the future of this project.