jyoungblood / slime
Starter kit for building web apps with Slim 4
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 4
Language:HTML
Type:project
Requires
- jyoungblood/cookie: ^1.1
- jyoungblood/dbkit: ^1.2
- jyoungblood/http-request: ^1.2
- jyoungblood/slime-render: ^1.3
- jyoungblood/x-utilities: ^1.2
- slim/psr7: ^1.6.1
- slim/slim: 4.*
- vlucas/phpdotenv: ^5.6
- zordius/lightncandy: ^1.2
README
Starter kit for building web applications with Slim PHP Framework
- Documentation: https://slime.technology/
- Demo SRC: https://github.com/jyoungblood/slime-demo
SLIME is a highly opinionated boilerplate for Slim applications. It's designed for solo developers working in "small scale" environments. While it produces a reliable final product, this configuration focuses on developer velocity, making it easy to provide value quickly without introducing unnecessary technical overhead.
What's included?
-
Slim v4 (w/ Slim PSR-7)
-
Handlebars templating - Lightncandy
-
View rendering helpers - Slime Render
-
Helpful Vanilla PHP abstraction libraries:
- Database handlers - DB Kit
- Cookie handlers - Cookie
- Simple HTTP client - HTTP Request
- Misc utility functions - X-Utilities
-
Minimal front-end boilerplate & utility library options - scratch
-
Simple organization - folders for css, js, images, templates, and controllers
-
Blank CSS and JS placeholder files
-
.env - helpful basic variables and settings, pre-wired with phpdotenv
-
index.php - initialized Slim application w/ middleware, db connection, and default 404 configuration
-
.htaccess - routes all non-file urls to index, forces https, and uses gzip for static assets (if available)
-
.gitignore - ignores
/vendor
,.env
,.vscode
,error_log
, and.DS_Store
Requirements
- Apache
- PHP >= 7.4
- PDO-compatible database (if using DB handlers)
Installation
Easy install with composer:
composer create-project jyoungblood/slime new-project-name
Initialize the .env file, using the boilerplate example:
mv .env.example .env
Usage
Although SLIME is currently not intended for local development workflows, you're welcome to try your luck with PHP's built-in server:
php -S localhost:6969
Alternatively, you could use Herd, which is an excellent tool for local development.
See controllers/index.php for an example of routing and template rendering.
See templates/index.html and templates/_layouts/base.html for examples using handlebars and layouts.
Helpful resources:
Check out slime-demo to see more examples of the kind of things you can do with SLIME!
Slime is heavily inspired by STEREO, an older toolkit I've assembled and maintained, which has helped me to be very productive and make a decent living over the years.
I hope these tools and the workflows they enable can help some of you as much as they've helped me : )