🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

ranaroussi/tiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

341 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

Tiny β€” PHP Framework

Zero-config, batteries-included PHP framework. Your filesystem is the router. Your SQL is just SQL. You stay in PHP. Runs unchanged on PHP-FPM, Swoole, or FrankenPHP.

PHP License Version

Status: v3.x β€” feature-complete, in active production use. Public API is stable; ScalVer applies.


What makes Tiny different

  • Zero ceremony. Drop a file in app/controllers/. That is the route.
  • Let PHP be PHP. No compilation step, no route cache to warm, no container to restart. Add or remove a file and the change is live instantly. This is what makes Tiny extremely fast and lightweight β€” it doesn't fight the language, it gets out of the way.
  • No magic ORM. Raw SQL with a thin, safe wrapper over MySQL, PostgreSQL, SQLite, and ClickHouse.
  • HTMX-native request/response with auto HX-Push-Url and HTMX-aware redirects.
  • React hybrid renderer β€” SSR on first load, JSON on subsequent requests. One controller, both modes.
  • Built-in scheduler β€” fluent cron-style API with second-level granularity. No external binaries.
  • File-based CMS β€” drop markdown into app/cms/, get pages, posts, tags, and a sitemap-ready API.
  • 30+ integration helpers β€” Stripe, Mailgun, Twilio, Spaces/S3, OAuth, ClickHouse, and more.

Repository structure

Tiny is organized into focused branches. Pick the entry point that matches what you need:

Branch What it is Get started
main This page β€” the landing page You're here
tiny Framework code only β€” for submodules and drop-in use git submodule add -b tiny https://github.com/ranaroussi/tiny.git tiny
boilerplate Full app shell with Docker, Tailwind, build pipeline, tests, and migrations php tiny/cli create my-app
docs Full documentation, examples, and architecture writeups Browse on GitHub

Quick example

Controller β€” app/controllers/users.php becomes /users:

<?php
class Users extends TinyController
{
    public function get($request, $response)
    {
        $users = tiny::model('user')->all();
        $response->render('users/index', ['users' => $users]);
    }
}

Model β€” app/models/user.php:

<?php
class UserModel extends TinyModel
{
    public function all(): array
    {
        return tiny::db()->get('users', null, '*', 'created_at DESC');
    }
}

View β€” app/views/users/index.php:

<?php Layout::default(['title' => 'Users']); ?>
<h1>Users</h1>
<ul>
<?php foreach (tiny::get('users') as $u): ?>
    <li><?= htmlspecialchars($u['name']) ?></li>
<?php endforeach; ?>
</ul>

See the docs branch for the full reference: routing, middleware, HTMX, React rendering, scheduler, testing, deployment, and more.


Contributing

Issues and pull requests welcome at github.com/ranaroussi/tiny. Please match existing code style (PHP 8.3, declare(strict_types=1)).

License

Apache License 2.0. See LICENSE for the full text.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

About

A lightweight PHP framework designed to build web fast applications with minimal setup and configuration.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors