Authoring Starter Kits
A Starter Kit is simply a Git repository containing a valid Prisma PHP project and a configuration file. You can create custom kits to enforce company standards, pre-install libraries, or scaffold specific architectural patterns.
The Configuration File
The heart of a starter kit is the prisma-php.json file. This tells the CLI how to handle updates and what features your template supports.
Crucial Requirement
You must include the excludeFiles array. This protects your custom entry points (like layout.php or globals.css) from being overwritten when users run the npx pp update project command in the future.
{
"projectName": "my-custom-template",
"version": "1.0.0",
"backendOnly": false,
"swaggerDocs": true,
"tailwindcss": true,
"websocket": false,
"docker": true,
"excludeFiles": [
".env",
"./prisma/schema.prisma",
"./prisma/seed.ts",
"./src/app/globals.css",
"./src/app/index.php",
"./src/app/layout.php",
".gitignore"
]
}
Preparation Steps
Build Your Base Project
Start by creating a standard project using npx create-prisma-php-app. Customize it to your liking: install extra Composer packages, set up directory structures, or add custom UI components.
Clean Up Artifacts
Before publishing, remove any environment-specific or auto-generated files. The CLI will regenerate these for the user.
- node_modules/
- vendor/
- .env (Keep .env.example)
- .git/
Push to Git
Initialize a new Git repository and push your clean project. Ensure the repository is public (or accessible to your users).
Testing Your Kit
Verify that your starter kit works by installing it locally. The CLI should clone it, rename the project in prisma-php.json, and install dependencies.
npx create-prisma-php-app test-project \
--starter-kit=custom \
--starter-kit-source=https://github.com/your-username/your-repo.git
Publisher Checklist
| Item | Reason |
|---|---|
| excludeFiles defined | Prevents updates from breaking the user's app. |
| No secrets in code | Ensure API keys are only in .env (which is ignored). |
| Clean composer.json | Remove any local path repositories or dev-only hacks. |