The best way to develop your web service with one click.
Features • Quick Start • Docs • License
WebShelf is a production-ready full-stack system framework built on a pure Rust stack — multi-runtime backend (Axum/Salvo), multi-platform frontend (Dioxus Web/Desktop/Mobile), SeaORM async ORM, and Redis distributed trifecta (caching/rate-limiting/locking). From code to deployment, all industry standards, AI Coding friendly.
webshelf-runtime abstraction layer, the same business code supports both Axum and Salvo runtimes via feature flags, zero code changesapp/ui) driving Web/Desktop/Mobileclient-api crate encapsulating authentication, requests, and shared types between frontend and backendRuntime trait only abstracts route building and server startup without hiding framework capabilitiesAutoRouter — Implements SeaORM ConnectionTrait + TransactionTrait; INSERT/UPDATE/DELETE auto-routes to the write database, SELECT auto-routes to read replicas-rw/-ro Service endpointsdocker-compose.yml for single-instance PostgreSQL; docker-compose.replicas.yml for 1 primary + 2 streaming replicas with read/write splitCacheService — bb8 connection pool, get_or_insert automatic backfill, get_or_insert_with_lock cache stampede protection (distributed lock prevents thundering herd)distributed-ratelimit — Fixed window rate limiting, dual IP-level + email-level strategy, precise per-auth-endpointLockGuard — Lua script atomic release, Drop auto-unlock, fail-open / fail-close dual strategyRuntime trait — Defines seven operations: Router / MethodRouter / with_route / nest / merge / with_state / servewebshelf-axum / webshelf-salvo adapters — Each implements Runtime, switched via Cargo feature default = ["webshelf-axum"]async fn(UnifiedRequest) -> Result<Response, HttpError>, framework-agnostictoken_version version control, remember-me support (30 days), Refresh Token rotationcrates/i18n, procedural macro for automatic field translationwechat-api crate, official account verification code loginRuntime trait method maps to one operation, no hidden framework details# 1. Clone and enter
git clone https://github.com/aiqubits/webshelf.git
cd webshelf
# 2. Start PostgreSQL and Redis (Docker)
docker network create webshelf-net 2>/dev/null || true
docker run -d --network webshelf-net --name webshelf-postgres-dev \
-e POSTGRES_PASSWORD=CHANGE_ME_POSTGRES_PASSWORD -e POSTGRES_DB=webshelf \
-p 5432:5432 postgres:16-alpine
docker run -d --network webshelf-net --name webshelf-redis-dev \
-p 6379:6379 redis:7-alpine \
redis-server --requirepass CHANGE_ME_REDIS_PASSWORD
# 3. Configure
cp config.toml.example config.toml
# 4. Start (default Axum runtime)
cargo run -p webshelf-server -- --env development --log-level debug
# 5. Switch to Salvo runtime
cargo run -p webshelf-server --features webshelf-salvo -- --env development --log-level debug
| Document | Description |
|---|---|
| Architecture Overview | Runtime abstraction, read/write split, Redis trifecta, deployment architecture, API docs |
| Deployment Guide | Local dev, Docker Compose, K8s (including CNP cluster), configuration management |
| Development Guide | Extending endpoints, DB migrations, runtime switching, contribution guide |
MIT License - see LICENSE.
96 commits
Rust
92.7%
CSS
4.7%
HTML
2.6%
The best way to develop your web service with one click.
Features • Quick Start • Docs • License
WebShelf is a production-ready full-stack system framework built on a pure Rust stack — multi-runtime backend (Axum/Salvo), multi-platform frontend (Dioxus Web/Desktop/Mobile), SeaORM async ORM, and Redis distributed trifecta (caching/rate-limiting/locking). From code to deployment, all industry standards, AI Coding friendly.
webshelf-runtime abstraction layer, the same business code supports both Axum and Salvo runtimes via feature flags, zero code changesapp/ui) driving Web/Desktop/Mobileclient-api crate encapsulating authentication, requests, and shared types between frontend and backendRuntime trait only abstracts route building and server startup without hiding framework capabilitiesAutoRouter — Implements SeaORM ConnectionTrait + TransactionTrait; INSERT/UPDATE/DELETE auto-routes to the write database, SELECT auto-routes to read replicas-rw/-ro Service endpointsdocker-compose.yml for single-instance PostgreSQL; docker-compose.replicas.yml for 1 primary + 2 streaming replicas with read/write splitCacheService — bb8 connection pool, get_or_insert automatic backfill, get_or_insert_with_lock cache stampede protection (distributed lock prevents thundering herd)distributed-ratelimit — Fixed window rate limiting, dual IP-level + email-level strategy, precise per-auth-endpointLockGuard — Lua script atomic release, Drop auto-unlock, fail-open / fail-close dual strategyRuntime trait — Defines seven operations: Router / MethodRouter / with_route / nest / merge / with_state / servewebshelf-axum / webshelf-salvo adapters — Each implements Runtime, switched via Cargo feature default = ["webshelf-axum"]async fn(UnifiedRequest) -> Result<Response, HttpError>, framework-agnostictoken_version version control, remember-me support (30 days), Refresh Token rotationcrates/i18n, procedural macro for automatic field translationwechat-api crate, official account verification code loginRuntime trait method maps to one operation, no hidden framework details# 1. Clone and enter
git clone https://github.com/aiqubits/webshelf.git
cd webshelf
# 2. Start PostgreSQL and Redis (Docker)
docker network create webshelf-net 2>/dev/null || true
docker run -d --network webshelf-net --name webshelf-postgres-dev \
-e POSTGRES_PASSWORD=CHANGE_ME_POSTGRES_PASSWORD -e POSTGRES_DB=webshelf \
-p 5432:5432 postgres:16-alpine
docker run -d --network webshelf-net --name webshelf-redis-dev \
-p 6379:6379 redis:7-alpine \
redis-server --requirepass CHANGE_ME_REDIS_PASSWORD
# 3. Configure
cp config.toml.example config.toml
# 4. Start (default Axum runtime)
cargo run -p webshelf-server -- --env development --log-level debug
# 5. Switch to Salvo runtime
cargo run -p webshelf-server --features webshelf-salvo -- --env development --log-level debug
| Document | Description |
|---|---|
| Architecture Overview | Runtime abstraction, read/write split, Redis trifecta, deployment architecture, API docs |
| Deployment Guide | Local dev, Docker Compose, K8s (including CNP cluster), configuration management |
| Development Guide | Extending endpoints, DB migrations, runtime switching, contribution guide |
MIT License - see LICENSE.
96 commits
Rust
92.7%
CSS
4.7%
HTML
2.6%