This is a simple skeleton project for Slim 3 that includes Doctrine, Twig, Flash messages, Monolog and JWT token authentication
Base on agustim/slim3-skeleton-mvc-sqlite
-
Create your project:
composer create-project --repository-url https://gitlab.com/semhoun/slim3-skeleton-mvc/raw/master/packages.json -s dev semhoun/slim3-skeleton-mvc your-app
-
Copy the settings file
cp config/settings.php.dist config/settings.php
-
Create database:
php cli.php app:init-db
-
Generate Doctrine entities:
php bin/entities_generator.php
⚠️ Delete all entities before re-generate to update entities.
cd your-app
php -S 0.0.0.0:8888 -t public/
- Browse to http://localhost:8888
Set var
folder permission to writable when deploy to production environment
Default login/password is admin/admin
bin
:Application toolsconfig
: Application middleware and general settingssrc
: Application codesrc/Controller
: All Controller filessrc/Entity
: Doctrine entitiessrc/Lib
: Authentication librariessrc/Command
: CLI commandstemplates
: Twig template filesvar/cache/twig
: Twig's Autocreated cache filesvar/log
: Log filespublic
: Webserver rootvendor
: Composer dependencies
public/index.php
: Entry point to application and bootstrapconfig/settings.php
: Configurationconfig/dependencies.php
: Services for Pimpleconfig/middleware.php
: Application middlewareconfig/routes.php
: All application routes are heresrc/Controller/HomeController.php
: Controller class for the home pagesrc/Entity/Post.php
: Entity class for post tabletemplates/home.twig
: Twig template file for the home pagesrc/Command/InitDB.php
CLI class to create initial database