Summerrs Admin
Full-stack admin system in Rust featuring JWT/RBAC auth, database sharding, multi-tenancy, AI gateway, MCP server and Socket.IO.
Ask AI about Summerrs Admin
Powered by Claude Β· Grounded in docs
I know everything about Summerrs Admin. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Summerrs Admin
δΈζ | English
Full-stack Rust admin system Β· LLM relay gateway, database sharding, multi-tenant isolation, MCP service, declarative macros β all in one binary
What It Is
summerrs-admin is a production-grade admin system written entirely in Rust, built on top of the Summer framework (a Spring-style application skeleton for Rust). It bundles capabilities that usually require a whole backend team to assemble β authentication, multi-tenancy, AI gateway, real-time messaging, object storage, declarative auditing β into a single binary via a plugin composition model. Use what you need, ignore what you don't.
It is not a demo, nor a showcase of any single component β it is a complete, self-contained, deployable backend foundation.
How It Differs From Similar Projects
The market generally splits into CRUD scaffolds, AI gateways, and sharding middleware. Few projects combine them. summerrs-admin puts four things in one place:
| Capability | Typical | This Project |
|---|---|---|
| LLM Relay Gateway | A separate project (new-api, one-api, AxonHub) | Embedded as the summer-ai crate, sharing auth / billing / audit with the admin |
| Database Sharding | Bolted on via ShardingSphere / Vitess | summer-sharding rewrites SQL transparently β no business code changes |
| MCP Service | A standalone MCP server process | summer-mcp introspects business schema directly; AI assistants generate CRUD |
| Declarative Audit & Rate Limiting | Middleware + handwritten code | #[login] #[has_perm] #[rate_limit] β single-line attributes |
Not every project needs all of this. But once you need any two of them, putting them in the same process saves an entire layer of ops.
Architecture
The system is built around plugin composition. crates/app/src/main.rs is the assembly point β 17 plugins fed into App::new() in order:
HTTP 8080
β
βΌ
ββββββββββββββββββββββββββββββββββββ
β Tower middleware (CORS / β
β compression / panic guard / β
β client IP extraction) β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββ
βΌ βΌ βΌ
/api/* (JWT) /v1/* (API key) default
summer-system summer-ai-relay handler
summer-ai-admin (OpenAI/Claude/ auto-grouped
Gemini ingress)
β
βΌ
ββββββββββββββββββββββββββββββββββββ
β Declarative macro layer β
β #[login] #[has_perm] β
β #[has_role] #[rate_limit] β
β #[operation_log] β
ββββββββββββββββ¬ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββ
β Sharding / SQL rewrite layer β
β Tenant context / encrypt / mask β
ββββββββ¬ββββββββββββββ¬ββββββββββββββ
βΌ βΌ
PostgreSQL 17 Redis 7
(primary) (sessions / cache / rate limit)
β
βΌ
Socket.IO / background jobs / S3
Plugin roster (17):
WebPlugin Β· SeaOrmPlugin Β· RedisPlugin Β· SummerShardingPlugin Β· SummerSqlRewritePlugin Β· JobPlugin Β· MailPlugin Β· SummerAuthPlugin Β· PermBitmapPlugin Β· SocketGatewayPlugin Β· Ip2RegionPlugin Β· S3Plugin Β· BackgroundTaskPlugin Β· LogBatchCollectorPlugin Β· McpPlugin Β· SummerAiRelayPlugin Β· SummerAiBillingPlugin
Core Capabilities
Authentication & Authorization
- Multi-algorithm JWT β HS256 / RS256 / ES256 / EdDSA, key rotation supported
- Bitmap RBAC β bit-wise permission checks, O(1)
- Declarative macros β
#[login]#[has_perm("user:create")]#[has_role("admin")]#[public] - Session governance β concurrent login limits, per-device caps, token refresh, force logout
Multi-Tenancy & Database
-
Four isolation tiers
Mode Suited for Mechanism shared_rowMost SaaS SQL rewrite injects tenant_idfilterseparate_tableMid isolation Physical sharding ( user_001/user_002)separate_schemaStrong isolation PostgreSQL schema-level separation separate_databaseFull isolation Each tenant gets its own physical database -
SQL rewrite engine β tenant context injected transparently, business code untouched
-
CDC pipeline β change data capture across tenants
-
Encryption / masking / audit β built into the sharding layer, applied before persistence
AI Gateway (summer-ai)
-
Three ingress protocols
Protocol Path Compatibility OpenAI /v1/chat/completions/v1/responses/v1/modelsnative Claude /v1/messagesnative Gemini /v1beta/models/{target}native -
40+ upstream providers β implemented as ZST (zero-sized type) adapters, zero runtime overhead
-
6-dimension dynamic routing β protocol family / endpoint / credentials / model mapping / extra headers / routing strategy
-
Three-phase billing β Reserve β Settle β Refund, atomic
-
Automatic failover β retry across channels by priority on failure (streaming requests do not retry)
-
Hot-reload β config lives in the database, no restart needed
-
Full tracing β lifecycle logs including every retry attempt
MCP Server Integration
- Schema discovery β AI assistants can introspect the database schema
- Code generation β generate CRUD modules through dialogue
- Menu / dictionary auto-deploy β prompt-driven persistence
- Underlying β built on rmcp (the official Rust MCP SDK), supporting both stdio and streamable-http transports
Real-time & Background Processing
- Socket.IO β bidirectional real-time, session state in Redis (horizontally scalable)
- Background task queue β typed jobs, 4 workers by default, capacity 4096
- Batch logging β operation logs flushed asynchronously, off the hot path
- Cron jobs β driven by
tokio-cron-scheduler
Storage & Utilities
- S3-compatible storage β AWS S3 / MinIO / RustFS, multipart upload up to 5 GB
- IP geolocation β IP2Region xdb embedded, login logs auto-attributed
- i18n β compile-time, currently zh / en
- Rate limiting β 5 algorithms: fixed window, sliding window, token bucket, leaky bucket, Lua script
- OpenAPI docs β at
/docs, with Swagger UI
Project Structure
summerrs-admin/
βββ crates/
β βββ app/ # binary entry, assembles all plugins
β βββ summer-admin-macros/ # declarative macros (#[login] / #[has_perm] etc.)
β βββ summer-auth/ # JWT auth + path policy
β βββ summer-common/ # shared types & utilities
β βββ summer-domain/ # domain models (entities / VOs)
β βββ summer-ai/ # AI gateway (relay + billing + admin)
β β βββ core/ # protocol core
β β βββ model/ # data models
β β βββ relay/ # relay engine
β β βββ admin/ # admin API
β β βββ billing/ # billing & settlement
β βββ summer-sharding/ # sharding / multi-tenancy middleware
β βββ summer-sql-rewrite/ # SQL rewrite engine
β βββ summer-mcp/ # MCP server
β βββ summer-plugins/ # S3 / IP2Region / background jobs etc.
β βββ summer-system/ # system business (RBAC / users / menus / Socket.IO)
β βββ model/
βββ config/ # multi-env configs (dev / prod / test)
βββ sql/ # database source of truth
β βββ sys/ # system domain (users / menus / perms / logs)
β βββ tenant/ # tenant control plane
β βββ biz/ # B/C-side business
β βββ ai/ # AI gateway schema
β βββ migration/ # one-shot migration scripts
βββ doc/ # deployment / migration / technical guides
βββ docs/ # research, surveys, reference materials
βββ locales/ # i18n resources
βββ build-tools/ # fmt / clippy / pre-commit scripts
βββ docker-compose.yml # one-shot stack: postgres + redis + rustfs + app
βββ Dockerfile # multi-stage build
If this project helps you, a Star is appreciated.
