Expand description
An opinionated full-stack Rust web framework with strong conventions and sensible defaults.
Capy integrates routing, validation, configuration, and database tooling with a predictable application structure.
Depend on this package as capy = { package = "capy-framework", version = "0.2.0" }.
The prelude contains the common API; named re-exports retain native escape hatches.
Re-exports§
pub use capy_db as db;pub use axum;pub use chrono;pub use sea_orm;pub use sea_orm_migration as migration;pub use serde;pub use serde_json;pub use tokio;pub use tower;pub use tower_http;pub use tracing;pub use validator;pub use capy_testing as testing;
Modules§
- prelude
- The small set of types most API handlers need.
Structs§
- App
- Application builder: configuration, database, tracing, migrations, and HTTP.
- AppConfig
- Application and database settings, resolved before startup.
- AppContext
- Cheaply cloned state shared by every request.
- AppSettings
- HTTP server and logging settings. Environment variables use
APP_. - Context
- Extract typed application state using
Context(ctx): Context. - Created
- A JSON response with HTTP 201 Created.
- Database
Settings - SeaORM connection settings. Environment variables use
DATABASE_. - Json
- JSON Extractor / Response.
- NoContent
- An empty response with HTTP 204 No Content.
- Route
Info - A declared route, used by
capy routeswithout connecting to a database. - Routes
- A native Axum router together with a small, explicit route inventory.
- Validated
- Deserialize and validate a JSON body before invoking the handler. Put this extractor last, since it consumes the request body.
Enums§
- AppError
- Errors with predictable HTTP statuses and safe public messages.
Functions§
- health
- The default health response; it deliberately performs no database query.
Type Aliases§
- Result
- The result type used by application handlers and startup.
- Validation
Errors - Field names (including dotted nested paths) mapped to validation messages.