Localzet Server and related projects documentation

Triangle Web

Triangle Web is an MVC project template built on Triangle Engine and Triangle HTTP. Published release: v8.0.1. Composer type is project; the published manifest requires PHP ^8.2, ext-curl, ext-json, Engine ^8.1, Engine HTTP ^2.0, Console ^1.3, Database ^1.0, Session ^1.0, View ^2.0, and Events ^1.0. The current checkout at dc1335b1 is four commits beyond the tag; it retains these constraints, while its preview lock file and CI belong to this checkout.

composer create-project triangle/web:^8.0 my-web-app
cd my-web-app
composer show triangle/engine triangle/engine-http triangle/web

First route and controller

The master entry point loads Composer autoloading, sets paths, loads .env, starts the Engine autoloader, and runs Console. Server settings are in config/server.php; the template listens on http://127.0.0.1:8000 and defaults to cpu_count() * 4 workers.

Register a route in config/route.php:

use Triangle\Request;
use Triangle\Response;
use Triangle\Router;

Router::any('/hello/{name}', function (Request $request, string $name): Response {
    return response("Hello, $name!");
});

The template's app/controller/Index.php shows handlers returning response(...), responseJson(...), and view('index/view', [...]). Views are configured in config/view.php; VIEW_HANDLER selects the renderer (raw by default; blade/think/twig are also listed). A typical HTTP startup is php master start; check commands against the installed Triangle Console version.

Configuration and operations

The template includes config for server, routes, middleware, database, session, views, logging, events, and other integrations. public is for public assets and runtime for runtime files as configured by the project. Change only required settings and keep credentials in the environment rather than tracked config.

The source config/app.php sets debug=true and broad CORS headers: origin *, credentials true, and wildcard methods/headers. Before production, explicitly set debug=false and choose allowed origins, credentials, methods, and headers for trusted clients. Do not treat these defaults as a security policy. Restrict the bind address and network access; the default loopback listener is not public exposure.

Compatibility and checks

Release v8.0.1 constrains Engine to ^8.1 and uses components from the corresponding major lines; it is not an Engine 9 installation. Verify compatibility before updating Triangle components together. composer.json declares no lint/test scripts, so this checkout has no package-provided automated test command. Run HTTP smoke/integration checks in the application with its resolved dependencies. The current README contains badges only; this page is based on the entry point, config, controller, and route source.

Practical guides