Skip to content

Tina4Documentation

One framework, four languages, fifty-five features, zero runtime dependencies.

Install

Install the tina4 CLI with one command, then run tina4 setup to scaffold your first project.

curl -fsSL https://tina4.com/install.sh | sh

Save your paid tokens for the hard parts

Let a model that already knows Tina4 write the routes, models, and Tina4CSS. It runs on our infrastructure, so the boilerplate costs nothing and your paid tokens stay free for the real work.

Register Now ->

What's new

v3.13.53 (2026-07-06) - full notes

A model field can now hold a JSON document. Declare it (JSONField in Python, an array-typed property in PHP, json_field in Ruby, { type: "json" } in Node) and the ORM stores an object or array in a JSON column: JSONB on PostgreSQL, JSON on MySQL, NVARCHAR(MAX) on SQL Server, a text BLOB on Firebird, and TEXT on SQLite. It encodes to JSON on write and decodes back to native data on read, so the attribute is never a raw string, and a value that cannot be encoded makes save() fail loud instead of writing a half-formed row.

Recent releases (v3.13.40 - v3.13.52) - Frond gained live blocks ({% live %} regions that render on the server and refresh over polling, Server-Sent Events, or a WebSocket you own); pgsql:// returned as a PostgreSQL connection scheme; the built-in SCSS compiler learned the colour functions (rgba(#hex, a), rgb(), mix(), lighten(), darken()); the dev MCP server moved to the current Streamable HTTP transport over a single /__dev/mcp endpoint, with the legacy HTTP+SSE handshake kept for older clients; Swagger gained per-route security and reusable component schemas; queues were unified on one lifecycle across all four frameworks, with a reservation and visibility timeout so a dead consumer never strands a job; the test suite moved onto real services (no mocks) and caught a batch of live database, broker, and Firebird bugs; and i18n was hardened with partial interpolation that never throws.

Highlights since v3.12.3 - the v3.13 line unified the cache backend (memory, file, redis, valkey, memcached, mongodb, database), gave queues a full lifecycle (priority pop, retry backoff, automatic dead-lettering), added a request-scoped query cache, shipped live dev tooling over WebSocket and a Streamable HTTP /__dev/mcp endpoint, hardened the ORM and database layer to fail loud, and ran a broad security pass. See the full release notes for every version.

How Tina4 reads

Pick a language. Each book stands on its own: you can read Python cover-to-cover, then pick up the PHP book later and recognise every pattern.

  • Understanding Tina4 - Architecture, philosophy, the four-language promise. Read this first if you want the why.
  • Python - The reference implementation. Every feature lands here first.
  • Node.js - TypeScript-first, native node:http, file-based routing, ESM-only.
  • PHP - PHP 8.5, stream_select server, zero composer deps in core.
  • Ruby - Rack 3, Puma in production, WEBrick in dev.
  • tina4-js - The 1.5 KB reactive frontend. Signals, Web Components, router, API client, WebSocket, PWA, SSE.
  • Delphi - FireMonkey cross-platform, FireDAC, REST client, and Twig templates.

Every book has a printable PDF with a clickable table of contents. Every chapter stays in sync with the code: release notes, version numbers, and example output are regenerated with every point release.

🌐

Four Languages, One API

Python, Node.js, PHP, and Ruby share the same project structure, CLI, template syntax, route patterns, and .env variables. Learn one, know all four.

🧭

One CLI to Rule the Stack

The Rust-based `tina4` CLI detects the language, compiles SCSS, watches files, and delegates to the framework. `tina4 init`, `tina4 serve`, and `tina4 migrate` run the same across Python, PHP, Ruby, and Node.js.

📦

Zero Runtime Dependencies

Every Tina4 backend runs on the standard library. No native addons, no node-gyp, no vendor tree. Your requirements.txt / composer.json / Gemfile / package.json each hold one entry.

🛣️

Convention-Based Routing

Drop a file in `src/routes/`. The framework registers it. Typed path params (`{id:int}`, `{slug:slug}`, `{id:uuid}`) reject bad input with 404 before your handler runs.

🔌

Built-in WebSocket + SSE

Real-time bidirectional comms and server-sent events across all backends. Redis backplane for horizontal scaling. The same `WebSocketServer` API in every language.

🎨

Frond (Twig) Templating

One Twig-compatible engine. Variables, loops, template inheritance with `{{ parent() }}`, macros, filters. Write your layout once, render it in any language.

🗃️

Six Databases, One ORM

SQLite, PostgreSQL, MySQL, MSSQL, Firebird, MongoDB. `Database::create("sqlite:///app.db")` works anywhere. `sqlite:///path` is relative to your project root, the same convention across all four frameworks.

🔐

Secure by Default

GET routes are public, POST/PUT/PATCH/DELETE require a bearer token. JWT (HS256/RS256), PBKDF2 password hashing, rate limiting, CSRF form tokens, all built in, nothing to configure.

📋

Swagger at /swagger

Add an `@description` decorator to your route. Visit `/swagger`. Your API docs appear, typed, grouped, ready for your team.

🪢

GraphQL Included

Zero-dependency GraphQL engine. Point it at your ORM models, get a full schema with queries, mutations, and a GraphiQL IDE. `POST /graphql` in one line.

📬

Queues + Background Work

File-backed by default, RabbitMQ/Kafka/MongoDB when you scale. Producer/consumer/dead-letter semantics consistent across languages. Periodic tasks via `background(fn, interval)`, no threads.

🛠️

Dev Dashboard on /__dev

Routes, requests, SQL runner, queue monitor, mailbox, WebSocket inspector, error tracker, AI chat, a shared SPA across all four frameworks. `TINA4_DEBUG=true` turns it on.

Sponsored with 🩵 by Code InfinityCode Infinity