Important
📦️ We moved! Come check out our new place over on Codeberg! (Repository link)
We have moved to Codeberg as our primary Git Forge, and the project is alive and well over there! 💜 The GitHub repositories will be archived and potentially deleted in the future.
A robust, performant implementation of a polyproto home server.
Important
What is the difference between this project and symfonia?
Tip
sonata is a standalone polyproto home server, taking care of all the routes and behaviors defined in the polyproto-core specification.
Symfonia is a polyproto-chat server, exclusively caring about the polyproto-chat extension and the routes and behaviors defined by it.
Note
This software is not yet ready to be used.
sonata is a robust, performant polyproto home server implementation built with Rust. It provides a complete implementation of the polyproto-core specification, handling all the routes and behaviors defined therein.
Before setting up the development environment, you'll need to install the following dependencies:
- Rust: Install Rust and Cargo from https://rustup.rs/
- PostgreSQL: Install PostgreSQL from https://www.postgresql.org/download/
- pre-commit: Install pre-commit from https://pre-commit.com/
-
Copy the example environment file:
cp .example.env .env
-
Edit the
.env
file with your database credentials and configuration.
-
Create a PostgreSQL database for sonata:
CREATE DATABASE sonata; CREATE USER sonata WITH PASSWORD 'sonata'; GRANT ALL PRIVILEGES ON DATABASE sonata TO sonata;
-
The database migrations will be automatically applied when you run the application.
sonata is configured with aggressive optimizations for production releases. This significantly reduces binary size while maintaining performance.
To build sonata for release:
cargo build --release --config .config/release.toml
This will create an optimized executable in target/release/sonata
.
For development and testing, use the standard debug build:
cargo build
This project uses pre-commit hooks to ensure code quality. Install and set up the hooks:
pre-commit install
The hooks will automatically:
- Format rust code
- Run
clippy
for linting - Check for common issues like trailing whitespace and adding a newline at the end of files
- Prepare sqlx queries for offline mode
sonata uses a TOML configuration file (sonata.toml
) for its settings. The configuration includes:
- API settings: Port, host, and TLS configuration for the API server
- Gateway settings: Port, host, and TLS configuration for the gateway server
- Database settings: Connection parameters for PostgreSQL
- Logging: Log level configuration
See sonata.toml
for the default configuration and available options.
This project is licensed under the Mozilla Public License 2.0. See the LICENSE file for details.
- Discord: Join our community on Discord
- Website: Visit polyproto.org
- Email: Contact us at [email protected]
- IRC: See our FAQ at the "IRC" section for information on how to connect.