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.
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.