Skip to content

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 in src/templates/, ORM in src/orm/, static files in src/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:

LanguageInstallStart
Pythonpip install tina4_pythonpython -m tina4_python
Node.jsnpm i tina4-nodejsnpx tina4
PHPcomposer require tina4stack/tina4phpphp -S localhost:7145 index.php
Rubygem install tina4-rubytina4

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-key

See Chapter 4: Environment Variables for the full reference.