Web framework
for Zig

Fast, minimal, built for systems.
HTTP, WebSockets, PostgreSQL, Templates — batteries included.

const std = @import("std");
const spider = @import("spider");

pub fn main(init: std.process.Init) !void {
    var server = try spider.Spider.init(
        init.arena.allocator(), init.io, "127.0.0.1", 8080, .{}
    );
    defer server.deinit();

    try server.get("/", pingHandler).listen();
}

fn pingHandler(alc: std.mem.Allocator,
               _: *spider.Request) !spider.Response {
    return spider.Response.json(alc, .{ .msg = "pong" });
}
New

SpiderStack — Starter Kit

Production-ready boilerplate for Spider. Auth with Google OAuth, CRUD, PWA, HTMX, Alpine.js, dark theme — batteries included.

Auth CRUD PWA HTMX Alpine.js PostgreSQL Tailwind Zig 0.16
View SpiderStack → Zig 0.16 →

Everything you need

Click any card to see docs and examples

Router

Trie-based router with dynamic params /users/:id

WebSocket

WS support + hub broadcasting

→ Live Demo

PostgreSQL

Built-in PG client with pooling

→ Live Demo

Metrics

Internal metrics + dashboard

→ Live Demo

Logger

Structured JSON logging

Pooling

Connection & buffer pooling

Static Files

Built-in static file serving

Graceful Shutdown

Handles SIGINT / SIGTERM

Group Routes

Route prefixes via .groupGet / .group

Request

Params, JSON binding, form & query

Response

HTML, JSON, redirect, status, headers

Middleware

Chain functions via server.use(fn)

Templates

Blocks, variables, loops, if/else, include

Docker

Official Zig image for fast builds

Testing

zig test . + zig fmt .