Documentation Index
Fetch the complete documentation index at: https://docs.malbox.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following installed:- Git - to clone the repository
- devenv - Malbox uses devenv for reproducible development environments. Follow the official installation guide to install it (this also installs Nix if you don’t have it)
- pnpm - required for the frontend. Follow the pnpm installation guide
- A Linux host (or WSL2 on Windows)
Clone and enter the environment
- Rust stable toolchain (rustc, cargo, clippy, rustfmt, rust-analyzer)
- PostgreSQL 16 (started as a background service)
- Node.js and pnpm
- C/C++ build tools (cmake, gcc, clang 18)
- Windows cross-compilation toolchain (MinGW)
- Infrastructure tools (packer, ansible)
- Pre-commit hooks (cargo-check, clippy, rustfmt)
The first run takes a while as Nix downloads and builds all dependencies. Subsequent runs are near-instant.
Database
PostgreSQL starts automatically when you enterdevenv shell. The default configuration is:
| Setting | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 5432 |
| Database | malbox_db |
| User | postgres |
| Password | password |
| DATABASE_URL | postgres://postgres@localhost:5432/malbox_db |
DATABASE_URL environment variable is set for you automatically in devenv.
To run pending database migrations:
Running the backend
From the repository root:http://127.0.0.1:8080.
Running the frontend
In a separate terminal (also insidedevenv shell):
http://localhost:5173. It proxies API requests to the backend at the URL configured in .env:
Running the docs
In a separate terminal:http://localhost:3000.
Daily workflow
Running tests
Formatting and linting
Pre-commit hooks run cargo-check, clippy, and rustfmt automatically on every commit. You can also run them manually:Type checking the frontend
Database migrations
Create a new migration:Building Rust documentation
Pre-commit hooks
The devenv environment installs Git hooks that run on every commit:- cargo-check - verifies the project compiles
- clippy - catches common mistakes and style issues
- rustfmt - enforces consistent formatting
--no-verify. If a hook fails, fix the issue before committing.
Troubleshooting
devenv shell fails or hangs
Make sure Nix is installed correctly and the Nix daemon is running:
Database connection refused
PostgreSQL may not have started yet. Check its status:devenv up -d.
SQLx compile errors about missing queries in CI
If you see SQLx compile-time errors, make sure the offline query cache is up to date:SQLX_OFFLINE=true:
Frontend can’t reach the backend
Make sure:- The backend is running (
cargo run --bin malbox-daemon) - Your
.envfile has the correctMALBOX_API_URL(default:http://127.0.0.1:8080) - Both terminals are inside
devenv shell