A decentralized, peer-to-peer messaging application built with Wails, Go, Svelte, and TypeScript. MessageMesh uses a Raft consensus algorithm to maintain a consistent state between all nodes in the network, ensuring secure and reliable communication.
- Peer-to-Peer Messaging: Send and receive messages directly between users with no central server
- End-to-End Encryption: Secure communication with encrypted messages
- Decentralized Architecture: Resilient network with no single point of failure
- Consensus-Based: Uses Raft algorithm to maintain consistent blockchain state across nodes
- Cross-Platform: Desktop application available for Windows, macOS, and Linux
- Go: Backend language
- Svelte: Frontend UI library
- TypeScript: Type-safe JavaScript
- Wails: Framework for building desktop applications with Go backend and web frontend
- Libp2p: Modular networking stack for peer-to-peer applications
- Hashicorp Raft: Consensus algorithm implementation
- Bbolt: Key/value store for Go
- Flowbite-Svelte: UI component library for Svelte
- Tailwind CSS: Utility-first CSS framework
The project follows a standard Wails application structure, with separate backend (Go) and frontend (Svelte/TypeScript) components:
MessageMesh/
├── backend/ # Go backend code
│ ├── models/ # Data models
│ ├── consensus.go # Raft consensus implementation
│ ├── interface.go # Backend interface definitions
│ ├── keys.go # Cryptographic key management
│ ├── p2p.go # Peer-to-peer networking
│ ├── pubSub.go # Publish-subscribe functionality
│ └── server.go # Backend server functionality
├── db/ # Database-related files$$
├── frontend/ # Svelte/TypeScript frontend
│ ├── dist/ # Compiled frontend assets
│ ├── src/ # Source code
│ └── wailsjs/ # Wails-generated JavaScript bindings
├── app.go # Main application code
├── main.go # Entry point
├── go.mod # Go module definition
├── go.sum # Go dependencies checksum
└── wails.json # Wails configuration
-
Clone the repository:
git clone https://github.com/yourusername/MessageMesh.git cd MessageMesh
-
Install the Go dependencies:
go mod download
Create a .env
file in the root directory of the project with the following variables:
HEADLESS=false # Set to true to run in non-GUI mode (for servers)
USERNAME=yourname # Your username in the network
Run the application in development mode:
wails dev
This will start both the Go backend and the Svelte frontend with hot-reloading.
To build a production-ready application:
wails build
The compiled binaries will be available in the build/bin
directory.
When you start the application, a new user is created instantly and you are prompted to enter the pubsub topic you want to join.
When you join a topic, you can start sending messages to users in the topic.
This project is licensed under the MIT License - see the LICENSE file for details.