Web app blueprint for production Rust coding
Top 56.7% on sourcepulse
This repository provides a production-ready web application template built with Rust and the Axum framework, targeting professional web developers. It aims to accelerate the development of complex applications by offering a robust, well-structured foundation, including features like declarative macros for CRUD operations, database transaction support, and a flexible JSON-RPC routing system.
How It Works
The blueprint leverages a Cargo workspace structure for modularity, with key components in lib_core
and web_server
. It utilizes sea-query
for SQL building and modql
for MongoDB-like filtering, enabling efficient data manipulation. Recent updates introduce declarative macros (macro_rules
) to generate common CRUD functions for both RPC and Business Model Controllers (BMCs), reducing boilerplate. The ModelManager
now supports on-demand database transactions, allowing for atomic operations. JSON-RPC responses include a .data
field for enhanced flexibility.
Quick Start & Requirements
docker run --rm --name pg -p 5432:5432 -e POSTGRES_PASSWORD=welcome postgres:17
.cargo watch -q -c -w crates/services/web-server/src/ -w crates/libs/ -w .cargo/ -x "run -p web-server"
cargo watch -q -c -w crates/services/web-server/examples/ -x "run -p web-server --example quick_dev"
cargo watch -q -c -x "test -- --nocapture"
Highlighted Details
ModelManager
includes on-demand database transaction support..data
field for future metadata.Maintenance & Community
https://discord.gg/XuKWrNGKpC
.Licensing & Compatibility
Limitations & Caveats
The project is in active development, with recent significant changes to the data model and internal structures. While the blueprint illustrates AI chat structures, it is not a complete AI chat system. The README mentions a change in SeaField::new
due to modql
version updates, requiring code adjustments.
4 months ago
1 week