This guide gets you from install to a runnable PhalconKit application. If your main goal is a REST API, read this first and then continue with the Build Your First REST Resource.
For a new application, start from the
phalcon-kit/app skeleton:
composer create-project phalcon-kit/app my-api
cd my-apiFor an existing Phalcon application:
composer require phalcon-kit/coreUse phalcon-kit/core for new projects. The old zemit-cms/core package name
exists only for historical projects and pinned legacy installs.
Create or update .env:
APP_NAME="My API"
DATABASE_HOST=127.0.0.1
DATABASE_DBNAME=my_api
DATABASE_USERNAME=my_api
DATABASE_PASSWORD=secretThe app config reads environment values and registers modules, providers,
aliases, permissions, and integrations. Keep secrets in .env; keep structure
in app/Config.
A normal app has a small bootstrap and clear ownership boundaries:
app/
Bootstrap.php
Config/
Models/
Modules/Api/
resources/
migrations/
public/
index.php
loader.php
index.php
cli
websocket
Point the web server at public/, not the project root.
For a quick local test:
php -S 127.0.0.1:8000 -t public public/index.phpFor production-like development, use PHP-FPM behind Nginx, Apache, Caddy, or a container proxy. See Web Server And WebSocket.
After installing dependencies:
composer validate --strict --no-check-publish
composer phpunitIf the application uses the database:
./bin/migration-list.sh
./bin/migration-run.shThe fastest path is:
- Create the table.
- Run migrations.
- Run the scaffolder.
- Add a model-backed API controller.
- Configure permissions.
The full example is in Build Your First REST Resource.
Web entrypoint:
<?php
use App\Bootstrap;
require 'loader.php';
echo (new Bootstrap())->run();CLI entrypoint:
#!/usr/bin/env php
<?php
use App\Bootstrap;
require 'loader.php';
echo (new Bootstrap('cli'))->run();WebSocket entrypoint:
#!/usr/bin/env php
<?php
use App\Bootstrap;
require 'loader.php';
echo (new Bootstrap('ws'))->run();- Build Your First REST Resource: build a complete resource.
- Configuration: configure modules, providers, aliases, and permissions.
- Database And Scaffolding: generate model layers.
- REST APIs: configure resource controllers.