Prisma PHP is a modern full-stack PHP framework that combines native PHP, PulsePoint reactivity, PHPX components, and a Prisma-inspired ORM into one cohesive developer experience.
Build reactive interfaces with a server-first mental model, structured routing, type-safe data access, and a project layout designed for real applications.
Create a new Prisma PHP project:
npx create-prisma-php-app@latest my-appStart the development server:
npm run devOpen the local app in your browser after the dev server starts.
Before creating a Prisma PHP project, make sure you have:
- Node.js 22.x or higher
- PHP 8.2 or higher
- Composer 2.x or higher
- XAMPP or another local PHP environment
If you are using XAMPP on Windows, enabling extension=zip in php.ini is recommended so Composer dependencies install correctly.
Prisma PHP brings together the core pieces needed to build full-stack PHP apps:
- Native PHP + modern reactivity with PulsePoint
- Direct RPC from the frontend with
pp.rpc(...)calling#[Exposed]PHP functions — JSON in, JSON out, SSE streaming when the function yields, and framework failures reported as real HTTP statuses - Named sockets for realtime with
pp.socket(...)— long-lived bidirectional messaging (chat, presence, live feeds) served by a Ratchet-based socket server with per-socket auth, origin checks, and rate limits - PHPX component system for reusable UI composition
- Prisma PHP ORM for schema-first, type-safe database access
- Built-in authentication patterns for sessions, route protection, RBAC, credentials auth, and provider login
- Hardened request pipeline with double-submit CSRF (
pp_csrfcookie family), origin validation, content-type checks, and per-function rate limiting - File-based routing with clear route file conventions
- App-level test suite with PHPUnit in a root
tests/directory, run withnpm run test, feature-aware viaprisma-php.json - CLI scaffolding for new apps, starter kits, and optional features
- Flexible deployment options for local development and production workflows
Create a default full-stack app:
npx create-prisma-php-app@latest my-appCreate a project with common options:
npx create-prisma-php-app@latest my-app --tailwindcss --typescriptUse a starter kit:
npx create-prisma-php-app my-app --starter-kit=fullstackOther documented flags may include capabilities such as WebSocket support, MCP support, backend-only mode, Swagger docs, and Prisma integration depending on the installed version.
Prisma PHP ships with local documentation for the installed project version.
The installed docs live here:
node_modules/prisma-php/dist/docsTreat these installed docs as the primary documentation source for the current project version.
You can also explore the public docs site:
https://prismaphp.tsnc.tech/If you are using AI-assisted development in a Prisma PHP project:
- Read
./prisma-php.jsonfirst. - Read the installed docs in
node_modules/prisma-php/dist/docs. - Read
AGENTS.mdfor task-routing rules, framework constraints, and code-generation guidance. - Inspect
vendor/tsnc/prisma-php/srconly when the docs do not answer the task.
Prisma PHP uses prisma-php.json at the repository root as the source of truth for enabled framework features and local environment configuration.
Use it to verify capabilities such as:
- Tailwind CSS support
- backend-only mode
- Prisma ORM support
- Swagger docs
- WebSocket support
- MCP support
- TypeScript support
- local development paths and BrowserSync settings
Do not assume a feature is enabled unless prisma-php.json confirms it.
Use these docs as the main entry points for common work:
index.mdfor the general documentation entry pointproject-structure.mdfor project structure, route placement, and file conventionslayouts-and-pages.mdfor pages, layouts, nested routes, and dynamic routescomponents.mdfor PHPX components, props, children, fragments, icons, buttons, and compositionfetching-data.mdforpp.rpc(...),#[Exposed], streaming, and the RPC error contractwebsocket.mdfor named sockets,pp.socket(...),SocketRegistry, and the realtime wire contractbootstrap-runtime.mdfor the runtime init order, PulsePoint wire headers, and thepp_csrfCSRF contracttesting.mdfor the roottests/directory,npm run test, and feature-gated testsprisma-php-orm.mdfor Prisma ORM,schema.prisma, migrations, and generated PHP classesauthentication.mdfor auth strategy, sessions, RBAC, credentials auth, and provider flowsfile-manager.mdfor uploads,multipart/form-data,$_FILES, andPP\FileManager\UploadFileroute-handlers.mdforroute.php, JSON responses, and direct server handlerserror-handling.mdfor expected errors,error.php,not-found.php, and validation failurescaching.mdfor cache behavior andCacheHandlermetadata-and-og-images.mdfor metadata, title, description, icons, and head behaviorpulsepoint.mdfor PulsePoint runtime usage and reactivity patternsupgrading.mdfor feature enablement and project update workflows
When working in Prisma PHP:
- prefer the installed Prisma PHP docs over assumptions from other frameworks
- use
AGENTS.mdas the strict AI operating guide - inspect nearby project files before generating new framework-specific code
- inspect framework internals only when the installed docs are not enough
Prisma PHP uses file-based routing with special route files such as:
index.phpfor rendered UI routeslayout.phpfor shared UI wrappersroute.phpfor direct handlers such as JSON or API-style endpointsloading.phpfor loading UInot-found.phpfor route-level not-found UIerror.phpfor route-level or app-level error UI
For task-specific route decision rules and framework generation rules, read AGENTS.md.
Prisma PHP uses PulsePoint for browser-side reactivity and as the wire between the page and PHP.
When working with runtime features such as:
pp.statepp.effectpp.refpp.rpcfor frontend-to-PHP calls (with streaming, uploads, and redirects)pp.socketfor named-socket realtime messagingpp-forpp-spreadpp-ref
read the installed Prisma PHP docs for the current version first, then consult:
https://pulsepoint.tsnc.tech/llmsA generated Prisma PHP project typically includes folders like these:
prisma-php-project/
├── prisma/ # schema, migrations, seed files
├── public/ # public entry point and assets
├── settings/ # project configuration
├── src/ # application source code
├── tests/ # app-level PHPUnit tests (npm run test)
├── package.json # frontend/dev scripts
├── composer.json # PHP dependencies
├── phpunit.xml # test suite configuration
└── prisma-php.json # Prisma PHP project capability manifest
App tests live in the root tests/ directory and run with:
npm run testThe suite runs PHPUnit on the PHP binary configured in prisma-php.json, uses a deterministic test environment (the real .env is never loaded), and is feature-aware: tests for optional features such as WebSocket skip cleanly when the feature is disabled in prisma-php.json. Read testing.md in the installed docs and the project's tests/README.md for the full contract.
When enabling features or syncing framework-managed project files:
- Update
prisma-php.jsonfirst. - Read
upgrading.mdin the installed docs. - Run the documented project update workflow for the current version.
Start with the installed docs for the current project version, use the topic-specific markdown guides for focused work, and rely on AGENTS.md when strict AI generation rules are needed.