swadhinbiswas πŸ“š docs: update README and docs_site with CI/CD, uv, security, OIDC changes Β· 7/25/2026
65afe21
159 lines Β· 4.8 KB
Raw Download

justapi Runtime

A production-grade Python web framework written in Rust. Rust owns the
network/protocol stack; Python executes only application logic.

10-20x faster than FastAPI β€” see BENCHMARKS.md.

Project Status

Phase 40 β€” The JustAPI 2.0 "Singularity" Release (ready for publish)

All 39 prior phases complete. CI/CD pipeline overhauled: uv-based builds, cargo-deny security audit, Miri memory safety, OIDC trusted publishing to PyPI. See PLAN.md for the full roadmap.

Architecture

Kernel β†’ epoll/io_uring β†’ Connection Manager β†’ tokio task
  β†’ TLS (rustls) β†’ HTTP parse (hyper) β†’ Router (matchit)
  β†’ Middleware chain (Rust: auth/CORS/rate-limit/compression)
  β†’ Python boundary (typed, zero-copy request view via PyO3)
  β†’ Application code (native Python handler)
  β†’ Rust serializer (serde_json/simd-json)
  β†’ Response write β†’ Socket

justapi provides a single native Python API (Tier B) β€” the FastAPI
replacement that runs entirely in Rust with zero-copy Python integration.

Quick Start

Python Native API

from justapi import JustAPIApp

app = JustAPIApp()

@app.get("/hello/{name}")
async def hello_handler(request):
    name = request["path_params"]["name"]
    return {"message": f"Hello {name}!"}

app.run("127.0.0.1:8080")

Install the package:

pip install justapi           # via pip
uv pip install justapi        # via uv (recommended)
uvx justapi create my_app     # no install needed

Or build from source with maturin:

cd crates/justapi-py
maturin develop --release

CLI

# Run server with Rust-defined routes
justapi serve --addr 127.0.0.1:8080

# Generate a client SDK from your API
justapi gen-client --lang python

Features

Area Status
HTTP/1.1 & HTTP/2 βœ… 324k req/s hello-world
WebSocket & SSE βœ… Streaming, token-generation optimized
TLS (rustls) βœ… 10.7% overhead
Middleware βœ… CORS, SecurityHeaders, JWT, RateLimiter
JWT Auth βœ… RS256/ES256, per-route roles/scopes
Serialization βœ… serde_json, simd-json optional
Request Validation βœ… JSON Schema, Pydantic bridge
OpenAPI Generation βœ… Auto-generated /docs and /redoc
Database ORM βœ… SQLite/PostgreSQL/MySQL via sqlx
gRPC βœ… Native Tonic integration
GraphQL βœ… async-graphql, Apollo Federation
Observability βœ… OTel tracing, Prometheus metrics, structured logging
Resilience βœ… Circuit breakers, retry, fallback, bulkhead
Rate Limiting βœ… GCRA algorithm, Redis-backed
WASM Middleware βœ… wasmtime embedded plugins
Agent DAG Engine βœ… DAG orchestration in Rust
Background Tasks βœ… Thread-safe task scheduling
Dependency Injection βœ… Litestar-style tiered DI
Snapshot Testing βœ… Built-in test utilities
Static Files βœ… Range requests, MIME detection
Compression βœ… gzip/deflate/brotli/zstd
Plugin System βœ… Third-party plugin API
Memory Safety βœ… Miri-verified unsafe blocks, 6 fuzz targets
Supply Chain Security βœ… cargo-deny v0.20 β€” advisories, bans, licenses, sources

Development

Prerequisites

  • Rust 1.85+ (edition 2021)
  • Python 3.11+

Building

cargo build --workspace               # debug build
cargo build --workspace --release      # release build
cargo test --workspace                 # run all tests (493+)
cargo clippy --workspace --tests -- -D warnings # lint
cargo fmt --check                      # format check
cargo deny check                       # supply chain security audit
cargo miri test -p justapi-core        # memory safety (nightly)

Benchmarking

See BENCHMARKS.md for methodology and results.

# Install load generator
cargo install oha

# Run baseline benchmarks
bash benchmarks/run_baselines.sh

Project Structure

crates/
  justapi-core/   β€” networking, protocol, scheduler, memory
  justapi-py/     β€” PyO3 bindings, native Python API
  justapi-cli/    β€” `justapi` CLI binary
  justapi-bench/  β€” internal benchmark harness
python/
  justapi/        β€” pip-installable Python package
fuzz/              β€” cargo-fuzz targets (6 targets)
docs/              β€” documentation
skills/            β€” reusable knowledge modules for development
benchmarks/        β€” workload scripts for performance testing

Documentation

License

MIT