Skip to content

Backend rewrite to rust for more preformance #35

@Chace-Berry

Description

@Chace-Berry

feat(backend): rewrite Alterion panel backend to Rust (SeaORM + Actix Web)

TODO: Complete backend rewrite from [current stack] to Rust

Core Setup

  • Initialize new Rust workspace with Cargo.toml
  • Add dependencies: actix-web, sea-orm, tokio, serde, dotenv, tracing
  • Configure async runtime (Tokio) and logging (tracing-subscriber)
  • Set up .env / config loading (envy or config crate)

Database Layer (SeaORM)

  • Define SeaORM entities for all existing models
  • Write and test initial migrations (sea-orm-cli migrate)
  • Implement repository pattern / data access layer
  • Set up connection pooling (SeaORM + SQLx pool)
  • Validate all relations (one-to-many, many-to-many, etc.)

API Layer (Actix Web)

  • Scaffold Actix Web app with modular router structure
  • Port all existing REST endpoints to Actix handlers
  • Implement request/response DTOs with serde
  • Add input validation (validator crate)
  • Wire up middleware: auth, CORS, rate limiting, logging

Authentication

  • Implement JWT auth middleware (jsonwebtoken crate)
  • Port session/token management logic
  • Role-based access control (RBAC) guards

Error Handling

  • Define unified AppError enum (thiserror)
  • Implement actix ResponseError for AppError
  • Standardize error response format (JSON)

Testing

  • Unit tests for service/business logic layer
  • Integration tests for all API routes (actix-web test client)
  • Seed test database via SeaORM fixtures

DevOps / Deployment

  • Update Dockerfile for Rust multi-stage build
  • Update CI/CD pipeline for cargo build/test
  • Verify feature parity with old backend before cutover
  • Update API docs / OpenAPI spec (utoipa or paperclip)

BREAKING CHANGE: full backend replacement — verify all panel API consumers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions