Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Azu Web Framework

Azu is a high-performance web framework for Crystal emphasizing type safety, modularity, and real-time capabilities.

Quick Example

require "azu"

module MyApp
  include Azu

  configure do
    port = 3000
  end
end

struct HelloRequest
  include Azu::Request
  getter name : String = "World"
end

struct HelloResponse
  include Azu::Response
  def initialize(@name : String); end
  def render
    "Hello, #{@name}!"
  end
end

struct HelloEndpoint
  include Azu::Endpoint(HelloRequest, HelloResponse)
  get "/"
  def call : HelloResponse
    HelloResponse.new(hello_request.name)
  end
end

MyApp.start [
  Azu::Handler::Logger.new,
  Azu::Handler::Rescuer.new
]

Architecture

HTTP Request → Router → Middleware Chain → Endpoint → Response
                                              ↓
                                    Request Contract (validation)

Endpoints are type-safe handlers with:

  • Request Contract: Validates and types incoming data
  • Response Object: Handles content rendering
  • Middleware: Cross-cutting concerns (auth, logging, etc.)

Core Features

Feature Description
Type-Safe Contracts Compile-time validation via Azu::Request
Radix Routing O(log n) lookup with path caching
WebSocket Channels Real-time bidirectional communication
Live Components Server-rendered with client sync (Spark)
Multi-Store Cache Memory and Redis with auto-metrics
Middleware Stack CORS, CSRF, Rate Limiting, Logging

Documentation

New to Azu? Need to do something? Looking for API? Want to understand?
Tutorials How-To Guides Reference Explanation

Tutorials

Step-by-step lessons to learn Azu:

How-To Guides

Task-oriented guides for specific goals:

Reference

Technical specifications and API documentation:

Explanation

Conceptual understanding of Azu:

Resources

  • FAQ - Common questions and troubleshooting
  • Contributing - Development setup and guidelines