infinitycube / quicksite
Slim 4 scaffolding for creating web applications. QuickSite creates a project structure with all essential packages pre-bundled.
Package info
github.com/infinitycube/quicksite
Language:HTML
Type:project
pkg:composer/infinitycube/quicksite
Requires
- php: ^8.4.1
- ext-pdo: *
- bryanjhv/slim-session: ^4.1
- doctrine/dbal: ^4.6
- doctrine/migrations: ^3.9
- doctrine/orm: ^3.8
- illuminate/collections: ^13.0
- middlewares/trailing-slash: ^2.0
- monolog/monolog: ^3.13
- php-di/php-di: ^7.1
- slim/http: ^1.4
- slim/psr7: ^1.7
- slim/slim: ^4.15
- slim/twig-view: ^3.4
- symfony/cache: ^8.1
- symfony/console: ^8.1
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- phpunit/phpunit: ^13.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A Slim 4 scaffolding for creating web applications at lightning speed.
QuickSite let you focus on the application and data structure. The scaffolding creates a project structure with an example application for your reference. A powerful view render engine, Twig helps you create awesome templates to render pages. It also has a Database Abstraction Layer (DABL) from Doctrine, your application need not directly interact with the database.
Prerequisites
For working with QuickSite scaffolding, you need the following
- PHP 8.4 or newer (not needed locally if you use Docker)
- Skill: Object Oriented PHP
- Skill: Twig Templating (if you use Twig)
- Skill: Doctrine ORM (if you use Doctrine)
- Composer installed on your machine
- Docker (if you use Docker as your server stack)
- MySQL 8 / MariaDB Server (if you are not using Docker)
Setup Project
You can setup your Slim 4 project with QuickSite in a line of command in terminal / command-prompt.
$ composer create-project infinitycube/quicksite myproject
Go to your project directory
$ cd myproject
If you are have Docker installed and running, you may start your development server immediately by running.
$ docker compose up
Configuration
Settings are read from environment variables, with sensible defaults in ./app/settings.php.
composer create-project copies .env.example to .env for you; edit .env to override any value.
.env is git-ignored and is optional — never commit it.
No Docker
For those who don't have Docker, you must create a database and assign user access in your local mysql server. Then set DB_HOST, DB_NAME, DB_PORT, DB_USER and DB_PASSWORD in your .env file (copy it from .env.example if it does not exist).
Now you can start local server
$ composer start
Example Todo App
To make the example todo app working you need to run the migration bundled with this scaffolding.
For those who use Docker, you need to SSH into your docker container while it is running.
$ docker compose exec site bash
Those who don't use Docker can skip the above step.
Now run the bundled migration.
$ php vendor/bin/doctrine-migrations migrations:migrate
You may now view the Todo app by pointing your browser to http://localhost:8080/todo/
Running Tests
Sample unit and feature tests live in ./tests. They do not need a database.
$ composer test
With Docker: docker compose run --rm site composer test
Note
You may or may not require the pre-bundled packages within QuickSite. You may remove those packages if you know exactly what you are doing. You may find more about QuickSite in the QuickSite Documentation.