ASYNC-FIRST.
SPEC-DRIVEN.
TYPE-SAFE.

Aura is an elegant, NestJS-inspired Python web framework built on raw performance and structured modularity. Designed to eradicate Django's legacy blocking ORM and FastAPI's structureless file chaos, Aura brings production-grade architecture to the Python ecosystem.

$
AURA ENGINE SPECS VERSION 0.4.9
RUNTIME TARGET Python 3.10+ (Strict Typings)
ASGI CORE Starlette (Non-Blocking)
DATA VALIDATION Pydantic v2 (Rust-Powered)
ORM CORE SQLAlchemy 2.x (True Async)
TASK QUEUE SAQ (Redis Backed Async)
RENDER ENGINE Jinja2 Template Engine
STATIC VERIFIER Mypy Strict & Ruff Linter

THE ENGINE OF TOMORROW

Aura solves the core architectural problems of traditional Python web frameworks with native speed and strict typing.

NATIVE ASYNC CONCURRENCY

Django's pseudo-async ORM forces blocking database calls into worker threads, causing massive context-switching overhead and event loop delay. Aura uses true asynchronous SQLAlchemy 2.x and asyncpg pooling, driving native non-blocking loops at scale.

STRUCTURED MODULARITY

FastAPI projects often collapse under circular imports and unstructured file layout. Aura introduces NestJS-inspired modules `@Module()`, explicitly binding controllers, services, and repositories inside clean boundaries that are highly testable.

FAIL-CLOSED SECURITY

Never leak administrative access in production. Aura's Admin Panel detects the production flag and actively prevents app startup if the admin password environment variable is missing, guaranteeing zero accidental exposure.

HIGH-VOLUME SERIALIZATION SPEED TEST 5,000 Complex Records Generation
Django REST Framework (DRF)
12.80s
FastAPI (Pydantic v1)
0.048s
Aura (Pydantic v2 C-Core)
0.034s

AURA COMMAND LINER

Compile production scaffolding instantly. Experience the brutalist efficiency of our CLI generators.

aura new --scaffold
# scaffold a full NestJS-inspired, async-first application structure
$ aura new aura-app --dir ./workspace
cd aura-app
pip install -e ".[dev]"
aura run --reload

THE ARCHITECTURAL SHIELD

Four interconnected clean layers designed to preserve architectural boundaries and isolate side effects.

01

MÓDULOS

Registry declaration context that isolates, binds, and configures localized controllers, guards, and services.

@Module Decorator
02

CONTROLLERS

Pure ASGI routing nodes executing parameters, guard pipelines, and serializing typed payloads.

@get / @post / @html
03

SERVICES

Stateful business controllers resolved dynamically via robust, cross-thread Dependency Injection.

@injectable Injector
04

REPOSITORIES

Layered database connectors driving native asynchronous transactions under unified connection pooling.

Repository[Model]

THE ARCHITECTURAL BREAKDOWN

Compare actual production headaches against clean modern implementations.

HEADACHE DEFINITION LEGACY FRAMEWORKS AURA FRAMEWORK REMEDY
Monolithic Configuration Django settings.py files scaling to 800+ lines. Declaring localized settings per module using typed models and aura.toml contexts.
Async-to-Sync Blocking ORM Django ORM requiring blocking wrappers or causing threadpool exhaustion. Native async SQLAlchemy 2.x database connections executing transparently in background loops.
Unstructured Routing Files FastAPI systems developing in dozens of unstructured file formats. NestJS-style modular architectures providing clear separation between request/response structures.
Restricted Dependency Injection FastAPI Depends() injection that only resolves during HTTP request-response loops. Global DIContainer resolving dependencies safely in jobs, CLI, workers, and background threads.
Blocking Background Tasks Complex and heavy Celery frameworks running synchronous tasks. Lightweight, modern async tasks triggered globally with the simple @task decorator.

DOCUMENTATION & APIS

Search standard commands, view framework examples, and copy production ready snippets.

Quick Start

Generate a complete, fully functional Restful modular template using our custom CLI tool in seconds.

Initial Scaffolding

Launch the global generator utility to structure files, setup configurations, and write primary unit tests:

$ aura new meu-projeto
$ cd meu_projeto
$ pip install -e ".[dev]"
$ aura run --reload
REGISTRY VERIFICATION
The scaffolding controller binds auto-generated route targets immediately. Point a browser to http://localhost:8000/docs to explore the fully functional interactive Swagger documentation interface.

Installation

Aura uses conditional extras packaging to minimize bundle size, ensure high scalability, and avoid loading redundant backend packages into small microservices.

Target Selection Packages

Install targeted components based on production needs:

# Standard REST API runtime (Uvicorn core wrapper)
pip install "aura-web[uvicorn]"

# Full template package incorporating Jinja2 engines
pip install "aura-web[uvicorn,templates]"

# Full SQL support with asynchronous SQLAlchemy pools
pip install "aura-web[uvicorn,sqlalchemy]"

# Production package incorporating all extras
pip install "aura-web[all]"

Project Layout

Aura strictly separates localized domains using cohesive modular folders. Every single module contains everything it needs to function correctly.

Domain Package View

A typical modular layout includes:

meu_projeto/
├── main.py                      # App initialization: app = Aura(modules=[UsersModule])
├── aura.toml                    # Strict typed configuration variables
├── modules/
│   └── users/
│       ├── schemas.py           # Typed Pydantic DTO definitions
│       ├── service.py           # Stateful business logic (@injectable)
│       ├── controller.py        # Routing node decorators (@get, @post)
│       ├── repository.py        # Asynchronous SQL repository
│       ├── model.py             # SQLAlchemy 2.x Entity layout
│       └── module.py            # Binds services, controllers, guards
└── tests/
    └── test_users.py            # Complete isolated async integration tests

Modules & Dependency Injection

Isolate localized context domains cleanly. Aura dependencies are instantiated as Singletons, Scoped, or Transients globally, then injected into targets via clear constructor declarations.

Structuring a module

Declare modular packages cleanly using decorators:

# modules/posts/module.py
from aura import Module
from .controller import PostsController
from .service import PostService

@Module(
    providers=[PostService],
    controllers=[PostsController],
    prefix="/posts",
    tags=["Posts"]
)
class PostsModule:
    pass

Service Injection

Declare clean state injectors that do not rely on standard HTTP contexts:

# service.py
from aura import injectable
from .repository import PostRepository

@injectable
class PostService:
    def __init__(self, post_repository: PostRepository) -> None:
        self.repo = post_repository # Auto-resolved from the container!

Controllers & Routing

Bind endpoint routes to actions smoothly using declarative decorators. Type conversions and query validations are checked transparently.

Creating controllers

Map path routes to actions easily:

# controller.py
from aura import get, post, put, Body, Query
from .schemas import CreatePostDTO, PostResponse
from .service import PostService

class PostsController:
    def __init__(self, service: PostService) -> None:
        self.service = service

    @get("/")
    async def list_posts(self, page: Query[int] = 1) -> list[PostResponse]:
        return await self.service.list_posts(page)

    @post("/", status=201)
    async def create_post(self, body: Body[CreatePostDTO]) -> PostResponse:
        return await self.service.create_post(body)

Models & Repository

Drive database mutations safely using fully non-blocking asynchronous operations. The Repository abstraction exposes built-in pagination, bulk queries, and transaction control.

Defining entities

Map fields cleanly using standard types:

# models.py
from aura.orm import AuraModel, CharField, TextField, BooleanField
from sqlalchemy.orm import Mapped

class Post(AuraModel):
    __tablename__ = "posts"

    title: Mapped[str] = CharField(max_length=200)
    body: Mapped[str] = TextField()
    published: Mapped[bool] = BooleanField(default=False)

Repository Queries

Write robust operations using Aura's fluent query system:

# repository.py
from aura.orm import Repository
from .models import Post

class PostRepository(Repository[Post]):
    model = Post

    async def list_published(self, limit: int = 10) -> list[Post]:
        return await (
            Post.objects
            .filter(published=True)
            .order_by("-created_at")
            .limit(limit)
            .all()
        )

Factories & Seeders

Generate highly realistic testing records and mock local databases smoothly using built-in model factories and seeders.

Generating factories

Build custom object structures easily:

# database/factories.py
from aura.orm import Factory
from modules.users.models import User

class UserFactory(Factory[User]):
    model = User

    def definition(self) -> dict:
        return {
            "name": lambda: self.faker.name(),
            "email": lambda: self.faker.unique.email(),
            "active": True
        }

Managing Database seeders

Populate tables cleanly inside atomic transactions:

# database/seeders.py
from aura.orm import Seeder
from database.factories import UserFactory

class DatabaseSeeder(Seeder):
    async def run(self) -> None:
        # Create 50 active users inside database automatically
        await UserFactory().create_many(50)

JWT & Guards

Inject security controls, credential verification, and path permissions instantly using flexible Guard chains.

Configuring auth barriers

Apply guards to specialized endpoint routes instantly:

# controller.py
from aura import get, AuraRequest
from aura.guards import JWTGuard

class UserController:
    @get("/me", guards=[JWTGuard(secret="sua-chave-secreta")])
    async def get_me(self, request: AuraRequest) -> dict:
        return request.state.user # JWT Decoded payload!

Sessions Control

Track client details and session parameters safely across requests using standard encrypted browser cookies.

Binding Session Middlewares

Load configuration settings smoothly:

# main.py
from aura import Aura
from aura.middleware import SessionMiddleware

app = Aura(
    modules=[UsersModule],
    middleware=[
        SessionMiddleware(secret_key="sua-chave-secreta-longa")
    ]
)

Background Jobs

Execute long-running actions, generate PDFs, and dispatch email queues safely using lightweight background tasks.

Task Decoration

Declare non-blocking executions smoothly:

# jobs.py
from aura.jobs import task, periodic

@task(queue="emails")
async def send_welcome_email(email: str) -> None:
    await mailer.send(email, "Welcome to Aura!")

@periodic(cron="0 8 * * *")
async def daily_cleanup() -> None:
    await database.purge_expired_sessions()

Async Logging

Protect performance loops using a high-throughput, asynchronous logging system built directly into the core engine framework.

Using the Log Facade

Send messages, tracking IDs, and exceptions easily without stalling the ASGI loops:

from aura.logging import Log

# Simple info log
Log.info("Transaction initialized")

# Structured log incorporating sanitization
Log.warning(
    "Unauthorized API access attempt",
    api_key="api_xyz123",  # Automatically redacted: ***REDACTED***
    ip="192.168.1.1"
)