Ferrum is the backend for Geplauder, built with actix-web and sqlx.
For more information on Geplauder, click here.
Ferrum consists of two separate services:
- REST Api: Handles initial data fetching for frontend clients and processes actions from the client.
- WebSocket Server: Keep connected clients from the frontend up-to-date by providing them with appropriate updates.
This project supplies a docker-compose.yml file for easy development.
Start Postgres and RabbitMQ:
docker compose up -dThe preferred way to configure your database is sqlx-cli:
cargo install sqlx-cli # Install sqlx-cli
cd ferrum-db
sqlx database create # Create the database specified in '.env'
sqlx migrate run # Run migrationsAs this project contains two services, we need to start them both for proper usage.
Start the REST api:
cargo runStart the websocket server:
cd ferrum-websocket
cargo runAs this project uses bunyan with a JSON formatter for logging (tracing), it's recommended to run it in combination with bunyan:
npm install -g bunyan # Globally install bunyan
cargo run | bunyan # Start the project and pipe the logs into bunyanFerrum uses rustfmt for formatting and clippy for linting. Make sure to run them before committing:
cargo fmt
cargo clippyWhen using sqlx compile-time checked queries, make sure to update the metadata before committing:
cd ferrum-db
cargo sqlx prepare # Update sqlx metadataThis project is under heavy development and not suitable for production. It may contain severe security vulnerabilities.
GNU General Public License v3 (GPL-3) unless otherwise stated.
