Expand description
Purwa — opinionated Rust web framework (Sangkan).
Product requirements and architecture: PRD.md at the repository root.
Modules§
Structs§
- AppConfig
- Framework configuration:
purwa.toml+ env (PURWA_*). - AppSection
- Top-level
[app]section inpurwa.toml. - AppState
- Shared application state (PRD §5.3). Holds
Arcresources only — no globals. - Database
Section - Top-level
[database]section inpurwa.toml. - Inertia
Section - Top-level
[inertia]section — asset versioning for Inertia.js (Sprint 6). - Registered
Route - One row for
route:list/format_route_table. Handlers register throughinventory::submit!(via Purwa proc-macros). - Route
Descriptor - Server
Section - Top-level
[server]section inpurwa.toml. - Validated
Form - Form / query extractor: deserialize then run
Validate. - Validated
Json - JSON body extractor: deserialize then run
Validate. - Validation
Error Body - JSON body for validation failures (Laravel-style
errorsmap).
Enums§
- Purwa
Config Error - Errors while loading or deserializing configuration.
- Purwa
Error - Central framework error type.
Functions§
- app_
router - Default application router: Sprint 1 hello on
/plus any routes registered via Purwa macros (router_from_inventory). - flatten_
validation_ errors - Flatten
ValidationErrorsto dot-path keys and message lists (nested structs / lists supported). - format_
route_ table - Pretty-print METHOD, path, and handler (PRD §11 table style).
- init_
tracing - Same as
init_tracing_with_filterwith default"info". - init_
tracing_ with_ filter - Install the global tracing subscriber (pretty in development, JSON when
PURWA_ENV=production). - route_
descriptors - Iterator over registered route metadata (for tooling and tests).
- router_
from_ inventory - Merge all registered routes into a single
Router(unit state).
Type Aliases§
- Axum
Router - Type alias for the default Axum router with unit state — use this when composing custom routes.
- PgPool
- An alias for
Pool, specialized for Postgres.