Skip to content

Latest commit

 

History

196 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watax

watax

A fast, ergonomic web framework for Tauraro — Python-like handlers, Rust-class performance, and automatic memory management.


Quick start

from watax import App
from std.net.http_server import HttpConn
from std.encoding.json import JsonValue

def root(c: HttpConn):
    c.send_text(200, "Hello, World!")

def greet(c: HttpConn):
    mut name = c.request.get_param("name")
    mut o = JsonValue.init_object()
    o.read().obj_set("hello", JsonValue.init_str(name))
    c.send_json_value(200, o)        # watax owns + frees the whole tree

def main():
    mut app = App.new()
        .get("/", root)
        .get("/greet/:name", greet)
    app.listen_reactor_pool("127.0.0.1", 8080, 4)
# watax is a LIBRARY — add it to your app's [deps] and build YOUR app:
taupkg build && ./myapp

A complete, runnable reference app lives in example/app — from the repo root, taupkg build (a taupkg workspace) compiles watax + the app end-to-end and produces example/app/watax_notes.

Builder calls chain fluently across lines (indented .get(...) / .post(...) lines, leading- or trailing-dot). Prefer one binding + a chain over reassigning app on every call.

Example app

example/app is watax-notes, a small modular reference app that exercises nearly the whole framework in one place — templates, static files, form CRUD, a full JSON REST API (with JsonWriter), cookies, search, CORS, rate limiting, chunked CSV, Server-Sent Events, and a WebSocket — with a live browser demo of the streaming endpoints.

Features

  • Routing with path params (/users/:id), wildcards, route groups, and mounts.
  • Responses: text · HTML · JSON (a streaming JsonWriter with no intermediate node tree, or a JsonValue tree) · templates · files · redirects · status-only, plus chunked streaming and Server-Sent Events.
  • Requests: path/query/form params, JSON bodies, cookies, headers, and multipart file uploads.
  • Templates via templa ({% extends %} / {% block %} inheritance + filters).
  • Static files with content-type detection, caching, and SPA fallback.
  • WebSockets (RFC 6455) and TLS (behind -DTAURARO_TLS_OPENSSL).
  • Middleware: before/after hooks, CORS, rate limiting, request logging, signed-cookie sessions.
  • Servers: thread-per-connection and an epoll/kqueue/WSAPoll reactor pool.
  • Zero manual memory management in handlers — the framework and Tauraro's auto-drop free every per-request allocation.

Documentation

Full guides — with examples, when to reach for each feature, how it works, and best practices — live in docs/:

Getting started Routing
Requests Responses
Middleware Templates
Static files JSON
WebSockets Servers & deployment
Configuration Testing
Memory model Cheatsheet

watax is built on the idea that a web framework should be simple to write and cheap to run.

You write plain handler functions; the compiler and framework carry the memory-management burden, so your code stays Python-clean while serving at native speed with a flat, predictable memory footprint.

language: Tauraro performance: native memory: auto-managed HTTP/1.1 WebSockets RFC 6455 TLS license: MIT

#web-framework · #tauraro · #http · #json · #templates · #websockets · #middleware · #reactor · #zero-copy · #memory-safe

About

A fast, ergonomic web framework for Tauraro — Python-like handlers, Rust-class performance, and automatic memory management.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages