edhaase / slim-skeleton
Scaffolding for a web service or application with Slim
Installs: 68
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 2
Forks: 3
Open Issues: 0
Type:project
pkg:composer/edhaase/slim-skeleton
Requires
- php: >=5.5.0
- monolog/monolog: ^1.17
- oscarotero/psr7-middlewares: ^3.8
- slim/slim: ~3.1
- tedivm/stash: ^0.13.1
Requires (Dev)
- codeception/codeception: ^2.1
- squizlabs/php_codesniffer: ^2.5
This package is not auto-updated.
Last update: 2025-10-21 23:57:35 UTC
README
Purpose
The aim of this repository is to provide a solid foundation for building a web service with Slim 3 (repo) using modern practices and to provide examples on how you might use some of it's functionality. To that end, some example routes and controllers are provided, as well as a basic logger and APC/APCu cache provided by Stash. Testing is provided by Codeception.
Installation
Via composer:
composer create-project edhaase/slim-skeleton [destination].
Via git:
- Clone this repo
- Run composer install
- Run composer bootstraporcomposer run-script post-create-project-cmd
- Enjoy!
Regarding the autoloader
This project uses PSR-4 autoloading. See
composer.json for the mappings. If you change them, you'll have to
rebuild the autoloader. You can do this by running
composer dump-autoload --optimize.
Structure
docs/   - PHPDoc output
logs/   - Log output
public/ - Site configuration entry point limits what we expose
tests/  - Codeception tests
src/
    Controller/ - Route controllers
    Model/      - Data models
    Service/    - Service providers
    app.php     - Primary application
    routes.php  - Route creation 
vendor/ - Composer install directory
config.example.php  - Example application config constants
    
Documentation
Documentation can be generated using phpDocumentor.
Tests
composer test
Code standards
This project adheres to the PSR-2 coding style.
Scripts
We've also provided some scripts through composer to make life easier.
composer
        codecept  - shortcut to codecept
        test      - alias for codecept run
        cs        - alias for "phpcs --standard=PSR2 src/",
        cbf       - alias for "phpcbf --standard=PSR2 src/",
        serve     - starts test server
        bootstrap - alias to @post-create-project-cmd