xsanisty/silexstarter
A starter kit for the Silex PHP micro-framework, offering a ready-to-use project skeleton with routing, service providers, configuration, and sensible defaults to help you bootstrap small PHP applications quickly.
1. Install and boot
composer create-project xsanisty/silexstarter my-app
cd my-app
The starter is Silex-based, not Laravel — expect a composer.json pinned around Silex 2.x, Symfony components, Twig, Doctrine DBAL, and a console entry point. Check the composer.json PHP constraint first; this is the single biggest gate on whether you can run it on your machine.
2. Configure the environment
Look for a config/ directory (or app/config/) split by environment. Set your database credentials there, then run the console to build schema and an admin user:
php console migrate
php console user:create --admin
The exact command names vary by version — run php console list first. That command list is also your best map of what the scaffold generator can do, so read it before touching code.
3. Where to look first
Read these three things in order, and you'll understand the whole app:
app/modules/ (or src/) — the modular structure is the backbone. Each module should have its own controllers, models, views, routes, and service provider registration.4. First real use case
Don't hand-write your first CRUD. Use the scaffold generator to produce one, then read the generated output as documentation:
php console generate:scaffold Product --fields="name:string,price:decimal,active:boolean"
Whatever it emits (controller, model, migration, list/form views, route registration) is the canonical pattern for the app. Copy that shape for everything after.
Module-per-feature organization
Keep each domain concern in its own module folder rather than growing a shared controllers/ dump. A module should own its routes, service provider bindings, models, views, and migrations together. This makes the app portable and lets you drop modules between projects — which is clearly the intended use given the "modular arch" framing.
Register everything through the container
Silex's Pimple container is the integration seam. New services (mailers, API clients, custom repositories) should be registered in a service provider and consumed via $app['your.service'] in controllers — never instantiated inline. When you add a module, add its provider registration in the app bootstrap in the same style as existing modules.
Thin controllers, dedicated model/repository layer
Controllers should parse the request, call a model or repository, and hand data to Twig. The starter's DB layer is Doctrine DBAL-flavored, so expect query-builder style code rather than Eloquent-style active records. Keep SQL out of controllers — put it in a per-module model/repository class so the scaffold generator's conventions stay readable.
Scaffold-then-edit workflow
Treat the generator as a first draft, not a final answer:
This is far faster than writing CRUD by hand and keeps you aligned with the framework's conventions even when you rewrite 60% of the output.
Admin panel as an internal tool
The bundled admin is best treated as a back-office CRUD surface, not a product UI. Register models there for content editing and keep user-facing pages in separate modules with their own Twig layout. Don't try to theme the admin into a customer-facing experience — you'll fight the bundled assets.
Route grouping and middleware for auth
Apply the security middleware at the route-collection level rather than per-route, so new admin routes inherit protection automatically:
$app->mount('/admin', new AdminRoutesProvider())
->before($app['admin.auth.middleware']);
Miss this once and you ship an unauthenticated admin panel.
Integration tips
Silex is end-of-life — plan accordingly
Silex was deprecated and its development ended years ago. This is the dominant risk with this starter: you are adopting an unmaintained micro-framework. Practical consequences:
composer update your way onto PHP 8.If this is a long-lived project, the honest recommendation is to mine this starter for its module structure and scaffold approach, then rebuild on Symfony or Laravel — not to extend the Silex app.
Low star count means low bus factor
Eleven stars means almost no one is running this in production. Assume bugs are undiscovered and documentation is incomplete. Read the generator source before trusting its output; treat every bundled feature as unverified until you've tested it.
Scaffold generator pitfalls
var/cache or similar) before debugging anything else. Silex caches aggressively.Container and config quirks
dev override is a common cause.Database and migrations
Security
Extension points worth knowing
How can I help you explore Laravel packages today?