Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

polyphony-chat/sonata

Repository files navigation

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.

Coverage Status FAQ-shield Discord

sonata

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.

About

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.

Development Setup

Prerequisites

Before setting up the development environment, you'll need to install the following dependencies:

Environment Configuration

  1. Copy the example environment file:

    cp .example.env .env
  2. Edit the .env file with your database credentials and configuration.

Database Setup

  1. Create a PostgreSQL database for sonata:

    CREATE DATABASE sonata;
    CREATE USER sonata WITH PASSWORD 'sonata';
    GRANT ALL PRIVILEGES ON DATABASE sonata TO sonata;
  2. The database migrations will be automatically applied when you run the application.

Building and Running

Release Builds

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

Development Tools

Pre-commit Hooks

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

Configuration

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.

License

This project is licensed under the Mozilla Public License 2.0. See the LICENSE file for details.

Community

About

A robust, performant polyproto home server.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages