Understanding Tina4 – Quick Reference
TIP
- Tina4 is a toolkit, not a framework — one package, zero config, convention over configuration
- Same API across Python, Node.js, PHP, and Ruby — learn one, know all four
- Routes in
src/routes/, templates insrc/templates/, ORM insrc/orm/, static files insrc/public/ - Zero runtime dependencies in every language
Philosophy
Tina4 follows the "not a framework" philosophy. One package. One folder structure. Zero configuration files beyond a .env. You write your code, drop it in the right folder, and Tina4 discovers it.
Installation
Choose your language:
| Language | Install | Start |
|---|---|---|
| Python | pip install tina4_python | python -m tina4_python |
| Node.js | npm i tina4-nodejs | npx tina4 |
| PHP | composer require tina4stack/tina4php | php -S localhost:7145 index.php |
| Ruby | gem install tina4-ruby | tina4 |
Project Structure
Every Tina4 project follows the same layout regardless of language:
project/
.env # Environment configuration
src/
routes/ # API endpoints and page routes
templates/ # Frond/Twig templates
orm/ # Database models
services/ # Background services
migrations/ # Database migrations
src/public/ # Static assets (CSS, JS, images)Choosing a Language
All four languages share the same conventions:
- Python — Best for data science, ML integration, rapid prototyping
- Node.js — Best for real-time apps, highest raw throughput, JavaScript everywhere
- PHP — Best for shared hosting, WordPress ecosystem, legacy integration
- Ruby — Best for developer happiness, clean syntax, rapid development
See Chapter 3: Choosing Your Language for a detailed comparison.
Environment Variables
All configuration lives in a single .env file:
dotenv
# Database
DATABASE_URL=sqlite://app.db
# Server
PORT=7145
DEBUG=true
# Authentication
AUTH_SECRET=your-secret-keySee Chapter 4: Environment Variables for the full reference.