Skip to main content

Prerequisites

  • Rust (latest stable)
  • PostgreSQL (14 or later)
  • Docker (optional)
  • Git
The fastest way to get started:
# Clone the repository
git clone https://github.com/olympia-hq/zeus.git
cd zeus

# Start PostgreSQL
docker-compose up -d postgres

# Run migrations
cd server
cargo install sqlx-cli --no-default-features --features native-tls,postgres
cargo sqlx migrate run

# Start the server
cargo run
The server will be running at http://localhost:3000.

Option 2: Manual Setup

1. Install Rust

# Using rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Verify
rustc --version
cargo --version

2. Install PostgreSQL

macOS:
brew install postgresql@14
brew services start postgresql@14
Ubuntu:
sudo apt-get install postgresql-14
sudo service postgresql start
Windows: Download from postgresql.org

3. Setup Database

# Create database
createdb zeus

# Install SQLx CLI
cargo install sqlx-cli --no-default-features --features native-tls,postgres

# Run migrations
cd server
cargo sqlx migrate run

4. Configure Environment

Create .env file:
DATABASE_URL=postgres://localhost/zeus
RUST_LOG=info
PORT=3000

5. Build and Run

# Build
cargo build

# Run
cargo run

# Or run in release mode
cargo run --release

Verify Installation

# Health check
curl http://localhost:3000/health

# Expected response
{"status": "healthy"}

Development Workflow

Watch Mode

Automatically rebuild on changes:
cargo install cargo-watch
cargo watch -x run

Run Tests

# All tests
cargo test

# Specific test
cargo test test_name

# With output
cargo test -- --nocapture

Database Migrations

# Create new migration
cargo sqlx migrate add <name>

# Run pending migrations
cargo sqlx migrate run

# Revert last migration
cargo sqlx migrate revert

Common Issues

Database Connection Failed

# Check PostgreSQL is running
pg_isready

# Verify database exists
psql -l | grep zeus

Compilation Errors

# Clean and rebuild
cargo clean
cargo build

SQLx Compile-time Errors

# Ensure DATABASE_URL is set
export DATABASE_URL=postgres://localhost/zeus

# Rebuild with offline mode
cargo sqlx prepare
cargo build --features sqlx-offline

Next Steps

Configuration

Learn about environment variables and configuration