PHPackages                             samuelgfeller/slim-starter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. samuelgfeller/slim-starter

ActiveProject[Framework](/categories/framework)

samuelgfeller/slim-starter
==========================

Slim 4 starter with frontend and API endpoint

4.0.1(3mo ago)953↓33.3%1MITPHPPHP ^8.2CI passing

Since Apr 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/samuelgfeller/slim-starter)[ Packagist](https://packagist.org/packages/samuelgfeller/slim-starter)[ Fund](https://ko-fi.com/samuelgfeller)[ RSS](/packages/samuelgfeller-slim-starter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (18)Versions (4)Used By (0)

[![](https://private-user-images.githubusercontent.com/31797204/322212807-8e39b63f-adbf-443c-8ed9-dc5924fd4e0c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMTkyMDEsIm5iZiI6MTc3NTAxODkwMSwicGF0aCI6Ii8zMTc5NzIwNC8zMjIyMTI4MDctOGUzOWI2M2YtYWRiZi00NDNjLThlZDktZGM1OTI0ZmQ0ZTBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAxVDA0NDgyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4N2E3MTFjNjE3N2IwNzhkMzlkODQ4YmMzOWU1N2U2NjYzNWQ4NDQ0NDcwNDYxMTE3YWM0OTY4YzgzYmIwY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wLlPKpuStIXkSwlkUjqhE6MfhgH2xk--WEOziOyg1y8) ](https://github.com/samuelgfeller/slim-starter)Slim Starter
------------

[](#slim-starter)

[![Documentation](https://camo.githubusercontent.com/39e91fe0582e922ff24973a8251f6fa88bca571aa697843752e448749a8a193e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63756d656e746174696f6e2d626c75653f6c6f676f3d64617461253341696d616765253246737667253242786d6c2533426261736536342532435043464554304e555756424649484e325a79425156554a4d53554d67496930764c31637a517938765246524549464e57527941784c6a45764c30564f496941696148523063446f764c336433647935334d793576636d637652334a686347687059334d7655315a484c7a45754d5339455645517663335a6e4d5445755a48526b496a344e436a77684c533067565842736232466b5a5751676447383649464e57527942535a5842764c4342336433637563335a6e636d56776279356a62323073494652795957357a5a6d39796257566b49474a354f694254566b6367556d56776279424e6158686c6369425562323973637941744c54344b50484e325a79423361575230614430694f444177634867694947686c6157646f644430694f4441776348676949485a705a58644362336739496a41674d4341794e4341794e4349675a6d6c7362443069626d39755a53496765473173626e4d39496d6830644841364c79393364336375647a4d7562334a6e4c7a49774d44417663335a6e496a344b4454786e49476c6b50534a54566b64535a58427658324a6e51324679636d6c6c63694967633352796232746c4c5864705a48526f50534977496938253242436730385a7942705a44306955315a48556d567762313930636d466a5a584a4459584a79615756794969427a64484a766132557462476c755a574e6863443069636d3931626d516949484e30636d39725a5331736157356c616d3970626a3069636d3931626d51694c7a344b4454786e49476c6b50534a54566b64535a58427658326c6a6232354459584a7961575679496a346750484268644767675a6d6c73624331796457786c50534a6c646d56756232526b4969426a62476c774c584a3162475539496d56325a5735765a47516949475139496b30354c6a6b304e544d78494445754d6a56494d5451754d4455314d554d784e5334304d6a4933494445754d6a51354f5467674d5459754e544931494445754d6a51354f5459674d5463754d7a6b784f5341784c6a4d324e6a5579517a45344c6a49354d6941784c6a51344e7a5530494445354c6a41304f546b674d5334334e4459304d7941784f5334324e544534494449754d7a51344d7a56444d6a41754d6a557a4f4341794c6a6b314d444933494449774c6a55784d6a59674d7934334d4467784e4341794d4334324d7a4d33494451754e6a41344d6a56444d6a41754e7a55774d6941314c6a51334e544979494449774c6a63314d4449674e6934314e7a63314e4341794d4334334e544179494463754f5451314d544e574d5459754d4455304f554d794d4334334e544179494445334c6a51794d6a55674d6a41754e7a55774d6941784f4334314d6a5134494449774c6a597a4d7a63674d546b754d7a6b784f454d794d4334314d544932494449774c6a49354d546b674d6a41754d6a557a4f4341794d5334774e446b33494445354c6a59314d5467674d6a45754e6a55784e304d784f5334774e446b35494449794c6a49314d7a59674d5467754d6a6b79494449794c6a55784d6a55674d5463754d7a6b784f5341794d6934324d7a4d31517a45324c6a55794e5341794d6934334e5341784e5334304d6a4932494449794c6a6331494445304c6a41314e5445674d6a49754e7a56494f5334354e44557a4d6b4d344c6a55334e7a637a494449794c6a6331494463754e4463314e4341794d6934334e5341324c6a59774f445130494449794c6a597a4d7a56444e5334334d44677a4d7941794d6934314d544931494451754f5455774e4455674d6a49754d6a557a4e6941304c6a4d304f445530494449784c6a59314d5464444d7934334e4459324d6941794d5334774e446b3349444d754e4467334e7a4d674d6a41754d6a6b784f53417a4c6a4d324e6a6378494445354c6a4d354d5468444d79347a4d6a67774d5341784f5334784d444d3549444d754d7a41794d5459674d5467754e7a6b774d69417a4c6a49344e446b674d5467754e4451354e454d7a4c6a49304e546779494445344c6a4d794e69417a4c6a497a4f444978494445344c6a45354d5449674d7934794e6a67354e5341784f4334774e545934517a4d754d6a55774d5459674d5463754e4459304f53417a4c6a49314d444533494445324c6a63354f5445674d7934794e5441784f5341784e6934774e545135566a63754f5451314d544e444d7934794e5441784e7941324c6a55334e7a553049444d754d6a55774d5455674e5334304e7a55794d69417a4c6a4d324e6a6378494451754e6a41344d6a56444d7934304f4463334d79417a4c6a63774f44453049444d754e7a51324e6a49674d6934354e5441794e7941304c6a4d304f445530494449754d7a51344d7a56444e4334354e5441304e5341784c6a63304e6a517a494455754e7a41344d7a4d674d5334304f4463314e4341324c6a59774f44517a494445754d7a59324e544a444e7934304e7a5530494445754d6a51354f5459674f4334314e7a63334d6941784c6a49304f546b3449446b754f5451314d7a45674d5334794e56704e4e4334334e7a59354e4341784f4334794e446b78517a51754e7a6b794d5451674d5467754e6a41794f5341304c6a67784e546b33494445344c6a6b784e4341304c6a67314d7a4d7a494445354c6a45354d546c444e4334354e5445354f5341784f5334354d6a5533494455754d544d794e444d674d6a41754d7a45304d6941314c6a51774f5449674d6a41754e546b78517a55754e6a67314f5459674d6a41754f4459334f4341324c6a41334e44557a494449784c6a41304f4449674e6934344d44677a4d5341794d5334784e445935517a63754e54597a4e6a59674d6a45754d6a51344e4341344c6a55324e446333494449784c6a4931494445774c6a41774d4449674d6a45754d6a56494d5451754d4441774d6b4d784e5334304d7a5532494449784c6a4931494445324c6a517a4e6a63674d6a45754d6a51344e4341784e7934784f544978494449784c6a45304e6a6c444d5463754f5449314f4341794d5334774e446779494445344c6a4d784e4451674d6a41754f4459334f4341784f4334314f544579494449774c6a55354d554d784f4334334f446331494449774c6a4d354e4463674d5467754f544d314d7941794d4334784e444978494445354c6a417a4f546b674d546b754e7a56494f4334774d4441784f554d334c6a55344e546b33494445354c6a6331494463754d6a55774d546b674d546b754e4445304d6941334c6a49314d44453549444535517a63754d6a55774d546b674d5467754e5467314f4341334c6a55344e546b33494445344c6a4931494467754d4441774d546b674d5467754d6a56494d546b754d6a497a4e454d784f5334794e444535494445334c6a67784f5341784f5334794e446333494445334c6a4d794e4459674d546b754d6a51354e4341784e6934334e5567334c6a67354e7a6b32517a59754f5445354e7a45674d5459754e7a55674e6934314e7a6333494445324c6a63314e6a51674e69347a4d5455324d6941784e6934344d6a5933517a55754e546b324d7941784e7934774d546b30494455754d4449794f4459674d5463754e5455304d5341304c6a63334e6a6b30494445344c6a49304f544661545445354c6a49314d4449674d5455754d6a56494e7934344f5463354e6b4d334c6a67314f446335494445314c6a4931494463754f4449774d6941784e5334794e5341334c6a63344d6a4533494445314c6a4931517a59754f5459304d6941784e5334794e446b33494459754e4441324d4455674d5455754d6a51354e5341314c6a6b794e7a4d35494445314c6a4d334e7a68444e5334304f546b304d5341784e5334304f544931494455754d5441794e4449674d5455754e6a63354f4341304c6a63314d444535494445314c6a6b794e546c574f454d304c6a63314d444535494459754e5459304e5467674e4334334e5445334f4341314c6a55324d7a5133494451754f44557a4d7a4d674e4334344d4467784d6b4d304c6a6b314d546b35494451754d4463304d7a55674e5334784d7a49304d79417a4c6a59344e546333494455754e4441354d69417a4c6a51774f544178517a55754e6a67314f5459674d7934784d7a49794e5341324c6a41334e44557a494449754f5455784f4341324c6a67774f444d78494449754f44557a4d5456444e7934314e6a4d324e6941794c6a63314d545535494467754e5459304e7a63674d6934334e5341784d4334774d444179494449754e7a56494d5451754d4441774d6b4d784e5334304d7a5532494449754e7a55674d5459754e444d324e7941794c6a63314d545535494445334c6a45354d6a45674d6934344e544d784e554d784e7934354d6a5534494449754f5455784f4341784f43347a4d54513049444d754d544d794d6a55674d5467754e546b784d69417a4c6a51774f544178517a45344c6a67324e7a6b674d7934324f4455334e7941784f5334774e446730494451754d4463304d7a55674d546b754d545133494451754f4441344d544a444d546b754d6a51344e6941314c6a55324d7a5133494445354c6a49314d4449674e6934314e6a51314f4341784f5334794e544179494468574d5455754d6a5661545463754d6a55774d546b674e304d334c6a49314d444535494459754e5467314e7a6b674e7934314f4455354e7941324c6a4931494467754d4441774d546b674e6934794e5567784e6934774d444179517a45324c6a51784e4451674e6934794e5341784e6934334e544179494459754e5467314e7a6b674d5459754e7a55774d694133517a45324c6a63314d4449674e7934304d5451794d5341784e6934304d545130494463754e7a55674d5459754d4441774d6941334c6a6331534467754d4441774d546c444e7934314f4455354e7941334c6a6331494463754d6a55774d546b674e7934304d5451794d5341334c6a49314d44453549446461545463754d6a55774d546b674d5441754e554d334c6a49314d444535494445774c6a41344e5467674e7934314f4455354e7941354c6a6331494467754d4441774d546b674f5334334e5567784d7934774d444179517a457a4c6a51784e4451674f5334334e5341784d7934334e544179494445774c6a41344e5467674d544d754e7a55774d6941784d433431517a457a4c6a63314d4449674d5441754f5445304d6941784d7934304d545130494445784c6a49314944457a4c6a41774d4449674d5445754d6a56494f4334774d4441784f554d334c6a55344e546b33494445784c6a4931494463754d6a55774d546b674d5441754f5445304d6941334c6a49314d444535494445774c6a56614969426d615778735053496a5a6d5a6d496938253242494477765a7a344b4454777663335a6e5067253344253344266c6162656c436f6c6f723d67726579)](https://samuel-gfeller.ch/docs)[![Latest Version on Packagist](https://camo.githubusercontent.com/46035a97b23a8f9c0b557120a1d8d4672d887c8dcaba77b1ace8f2f40fb9e782/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73616d75656c6766656c6c65722f736c696d2d737461727465722e737667)](https://packagist.org/packages/samuelgfeller/slim-starter)[![Code Coverage](https://camo.githubusercontent.com/b5b5c314a3d2dc6b17ef8255469b67f01e06be81009c93c969d95d9957daa9bd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d75656c6766656c6c65722f736c696d2d737461727465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/?branch=master)[![Build Status](https://camo.githubusercontent.com/8251b8547fff2890c952170858b8176afb2beb6d96af7fabfd2e0147b6294742/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d75656c6766656c6c65722f736c696d2d737461727465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/build-status/master)[![Quality Score](https://camo.githubusercontent.com/095196c29ec4f4161802d1029ad1b8557dcfdb242e28d9b5fe4f482ef25db9fa/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f73616d75656c6766656c6c65722f736c696d2d737461727465722e737667)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/?branch=master)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://github.com/samuelgfeller/slim-starter/blob/master/LICENSE)

[Slim 4](https://www.slimframework.com/) full stack starter template following current best practices and [SOLID](https://en.wikipedia.org/wiki/SOLID) principles to quickly get started with a scalable PHP web application.

An extensive [**documentation**](https://samuel-gfeller/docs) explains the [architecture](https://samuel-gfeller.ch/docs/Architecture), components, design choices (i.e. [SRP](https://samuel-gfeller.ch/docs/Single-Responsibility-Principle-(SRP))) and features.
[Libraries](https://samuel-gfeller.ch/docs/Libraries-and-Framework)are kept to a minimum and to allow for most flexibility and long-term viability.

Features
--------

[](#features)

This project, unlike the official [Slim-Skeleton](https://github.com/slimphp/Slim-Skeleton) and Odan's [slim4-skeleton](https://github.com/odan/slim4-skeleton)has some additional opinionated features and examples such as:

- Pages rendered by a [template renderer](https://samuel-gfeller.ch/docs/Template-Rendering)with layout and versioned assets
- The loading example elements from the database (users) via Ajax
- The creation, modification, and deletion of users with validation
- Integration testing
- API endpoint
- Dark / light theme switch

This skeleton template is a stripped-down version of the [slim-example-project](https://github.com/samuelgfeller/slim-example-project) which contains a lot more features and examples.

### Technologies

[](#technologies)

- [Slim 4 micro-framework](https://github.com/slimphp/Slim)
- [Dependency Injection](https://samuel-gfeller.ch/docs/Dependency-Injection) - [PHP-DI](https://php-di.org/)
- [Template rendering](https://samuel-gfeller.ch/docs/Template-Rendering) - [PHP-View](https://github.com/slimphp/PHP-View)(could be replaced by [Twig](https://twig.symfony.com/))
- [Logging](https://samuel-gfeller.ch/docs/Logging) - [Monolog](https://github.com/Seldaek/monolog)
- [Database migrations](https://samuel-gfeller.ch/docs/Database-Migrations) - [Phinx](https://phinx.org/)
- [Validation](https://samuel-gfeller.ch/docs/Validation) - [cakephp/validation](https://book.cakephp.org/4/en/core-libraries/validation.html)
- [Query Builder](https://samuel-gfeller.ch/docs/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html)
- [Integration testing](https://samuel-gfeller.ch/docs/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/)
- [Error handling](https://samuel-gfeller.ch/docs/Error-Handling) - [slim-error-renderer](https://github.com/samuelgfeller/slim-error-renderer)
- [GitHub Actions](https://samuel-gfeller.ch/docs/GitHub-Actions) and [Scrutinizer](https://samuel-gfeller.ch/docs/How-to-set-up-Scrutinizer)
- [Coding standards fixer](https://samuel-gfeller.ch/docs/Coding-Standards-Fixer) - [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
- [Static code analysis](https://samuel-gfeller.ch/docs/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan)

Requirements
------------

[](#requirements)

- PHP 8.2+
- [Composer](https://samuel-gfeller.ch/docs/Composer)
- MariaDB or MySQL database

Installation
------------

[](#installation)

#### 1. Create project

[](#1-create-project)

Navigate to the directory you want to create the project in and run the following command, replacing `project-name` with the desired name for your project.

```
composer create-project samuelgfeller/slim-starter project-name
```

This will create a new directory with the specified name and install all necessary dependencies.

#### 2. Set up the database

[](#2-set-up-the-database)

Open the project in your IDE and rename the file `config/env/env.example.php` to `config/env/env.php`and add the local database credentials.

Then, create the database for the project and add the name to the `config/env/env.dev.php`file, like this:

```
$settings['db']['database'] = 'my_dev_database_name';
```

After that, create a separate database for testing and add the name to the `config/env/env.test.php`file.
The database name must contain the word "test" as a safety measure to prevent accidentally truncating the development database while testing.

```
$settings['db']['database'] = 'my_dev_database_name_test';
```

The [Configuration](https://samuel-gfeller.ch/docs/Configuration)documentation details the different configuration files and how they are used and loaded.

#### 3. Run migrations

[](#3-run-migrations)

Open the terminal in the project's root directory and run the following command to create the demo table `user`:

```
composer migrate
```

#### 4. Insert demo data

[](#4-insert-demo-data)

Four demo users can be inserted into the database to test the application and API response by running the following command:

```
composer seed
```

#### 5. Update GitHub workflows

[](#5-update-github-workflows)

To run the project's tests automatically when pushing, update the `.github/workflows/build.yml` file.
Replace the matrix value "test-database" with the name of your test database as specified in `config/env/env.test.php`.

If you don't plan on using Scrutinizer, remove the `.scrutinizer` file at the root of the project, otherwise you can follow this [guide](https://samuel-gfeller.ch/docs/How-to-set-up-Scrutinizer)on how to set it up.

#### Done!

[](#done)

That's it! Your project should now be fully set up and ready to use.
If you are using XAMPP and installed the project in the `htdocs` folder, you can access it in the browser at `http://localhost/project-name`.
Or you can serve it locally by running `php -S localhost:8080 -t public/` in the project's root directory.

Support
-------

[](#support)

If you value this project and want to support it, star it on GitHub or visit the [Support❤️](https://samuel-gfeller.ch/docs/Support%E2%9D%A4%EF%B8%8F) page. (thank you!)

License
-------

[](#license)

This project is licensed under the MIT License — see the [LICENSE](https://github.com/samuelgfeller/slim-starter/blob/master/LICENSE) file for details.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance79

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~318 days

Total

3

Last Release

110d ago

Major Versions

1.0.0 → 4.0.02025-01-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/b63d5113cf69b947d9a0d48c77e0c24a0be088605d11368d0face5eb24223f40?d=identicon)[samuelgfeller](/maintainers/samuelgfeller)

---

Top Contributors

[![samuelgfeller](https://avatars.githubusercontent.com/u/31797204?v=4)](https://github.com/samuelgfeller "samuelgfeller (21 commits)")

---

Tags

php8skeletonskeleton-projectslimslim-frameworkslim-skeletonslim-starterstarter-templatetemplate

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/samuelgfeller-slim-starter/health.svg)

```
[![Health](https://phpackages.com/badges/samuelgfeller-slim-starter/health.svg)](https://phpackages.com/packages/samuelgfeller-slim-starter)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[odan/slim4-skeleton

A Slim 4 skeleton

4588.5k](/packages/odan-slim4-skeleton)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
