Introduction
THE is a schema-first framework family. You describe each table once in JSON, and a generator produces the MySQL schema, a role-guarded REST backend and typed frontend services from it.
On this page
How it works
Every THE project has the same three inputs and one command:
- Model schemas in
database/Model/*.json: one file per table, holding the columns, relations and which roles can do which CRUD operations. See Schema →. config.jsonat the project root: database credentials plus the backends and frontends you want generated. See Config →.setup.php, which runs the generatorpuneetxp/compile-php. See Generator →.
php setup.php
The generator writes:
- SQL:
database/structure.sql,relation.sql,insert.sqlandMigration.sql, with MySQL as the default and PostgreSQL as an option. - A backend: models, one controller per role and route files, for PHP, Deno or Python (FastAPI).
- A frontend layer: TypeScript interfaces, API services and stores for Angular (NGXS) or SolidJS.
The generated code runs on a small runtime library for each language. The PHP runtime is puneetxp/the and the Deno runtime is @puneetxp/the. Both use the same concepts: a Model ORM with eager-loaded relations, a router with islogin, roles and guard, and a CRUD shorthand.
Core concepts
| Concept | Meaning |
|---|---|
| Model | One JSON schema, which becomes one table, one model class and one TypeScript interface. |
| Role namespace | Each generated route lives under a role prefix. isuper is for admins, islogin is for any signed-in user and ipublic needs no auth. Custom roles such as executive are also supported. |
| CRUD letters | c create, r read one, u update, d delete, a read all, w where (filter), p upsert (bulk). These are set per role in the schema. |
| Protected controller | A controller you have edited by hand. Its key under table in config.json stops the generator from overwriting it. |
A schema such as this one:
{
"name": "client",
"table": "clients",
"crud": { "isuper": ["c", "r", "u", "d", "a"], "islogin": ["c", "r", "u", "a", "w"] },
"data": [{ "name": "name", "mysql_data": "varchar(255)", "datatype": "string" }],
"relations": ["user"]
}
produces:
- a
clientstable with auser_idforeign key; /api/isuper/clientand/api/islogin/clientendpoints for the listed operations;- a
ClientTypeScript interface and aClientServiceon the frontend.
Where to go next
- Projects → lists every repository in the family and its status.
- Quick Start → takes you from zero to a running app.
- INTAX Billing → walks through a real production app built with THE, using Deno, SolidJS and MySQL.