rust-web-app  by rust10x

Web app blueprint for production Rust coding

created 1 year ago
579 stars

Top 56.7% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Installation: Requires Rust and Cargo. PostgreSQL is used as the database.
  • Database Setup: Start a PostgreSQL server using Docker: docker run --rm --name pg -p 5432:5432 -e POSTGRES_PASSWORD=welcome postgres:17.
  • Development:
    • Run server: cargo watch -q -c -w crates/services/web-server/src/ -w crates/libs/ -w .cargo/ -x "run -p web-server"
    • Run quick dev example: cargo watch -q -c -w crates/services/web-server/examples/ -x "run -p web-server --example quick_dev"
  • Testing: cargo watch -q -c -x "test -- --nocapture"
  • Resources: Links to YouTube videos explaining concepts are provided.

Highlighted Details

  • Supports declarative macros for generating common CRUD functions.
  • ModelManager includes on-demand database transaction support.
  • JSON-RPC responses include a .data field for future metadata.
  • Data model has transitioned to AI chat concepts (Agent, Conv/ConvMsg) with multi-tenancy considerations (Org, Space).

Maintenance & Community

  • Active development indicated by recent updates and detailed release notes.
  • Discord server available for community interaction: https://discord.gg/XuKWrNGKpC.

Licensing & Compatibility

  • The repository does not explicitly state a license in the provided README.

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.

Health Check
Last commit

4 months ago

Responsiveness

1 week

Pull Requests (30d)
1
Issues (30d)
0
Star History
29 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.