Skip to content

Chapter 37: Complete Feature List

1. What Tina4 Covers

Tina4 is four implementations of the same framework: Python, PHP, Ruby, and Node.js. Every feature listed here ships in all four. The same behaviour. The same API shape. The same test expectations.

9,311 tests across 280 files verify parity. A feature that works in Python works identically in PHP, Ruby, and Node.js.


2. Foundations

#FeatureDescription
01RouterDecorator-based routing with @get, @post, @put, @patch, @delete
02Request / ResponseTyped request object (params, body, headers, session) and fluent response builder
03MiddlewarePer-route and global middleware pipeline with named middleware registry
04Static FilesAutomatic serving of src/public/ with configurable root
05Environment Config.env loading via TINA4_* prefix with type coercion and validation
06Dev DashboardBuilt-in /__dev panel showing routes, logs, cache, queue, and request trace
07Hot ReloadFile watcher restarts the server on source change during development

3. Templates

#FeatureDescription

| 08 | Frond Templates | Tina4's own template engine: {{ var }}, {% if %}, {% for %}, partials, layouts | | 09 | Template Caching | Compiled templates cached in memory; TTL configurable via TINA4_TEMPLATE_CACHE_TTL | | 10 | Asset Helpers | css(), js(), image() helpers with cache-busting query strings |


4. Database

#FeatureDescription
11DatabaseRaw SQL execution: execute, fetch_one, fetch_all, parameterised queries
12Multi-DatabaseMultiple simultaneous connections; switch via Database.use("secondary")
13ORMActive record pattern: save(), find(), find_all(), delete(), soft deletes
14Query BuilderFluent query API: select, where, join, order_by, limit, paginate
15MigrationsVersion-controlled schema changes via migrate up, migrate down, auto-runner
16Transactionsdb.begin(), db.commit(), db.rollback() with context manager support
17Sequence / Next IDDatabase.get_next_id(table) — race-safe sequence via a dedicated sequence table

5. Authentication and Security

#FeatureDescription
18AuthenticationJWT-based auth middleware; @require_auth decorator; token decode helpers
19SessionsServer-side sessions with cookie binding; memory, file, and Redis backends
20CSRF ProtectionToken generation, form injection, and validation middleware
21Rate LimitingPer-IP and per-route request limits via RateLimit:n middleware
22CORSConfigurable origin, method, and header policy via TINA4_CORS_* env vars
23Security HeadersHelmet-style middleware: CSP, X-Frame-Options, HSTS, Referrer-Policy

6. Performance

#FeatureDescription
24Response CacheHTTP-level response caching via ResponseCache:ttl middleware
25Cache APIcache_get, cache_set, cache_delete; memory, Redis, and file backends
26DB Query CacheAutomatic caching of identical database queries; TINA4_DB_CACHE=true
27CompressionGzip/Brotli response compression via Compress middleware

7. Background Processing

#FeatureDescription
28QueuesPush/pop/consume pattern; file, RabbitMQ, Kafka, and MongoDB backends
29Job LifecyclePending → Reserved → Completed/Failed → Dead Letter; retry with retry_failed()
30Service RunnerLong-running background services with start/stop lifecycle and thread management

8. Events and Messaging

#FeatureDescription
31Eventsemit / on / once / off; priority ordering; async via emit_async
32Email (Messenger)SMTP email with HTML bodies, attachments, cc/bcc; dev interception mode
33WebSocket@ws route decorator; broadcast, rooms, ping/pong; tina4-js client library
34SSE / Streamingresponse.stream() for Server-Sent Events; async generator, chunked transfer encoding, keep-alive

9. APIs

#FeatureDescription
35Swagger / OpenAPIAuto-generated OpenAPI 3.0 spec and Swagger UI at /swagger
36GraphQLSchema-first GraphQL with resolvers via @graphql_query and @graphql_mutation
37API ClientOutbound HTTP: Api.get/post/put/patch/delete; auth headers, SSL, timeout
38WSDL / SOAPSOAP 1.1 service with @wsdl_operation; auto WSDL at ?wsdl

10. Tooling and Developer Experience

#FeatureDescription
39Scaffoldingtina4 new, tina4 make:route, tina4 make:model, tina4 make:migration
40TestingBuilt-in test client with client.get/post/put/delete; fixture helpers
41LocalizationJSON locale files; t() function; {placeholder} interpolation; fallback chain
42Structured LoggingLog.info/debug/warning/error; log levels; file output with rotation
43DI ContainerContainer.register (transient) and Container.singleton (cached)
44Frontend (tina4-js)1.5KB core gzipped reactive JS: signals, templating, routing, WebSocket client
45MCP Dev ToolsModel Context Protocol integration: route inspection, ORM access, log streaming

11. Cross-Language Parity

Every feature in the table above ships in all four Tina4 implementations:

ImplementationLanguagePackage
tina4-pythonPython 3.12+pip install tina4-python
tina4-phpPHP 8.2+composer require tina4/tina4-php
tina4-rubyRuby 3.3+gem install tina4-ruby
tina4-nodejsNode.js 20+npm install tina4-nodejs

What parity means in practice:

  • A route defined in Python with @get("/api/users") works identically in PHP as #[Get("/api/users")], in Ruby as get "/api/users", and in Node as router.get("/api/users").
  • A Frond template written once renders correctly when served by any of the four implementations.
  • A test written against the Python test client can be ported line-for-line to the PHP, Ruby, or Node equivalent with only syntax changes.
  • TINA4_* environment variables are honoured by all four implementations with the same semantics.

12. Test Coverage Summary

MetricValue
Total tests9,311
Test files280
Cross-language parity tests45 feature × 4 implementations
Minimum coverage per feature100% (all four languages)

Parity is enforced by the CI pipeline. A feature is not considered shipped until tests pass in all four languages. A bug fix must be applied to all four before it is closed.


13. What Is Not in Tina4

Tina4 is deliberately minimal:

  • No ORM magic / active record inflation: Queries are explicit; the ORM maps rows to objects, it does not generate SQL automatically from relationships.
  • No dependency scanning: The DI container is explicit. You register what you want, not what a scanner finds.
  • No bundled frontend framework: tina4-js is a separate library (1.5KB core, under 6KB full) you opt into. Tina4 itself is backend-only.
  • No cloud vendor lock-in: Queues, cache, sessions, and email are backend-agnostic. The backend is a config variable.

The goal is a framework you can understand completely in a weekend and build on confidently for years.

Sponsored with 🩵 by Code InfinityCode Infinity