The official framework core library for Rusters projects.
Provides the underlying runtime infrastructure for full-stack apps generated with cargo ignite. Built on top of Axum, Tokio, and SQLx.
Rusters uses a section-based configuration format for structured grouping rather than standard flat property structures:
[RUSTERS_CORE]
PROJECT_ID="rusters_app"
BACKEND_PORT=4200
FRONTEND_PORT=3000
ENVIRONMENT="development"
HTTP_SERVER="apache"
[RUSTERS_DATABASE]
CONNECTION_TYPE="sqlite"
SOURCE_PATH="database/project.sqlite"Exposes typed RustersConfig, CoreConfig, and DatabaseConfig structs parsed securely using std::env::current_dir().
Unified connection pool wrapper over sqlx::AnyPool. Automatically initializes the appropriate driver connection, configures thread pools, and drives migrations at runtime:
- Supported engines: SQLite (local files), MySQL, PostgreSQL.
A wrapper around axum::Router which automatically handles base setups and pre-registers standard framework routing check points:
GET /_rusters/health: System uptime checking.GET /_rusters/info: Returns current JSON project configuration, HTTP server configurations, and system versions.
Includes pre-baked Tower service layers for backend request interception:
- Bearer Token Authentication: Simple request validation layer returning
401 Unauthorizedfor missing/wrong headers. - Trace Logging: Trace handler wrapping
tower-httpfor request logging.
Evaluates native values and inserts them inside .html or .js file layouts using the {{ key }} syntax during compile-time or run-time asset assembly.
Add rusters-core as a Git dependency (until published on crates.io):
[dependencies]
rusters-core = { git = "https://github.com/untrustnova/rusters-core", tag = "v0.1.0" }In your main.rs:
use std::sync::Arc;
use rusters_core::{config::RustersConfig, router::RustersRouter};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = Arc::new(RustersConfig::load()?);
let router = RustersRouter::new();
router.serve(config).await?;
Ok(())
}Licensed under the Apache License 2.0. Built by the Untrustnova community.