1
0
Fork
You've already forked sonata
0
forked from polyphony/sonata
A robust, performant polyproto home server.
  • Rust 99.3%
  • PLpgSQL 0.7%
2025年09月05日 18:40:56 +02:00
.cargo feat: steal release config from microsoft/edit 2025年06月21日 21:12:44 +02:00
.github fix: install nightly and stable toolchain in ci 2025年07月12日 14:18:59 +02:00
.sqlx feat: continue work on insert_id_unchecked 2025年07月29日 23:02:06 +02:00
.vscode feat: add another coverage generation task for quick overview 2025年07月17日 19:53:06 +02:00
fixtures chore: add tests, fix tests 2025年07月20日 00:26:29 +02:00
migrations squashme: pushing my shit here also 2025年08月03日 11:40:59 +02:00
scripts fix: apply suggestion 2025年07月19日 10:31:37 +02:00
src fix: use bound variable 2025年09月05日 18:36:27 +02:00
tests chore: rustfmt 2025年07月19日 23:43:06 +02:00
yaak chore: update yaak workspace 2025年07月17日 21:07:39 +02:00
.example.env feat(change): add example env, change database config 2025年06月21日 00:54:32 +02:00
.gitignore chore: ignore coverage dir 2025年06月22日 11:24:01 +02:00
.pre-commit-config.yaml feat: impl get_valid_token, write docs 2025年07月12日 13:50:48 +02:00
build.rs chore: rustfmt 2025年07月19日 23:43:06 +02:00
Cargo.lock chore(deps): bump polyproto and other dependencies 2025年08月30日 18:59:22 +02:00
Cargo.toml chore(deps): bump polyproto and other dependencies 2025年08月30日 18:59:22 +02:00
LICENSE Initial commit 2025年06月20日 12:50:45 +02:00
README.md feat: update badges, improve visibility of note 2025年08月30日 19:42:48 +02:00
rustfmt.toml feat: change hard_tabs to false 2025年07月19日 23:41:42 +02:00
sonata.toml fix: failing test, read config from str instead 2025年07月12日 14:07:03 +02:00

Coverage Status FAQ-shield Discord dev-status

Note

This software is not yet ready to be used.

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.


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:

    CREATEDATABASEsonata;CREATEUSERsonataWITHPASSWORD'sonata';GRANTALLPRIVILEGESONDATABASEsonataTOsonata;
  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