Exploring a new approach to building secure messaging apps using a decentralized microfrontend architecture. This experimental approach uses independent modules for core functions like cryptography and peer-to-peer communication.
A Different Approach to App Development
This project takes an unconventional path, leveraging microfrontends and module federation, often discouraged in online discussions, to build a decentralized, end-to-end encrypted messaging application. This approach might seem complex, but it offers interesting possibilities.
Potential Advantages of This Architecture
This architecture aims to provide several key benefits:
- Improved Code Reusability: Core functions, like cryptography, are packaged as independent modules, allowing reuse across multiple applications.
- Simplified Updates: Sharing dependencies makes rolling out updates to core mechanics easier across different applications.
- Flexibility with Open and Closed Source: This structure offers greater flexibility in managing open and closed-source code within web applications.
- Streamlined Cross-Platform Development: This architecture also works with Tauri for Android builds, streamlining the creation of new applications using existing modules.
- Built-in Documentation with Storybook: Hosting Storybook statics alongside federated modules allows for effective documentation of each module in isolation.
How the Modules Work Together
The project consists of various interconnected modules:
- Cryptography Modules: These handle the encryption and decryption aspects of the messaging app.
- P2P Framework: This module facilitates peer-to-peer communication between users.
These modules are consumed by microfrontends, allowing different applications to share core functionality. For example:
- A P2P Chat Application
- A P2P File Transfer Application
These applications share the same underlying modules but maintain separate codebases.
Challenges and Future Directions
This architecture will likely introduce challenges in testing and maintenance. However, it also offers potential benefits in terms of code organization, reusability, and flexibility. While some may see this as an overly complex alternative to existing package management solutions, the ability to separate open and closed-source components in web applications offers significant advantages.
Addressing the Reality of JavaScript
It’s important to acknowledge that with JavaScript, complete code obfuscation is inherently difficult. While this architecture aims to manage open and closed-source components more effectively, the underlying code remains accessible, especially with the increasing sophistication of reverse-engineering techniques, including those powered by AI.
Current State of the Project
This project is in its early stages. It represents an exploration of a different approach to application architecture. The long-term viability of this approach remains to be seen, but it presents an interesting case study in leveraging microfrontends and module federation for decentralized application development.