SilexStarter is starter application built by extending Silex micro framework. Built with purpose for rapid prototyping, it can generate clean and well organized code just in few minutes.
With modular architecture in mind, you can easily add or remove module, generate module scaffolding, install module via composer, or just drop module package in app/modules directory, and you are ready to go.
SilexStarter can be installed using composer, or clone directly from github repository and run
composer install. Currently, SilexStarter has no stable version yet, as we are waiting for your feedback 🙂
Installation via composer can be done with following command:
composer create-project xsanisty/silexstarter target_dir dev-develop -s dev
Wait for composer downloading all required dependencies and generating autoload configuration, when it finished, we can start initializing our application with single step as SilexStarter utilized with console tool to help us do repeated task in view commands.
It will guide you to configure the database, publishing assets, migrating database structure, and add default user (default user is ‘firstname.lastname@example.org’ and password is ‘password’).
As SilexStarter is built for rapid prototyping, it utilized with several commands like scaffolding generator command to help you generate basic structure based on repository pattern, and module creator command to help you generate basic module structure.
Creating First Module
First thing first, SilexStarter is built with modular architecture, we treat and organize everything as module, so let’s create our first module with the following simple command
./xpress module:create client-manager
It will create directory structure inside app/modules and generate basic module provider class with some basic configuration. It also create menu configuration, so dashboard module can list module menu in it’s sidebar.
Once you finished building your module, you can take out the module out of app/modules directory and build composer package independently, so it can be published on packagist.
Creating First Scaffolding
Once the module is generated, it is time to scaffold our module’s feature set. It is as simple as other command
./xpress scaffold client -m client-manager -d ajax -f 'id:increments|name:string|company:string|phone:string|email:string|address:text' --migrate
Its scaffold command for generating basic scaffolding for client feature, scaffold command accept several arguments and options, on the example above, it can be broken down as below
./xpressThis is the SilexStarter console application
scaffoldThis is the scaffold command
clientThe entity name
-m client-managerThe target module, so the scaffolding will be generated into client-manager module, it can be written as
-d ajaxThis scaffolding mode, it will generate scaffolding based on ajax template, it accept standard (default), api, and ajax
-f '...field-definition..'This is the field definition, can be written as
--migrateThis tell the command to migrate the database migration after the scaffolding is generated
Now you can see your module menu appear in the dashboard sidebar, and start adding new client into database.
Detailed documentation is still work in progress 🙂