Skip to main content

Overview

The Zeus server is a high-performance Rust backend built with Axum. It provides REST APIs for the mobile app to synchronize data.

Features

High Performance

Rust and Axum for maximum throughput

Type Safe

Compile-time guarantees for API contracts

PostgreSQL

Reliable, ACID-compliant data storage

Docker Ready

Easy deployment with Docker Compose

Tech Stack

ComponentTechnologyPurpose
FrameworkAxumWeb framework
DatabasePostgreSQL + SQLxType-safe SQL
AuthJWTStateless authentication
ValidationValidatorInput validation
SerializationSerdeJSON handling

Project Structure

server/
├── src/
│   ├── main.rs           # Entry point
│   ├── lib.rs            # Library exports
│   ├── config/           # Configuration
│   ├── controllers/      # HTTP handlers
│   ├── db/               # Database setup
│   ├── errors/           # Error types
│   ├── middleware/       # Auth, rate limiting
│   ├── models/           # Data structures
│   ├── repositories/     # Database access
│   └── services/         # Business logic
├── migrations/           # Database migrations
├── Cargo.toml            # Dependencies
└── Dockerfile            # Container image

API Design

RESTful Resources

GET    /wallets           # List wallets
POST   /wallets           # Create wallet
GET    /wallets/:id       # Get wallet
PUT    /wallets/:id       # Update wallet
DELETE /wallets/:id       # Delete wallet

GET    /categories        # List categories
POST   /categories        # Create category
...

GET    /transactions      # List transactions
POST   /transactions      # Create transaction
...

Response Format

Success:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Cash",
  "currency": "USD",
  "balance": 100.00,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
Error:
{
  "error": "Validation failed",
  "message": "Email is required"
}

Next Steps