9
11
Fork
You've already forked sonata
5
A robust, performant polyproto home server. https://polyproto.org
Rust 94.5%
Shell 2.5%
Nix 2.4%
PLpgSQL 0.6%
2025年12月22日 00:34:16 +01: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 fix: db script 2025年11月01日 18:24:13 +01: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: db script 2025年11月01日 18:24:13 +01: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 feat: ignore direnv and .cargo related files 2025年10月26日 15:42:57 +01:00
.mailmap chore: add mailmap 2025年12月22日 00:32:30 +01:00
.pre-commit-config.yaml feat: impl get_valid_token, write docs 2025年07月12日 13:50:48 +02:00
Cargo.lock feat: nix flake with postgres 2025年10月03日 18:36:33 +02:00
Cargo.toml feat: nix flake with postgres 2025年10月03日 18:36:33 +02:00
flake.lock feat: db script time! 2025年11月01日 17:58:37 +01:00
flake.nix chore: Add rust-src to fenix toolchain (switched to complete toolchain) 2025年12月22日 00:18:37 +01:00
LICENSE Initial commit 2025年06月20日 12:50:45 +02:00
README.md fix(doc): add owner to database 2025年11月19日 22:28:30 +01:00
rustfmt.toml feat: change hard_tabs to false 2025年07月19日 23:41:42 +02:00
sonata.toml fix: db script 2025年11月01日 18:24:13 +01:00

Zulip-shield Coverage Status FAQ-shield 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 (Without Nix)

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;ALTERDATABASEsonataOWNERTOsonata;
  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 .cargo/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

Development Setup (With Nix)

  • Install direnv
  • Add a .envrc to the root of the project, containing the line use flake
  • Run direnv allow if you trust the contents of /flake.nix
  • Start a development database by using the db script: Run db in your bash compatible shell for information.

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