lumina-framework 0.1.2

A beautiful, fast, and elegant web framework for Rust
Documentation

โœจ Lumina Framework

A beautiful, fast, and elegant web framework for Rust.
Inspired by Laravel's clean and readable syntax.


โœจ Features

  • ๐Ÿš€ Fast & Efficient โ€” Built on Tokio + Axum, fully async
  • ๐ŸŽจ Clean Syntax โ€” Laravel-like fluent API with Request bundle
  • ๐Ÿ—๏ธ MVC Architecture โ€” Controllers, Models, Services
  • ๐Ÿ›ฃ๏ธ Elegant Routing โ€” Route groups, Middleware, and Param binding
  • ๐Ÿช„ Smart Scaffolding โ€” Full CRUD generation with fields in one command
  • ๐Ÿงช Testing Suite โ€” Built-in testing with fluent assertions
  • ๐Ÿ—„๏ธ Database Layer โ€” SQLx, Migrations, Seeders, and Factories
  • ๐ŸŽญ Template Engine โ€” Tera with .blade.rs preprocessor and HTMX support
  • ๐Ÿ” JWT Auth โ€” Full authentication scaffolding ready to use
  • ๐Ÿ“ File Upload โ€” Multipart handling & Image manipulation
  • ๐Ÿณ Deployment Tools โ€” Docker, Nginx, and Supervisor auto-scaffolding

๐Ÿ“ฆ Installation

Anda dapat menginstall Lumina CLI secara global menggunakan cargo:

cargo install lumina-framework

Atau jika Anda ingin menginstall dari source:

git clone https://github.com/lumina-java/framework.git
cd lumina
cargo install --path .

๐Ÿš€ Quick Start

1. Buat Project Baru

Gunakan CLI untuk membuat skeleton project baru:

lumina new my-app
cd my-app
cp .env.example .env

2. Jalankan Server

cargo run --bin lumina-server

Server berjalan di http://127.0.0.1:8000 ๐ŸŽ‰


โšก Contoh Penggunaan

Smart CRUD Scaffolding

Buat modul produk lengkap (Model, Migration, Controller, Views) dalam 1 detik:

./lumina make:crud Product name:string:required price:integer description:text

Elegant Controller Logic

Gunakan Request bundle untuk akses cepat ke segalanya:

pub async fn store(req: Request, ValidatedForm(form): ValidatedForm<ProductRequest>) -> impl IntoResponse {
    let mut item = Product::new();
    item.name = form.name;
    item.price = form.price;

    let service = ProductService::new(req.db_arc());
    match service.create_model(item).await {
        Ok(_) => req.redirect("/products").with_success("Berhasil!").go(&req).await,
        Err(e) => req.back().with_error("Gagal!").go(&req).await
    }
}

Fluent Testing

#[tokio::test]
async fn test_homepage_works() {
    let client = TestClient::new().await;
    client.get("/")
        .send()
        .await
        .assert_status(200)
        .assert_text("Selamat Datang");
}

๐Ÿ› ๏ธ CLI Commands

Command Deskripsi
serve Jalankan HTTP server
make:crud Generate full CRUD scaffolding (Model, Controller, Migration, Views)
make:auth Generate Authentication scaffolding (Register, Login, Views)
migrate Jalankan database migrations
db:seed Seed database dengan data dummy
tinker Interactive REPL session
make:docker Generate Dockerfile & docker-compose.yml
make:nginx Generate Nginx configuration
test:run Jalankan semua unit & integration tests

๐Ÿ“š Dokumentasi Lengkap

Untuk panduan detail, tutorial CRUD, konfigurasi middleware, dan referensi API lengkap:

๐Ÿ‘‰ Baca DOCUMENTATION.md


๐Ÿ“„ License

MIT โ€” Lumina Java admin@lumina-java.com