# π Runique - Django-inspired Rust Web Framework
> **β οΈ Note**: This documentation has been generated with AI assistance. While care has been taken to ensure accuracy, some links or details may contain errors. Please report issues on [GitHub](https://github.com/seb-alliot/runique/issues).
[]()
[]()
[]()
[]()
[]()
A modern and comprehensive Rust web framework inspired by Django, for building robust and performant web applications.
## π Table of Contents
- π [Installation](#-installation)
- ποΈ [Architecture](#οΈ-architecture)
- βοΈ [Configuration](#οΈ-configuration)
- π£οΈ [Routing](#οΈ-routing)
- π [Forms](#-forms)
- π¨ [Templates](#-templates)
- ποΈ [ORM](#οΈ-orm)
- π [Middleware](#-middleware)
- π¬ [Flash Messages](#-flash-messages)
- π [Examples](#-examples)
---
## π Installation
**Full Documentation** : [Installation Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/01-installation.md)
Quick start:
```bash
git clone https://github.com/seb-alliot/runique
cd runique
cargo build
cargo test --all
```
π **Read** : [docs/en/01-installation.md](https://github.com/seb-alliot/runique/blob/main/docs/en/01-installation.md) for complete details
---
## ποΈ Architecture
**Full Documentation** : [Architecture Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/02-architecture.md)
Overview of Runique's architecture:
```
Runique Framework
βββ Forms System # Type-safe forms
βββ Routing Engine # URL pattern routing
βββ Template Engine # Tera templates
βββ Middleware Stack # Security & headers
βββ ORM Layer # SeaORM integration
βββ Utils # Helpers and utilities
```
π **Read** : [docs/en/02-architecture.md](https://github.com/seb-alliot/runique/blob/main/docs/en/02-architecture.md) for internal structure
---
## βοΈ Configuration
**Full Documentation** : [Configuration Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/03-configuration.md)
Configure your server and application:
```rust
let settings = Settings {
server: ServerConfig { ... },
database: DatabaseConfig { ... },
security: SecurityConfig { ... },
};
```
π **Read** : [docs/en/03-configuration.md](https://github.com/seb-alliot/runique/blob/main/docs/en/03-configuration.md) for all options
---
## π£οΈ Routing
**Full Documentation** : [Routing Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/04-routing.md)
Define your routes with Axum's `Router`:
```rust
use axum::routing::{get, post};
fn routes() -> Router {
Router::new()
.route("/", get(views::home))
.route("/api/users", post(views::create_user))
}
```
π **Read** : [docs/en/04-routing.md](https://github.com/seb-alliot/runique/blob/main/docs/en/04-routing.md) for patterns and options
---
## π Forms
**Full Documentation** : [Forms Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/05-forms.md)
Create forms easily with `#[derive(RuniqueForm)]`:
```rust
use crate::views;
use runique::prelude::*;
use runique::{urlpatterns, view}; // Macros must be here
pub fn routes() -> Router {
let router = urlpatterns! {
"/" => view!{ GET => views::index }, name = "index",
"/about" => view! { GET => views::about }, name = "about",
"/inscription" => view! { GET => views::inscription, POST => views::submit_inscription }, name = "inscription",
};
router
}
pub async fn inscription(mut template: TemplateContext) -> AppResult<Response> {
let form = template.form::<RegisterForm>();
context_update!(template => {
"title" => "Inscription user",
"inscription_form" => &form,
});
template.render("inscription_form.html")
}
// Handle form submission
async fn submit_inscription(
Prisme(mut form): Prisme<UserForm>,
mut template: TemplateContext,
) -> AppResult<Response> {
if form.is_valid().await {
}
context_update!(template => {
"form" => form,
});
template.render("register.html")
}
```
π **Read** : [docs/en/05-forms.md](https://github.com/seb-alliot/runique/blob/main/docs/en/05-forms.md) for all field types## π¨ Templates
**Full Documentation** : [Templates Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/06-templates.md)
Use Tera templates:
```html
<h1>{{ title }}</h1>
{% for item in items %}
<p>{{ item }}</p>
{% endfor %}
```
π **Read** : [docs/en/06-templates.md](https://github.com/seb-alliot/runique/blob/main/docs/en/06-templates.md) for complete syntax
---
## ποΈ ORM
**Full Documentation** : [ORM Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/07-orm.md)
Use SeaORM with Django-like pattern:
```rust
impl_objects!(User);
let users = User::objects
.filter(active.eq(true))
.all(&db)
.await?;
```
π **Read** : [docs/en/07-orm.md](https://github.com/seb-alliot/runique/blob/main/docs/en/07-orm.md) for advanced queries
---
## π Middleware
**Full Documentation** : [Middleware Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/08-middleware.md)
Integrated security middleware:
- CSRF Protection
- Content-Security-Policy (CSP)
- Allowed Hosts
- Security Headers
- XSS Sanitizer
π **Read** : [docs/en/08-middleware.md](https://github.com/seb-alliot/runique/blob/main/docs/en/08-middleware.md) for configuration
---
## π¬ Flash Messages
**Full Documentation** : [Flash Messages Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/09-flash-messages.md)
Temporary messages for users:
```rust
success!("Operation successful!");
error!("An error occurred");
warning!("Warning!");
```
π **Read** : [docs/en/09-flash-messages.md](https://github.com/seb-alliot/runique/blob/main/docs/en/09-flash-messages.md) for details
---
## π Examples
**Full Documentation** : [Examples Guide](https://github.com/seb-alliot/runique/blob/main/docs/en/10-examples.md)
Complete usage examples:
- Complete blog application
- User authentication
- File upload
- REST API
π **Read** : [docs/en/10-examples.md](https://github.com/seb-alliot/runique/blob/main/docs/en/10-examples.md) for complete examples
---
## π§ͺ Tests
```bash
# Unit tests
cargo test --lib
# Integration tests
cargo test --test integration_tests
# All tests
cargo test --all
```
Results: **36/36 tests passing** β
---
## π Full Documentation
### English (EN)
- [Installation](https://github.com/seb-alliot/runique/blob/main/docs/en/01-installation.md)
- [Architecture](https://github.com/seb-alliot/runique/blob/main/docs/en/02-architecture.md)
- [Configuration](https://github.com/seb-alliot/runique/blob/main/docs/en/03-configuration.md)
- [Routing](https://github.com/seb-alliot/runique/blob/main/docs/en/04-routing.md)
- [Forms](https://github.com/seb-alliot/runique/blob/main/docs/en/05-forms.md)
- [Templates](https://github.com/seb-alliot/runique/blob/main/docs/en/06-templates.md)
- [ORM](https://github.com/seb-alliot/runique/blob/main/docs/en/07-orm.md)
- [Middleware](https://github.com/seb-alliot/runique/blob/main/docs/en/08-middleware.md)
- [Flash Messages](https://github.com/seb-alliot/runique/blob/main/docs/en/09-flash-messages.md)
- [Examples](https://github.com/seb-alliot/runique/blob/main/docs/en/10-examples.md)
### FranΓ§ais (FR)
- [Installation](https://github.com/seb-alliot/runique/blob/main/docs/fr/01-installation.md)
- [Architecture](https://github.com/seb-alliot/runique/blob/main/docs/fr/02-architecture.md)
- [Configuration](https://github.com/seb-alliot/runique/blob/main/docs/fr/03-configuration.md)
- [Routage](https://github.com/seb-alliot/runique/blob/main/docs/fr/04-routing.md)
- [Formulaires](https://github.com/seb-alliot/runique/blob/main/docs/fr/05-forms.md)
- [Templates](https://github.com/seb-alliot/runique/blob/main/docs/fr/06-templates.md)
- [ORM](https://github.com/seb-alliot/runique/blob/main/docs/fr/07-orm.md)
- [Middlewares](https://github.com/seb-alliot/runique/blob/main/docs/fr/08-middleware.md)
- [Flash Messages](https://github.com/seb-alliot/runique/blob/main/docs/fr/09-flash-messages.md)
- [Exemples](https://github.com/seb-alliot/runique/blob/main/docs/fr/10-examples.md)
---
## π― Quick Start
1. **Read** [Installation](https://github.com/seb-alliot/runique/blob/main/docs/en/01-installation.md)
2. **Understand** [Architecture](https://github.com/seb-alliot/runique/blob/main/docs/en/02-architecture.md)
3. **Check** [Examples](https://github.com/seb-alliot/runique/blob/main/docs/en/10-examples.md)
4. **Start coding** your application
---
## π Project Status
- β
**Compilation** : No errors
- β
**Tests** : 36/36 passing (100%)
- β
**Documentation** : Complete (EN & FR)
- β
**Production** : Ready
See [PROJECT_STATUS.md](https://github.com/seb-alliot/runique/blob/main/PROJECT_STATUS.md) for more details.
---
## π Resources
- π [Project Structure](https://github.com/seb-alliot/runique/blob/main/INDEX.md)
- π [Full Status](https://github.com/seb-alliot/runique/blob/main/PROJECT_STATUS.md)
- π§ͺ [Test Reports](Thttps://github.com/seb-alliot/runique/blob/main/TEST_REPORT.md)
- π [Changelog](https://github.com/seb-alliot/runique/blob/main/CHANGELOG.md)
- π [Documentation Guide](https://github.com/seb-alliot/runique/blob/main/docs/README.md)
---
## π License
MIT License - see [SECURITY.md](https://github.com/seb-alliot/runique/blob/main/SECURITY.md)
---
## π Production Ready
The Runique framework is **stable, tested and documented**, ready for production use.
**Start now** β [Installation](https://github.com/seb-alliot/runique/blob/main/docs/en/01-installation.md)
---