Skip to content

Rotten-LKZ/rs-ibed

Repository files navigation

rs-ibed

A high-performance Rust-powered image hosting service featuring dynamic resizing, re-encoding, and flexible storage support for SQLite or PostgreSQL.

Warning

This application is currently under development. Please do not rely on it as your primary or sole backup for important photos. We cannot guarantee the absolute security or permanence of your data.

Installation & Setup

  1. Go to Releases and download the binary compatible with your system.
  2. Rename .env.example to .env and update the values to match your environment.
  3. Download config.toml to configure the project. (Check out the documentation for further information of the config file)
  4. Run the executable to start the service.

Deployment guides

Use the docs site for production deployment walkthroughs instead of duplicating those steps here:

Project Structure

This repository is organized as a monorepo, containing the core service, the web dashboard and the documentation.

Below is the project structure of our image hosting service.

.
├── docs
├── frontend
├── migrations
│   ├── pgsql
│   └── sqlite
├── src
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── config.toml
└── openapi.json
  • docs/: Documentation Site (built with Astro (Starlight))
  • frontend/: Web Dashboard / Client (Svelte + Vite)
  • migrations/: Databse Migrations (supports PostgreSQL & SQLite)
  • src/: Backend Source Code
  • openapi.json: API Specification generated by utopia

Development workflow

Backend

cargo build
cargo test
cargo run

Export OpenAPI without starting the server

cargo run -- export-openapi

Frontend SDK generation

Run these inside frontend/.

pnpm install
pnpm gen:api
pnpm check
pnpm build

Recommended local integration order

  1. Export OpenAPI JSON from the backend:
    cargo run -- export-openapi frontend/openapi.json
  2. Generate the frontend SDK:
    cd frontend
    pnpm gen:api
  3. Start the backend:
    cargo run
  4. Start the frontend dev server:
    cd frontend
    pnpm dev

Authentication flow

  • cargo run prints a CLI login URL that targets /login?token=....
  • Opening that link in the browser lets the frontend call /api/auth/cli and establish the auth cookie.
  • The frontend SDK uses credentials: 'include' for authenticated admin requests.

Notes

  • frontend/openapi.json is the exported OpenAPI source used for SDK generation.
  • Generated SDK output lives in frontend/src/lib/sdk/.
  • Re-export the OpenAPI spec and re-run pnpm gen:api after backend API changes.