Skip to content
/ alat Public

That's one device that's all your devices

License

Notifications You must be signed in to change notification settings

ken-morel/alat

Repository files navigation

Alat - That's One Device That's All Your Devices

Note

This is generated by qwen cli free and I didn't really completely fix it yet. The project is nothing but starting, and I'm not that fast as a rust beginner, so I didn't spend time handwritting a readme just yet.

Alat Logo

The Vision

Alat is not just another device management tool—it's a fundamental rethinking of how devices should interact in our digital ecosystem. Where traditional approaches treat devices as separate entities that need to be "connected," Alat envisions a world where devices are truly unified into a single computational fabric irrespective of their kind(as long as they support it of course).

This project represents a complete reimagination of the original Alat project, moving away from complex multi-component architectures toward a simpler, more robust design that prioritizes system integration over standalone applications.

From the Old to the New

The original Alat project (https://github.com/ken-morel/alat-old) was an ambitious effort to create a cross-platform toolkit for device service sharing. While it laid important groundwork, it suffered from:

  • Architectural fragmentation: Separate core, library, desktop app, and mobile app components
  • Complexity overhead: Multiple codebases maintaining the same functionality
  • Interface friction: Adding yet another application to users' workflows rather than integrating with existing ones
  • Shared state challenges: Difficulties in maintaining consistent state across distributed components

This new Alat addresses these issues through a radical simplification and refocusing:

Aspect Original Alat New Alat
Language Go Rust (memory safety, performance)
Architecture Multi-component (core, lib, apps) Unified three-layer (nlem, platform, app)
State Management Shared mutable state Channel-based communication
Interface Philosophy Standalone applications System integration + minimal UI
Discovery Protocol mDNS UDP broadcast
Extensibility Complex integration points Simple trait-based services

Core Architecture

The Heart: nlem (NLEM = "Heart")

The core logic layer, named nlem (not "core" to follow Rust crate naming conventions), serves as the central nervous system of the Alat ecosystem. It implements:

  • Node: The central coordinator that unites all components
  • Services: Modular units that provide specific functionality (pairing, telemetry, etc.)
  • Controllers: Components that consume services to perform actions (clipboard sync, file transfer, etc.)
  • Device Manager: Handles discovery, pairing, and connection management
  • Storage: Persistent data management
  • Platform Abstraction: OS-specific functionality

Communication Model

Instead of shared mutable state, Alat uses a channel-based communication model:

  • Each component communicates with its parent via dedicated channels
  • The Node processes events, performs actions, and relays messages
  • Application state is maintained by the UI layer, which receives NodeEvent notifications

This creates a more robust, predictable architecture where components are loosely coupled but tightly coordinated.

Service-Controller Pattern

Alat organizes functionality around two key abstractions:

  1. Services: Units that may provide:

    • A worker thread/task
    • A gRPC server
    • Partitions in the node's storage for cache/config/temp
    • A client implementation
    • To implement a service, simply implement the Service trait
  2. Controllers: Components that consume services to perform actual operations:

    • Clipboard synchronization
    • File transfer
    • Notification forwarding
    • Media control The provide:
    • A worker.
    • Partitions in the node's storage for cache/config/temp

Services are controlled by a servicemanager, and controllers by a controllermanager.

This separation allows for clean extension—new services can be added without modifying existing code, and controllers can be composed from multiple services.

Technical Implementation

Discovery Protocol

Alat uses UDP broadcast on port 4147 for device discovery:

  • Devices advertise their presence every 5 seconds
  • The application scans for broadcasts and maintains discovered devices
  • Devices are considered lost after 15 seconds of no advertisement
  • Easier than mDNS(no need to make a second query) while maintaining cross-platform compatibility and some reliability.

Security Model

  • Each device has a unique ID and certificate
  • Pairing involves secure certificate exchange with user confirmation
  • User approval via desktop notifications (Linux) ensures security without compromising usability

Data Storage

  • Configuration and paired device data stored in JSON format
  • Location: ~/.config/cm.engon.alat/data.json on linux, other on others.
  • Structured for easy migration and backup

Why This Approach Works Better

  1. System Integration First: Rather than adding another application to your workflow, Alat integrates with your operating system, making device interaction feel native.
  2. Simplified Extensibility: The service-controller pattern makes it trivial to add new functionality without disrupting existing code.
  3. Robust Communication: Channel-based messaging eliminates race conditions and makes the system more predictable.
  4. Focused Scope: By concentrating on core device pairing and management, Alat delivers a more reliable experience than the overly ambitious original.
  5. Cross-Platform Foundation: The clean separation between platform-specific code and core logic makes future platform support (macOS, Windows) straightforward.

Getting Started

Prerequisites

  • Rust toolchain (latest stable)
  • Cargo package manager
  • For UI development: Slint build tools

Installation

git clone https://github.com/engon/alat.git
cd alat

Building and Running

# Using Cargo directly
cargo build -p app
cargo run -p app

Usage Philosophy

Alat is designed to be used as part of your normal workflow, not as a separate application you launch. The minimal Slint UI provides just enough interface for initial setup and monitoring, while the real power comes from system integration:

  1. Devices automatically discover each other on your local network
  2. Pairing requires explicit user confirmation for security
  3. Once paired, devices become available as extensions of your primary device
  4. Services and controllers operate in the background, enhancing your workflow seamlessly

Future Roadmap

  • Controllers: Implement clipboard synchronization, file transfer, notification forwarding
  • Services: Add media control, remote input, ...
  • Platform Support: Extend to macOS and test on Windows
  • Mobile Integration: Create lightweight mobile clients that integrate with the desktop node
  • Advanced Discovery: Add Bluetooth and Wi-Fi Direct discovery options

Contributing

Contributions are welcome! Please follow these guidelines:

  • Submit pull requests against the main branch
  • Ensure all code follows Rust formatting standards (cargo fmt)
  • You will notice I'm not the one to write tests, they're even worse than docs.
  • Update documentation(when you find one) for significant changes

All contributions become part of the original work under the same license terms.

License

This software is licensed under a custom license that permits educational use, personal modification, and contributions, but explicitly prohibits commercial use without explicit written permission. For commercial licensing inquiries, contact: engonken8@gmail.com or me@engon.cm

See LICENSE for full details.

Support

For questions or issues, please open an issue in the repository or contact the maintainer at engonken8@gmail.com or me@engon.cm.

Website


Alat is developed by Engon Ken Morel. The verb "Alat" means "to link" in some certain language reflecting the application's purpose as a tool for device unification.

The same where "nlem" means "heart", and yeah I can guarantee you that whatever way you try to pronounce 'alat' and especially 'nlem', your are surely not doing it right,

About

That's one device that's all your devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published