Skip to content

Building a site on TinyTank ​

A new site starts from the skeleton and installs the framework as a Composer package. The site adds its own routes, controllers, templates, content and commands, and never edits the framework.

The rule: never edit vendor/ ​

Everything site-specific lives in your own files:

WhatWhere
Routesconfig/routes.php
Settingsconfig/app.php, .env
Services, Twig extensions, deploy stepsconfig/bootstrap.php
Controllers, commands, other classessrc/ (namespace App\)
Templatestemplates/
Postscontent/
UI textstranslations/
CSS, JS, Vite entry pointsresources/, vite.config.js
Teststests/

Framework improvements then arrive with a single command, without touching your files:

sh
composer update tinytank/framework

If you find yourself needing to change the framework, that's a missing extension point: open an issue or contribute it to TinyTank instead (see Contributing). See Updating TinyTank for versions and what to check after an update.

The extension points ​

Extension pointUse it forGuide
config/bootstrap.phpservices, Twig extensions and globals, deploy stepsServices & bootstrap
$app->containershared objects (a mailer, an API client)Services & bootstrap
src/Command/console commands, registered automaticallyConsole commands
$app->addDeployStep()build steps in bin/console deployDeploy steps
TinyTank\Controllercontrollers with helpersControllers
vite.config.jsentry points, extra Vite pluginsFrontend & Vite

A typical small app ​

TinyTank is not opinionated about your application code. A small app usually is:

  • the blog, for articles around the app's subject
  • one or more custom routes and controllers: the app itself, for instance an interactive home page driven by Datastar, plus JSON endpoints its JavaScript loads ($this->json(…))
  • services for anything shared (config/bootstrap.php)
  • commands for build or maintenance tasks, hooked into deploy when they produce files the site serves

Housekeeping when you start a site ​

  • Commit your composer.lock (remove it from .gitignore first)
  • Replace the Datastar demo page and the sample blog posts
  • Set the real site name, description, default share image and author in config/app.php
  • Choose the languages (language, languages) and fill translations/*.php
  • Prepare each server's .env (APP_URL, APP_SECRET, APP_OPCACHE…), see Servers & Opcache

TinyTank documentation