{"id":21591092,"url":"https://github.com/samuelgfeller/slim-api-starter","last_synced_at":"2026-01-24T09:02:19.424Z","repository":{"id":230585013,"uuid":"779720709","full_name":"samuelgfeller/slim-api-starter","owner":"samuelgfeller","description":"Slim 4 API skeleton with examples and a few features to build a secure and scalable API following current best practices and SOLID principles.","archived":false,"fork":false,"pushed_at":"2025-01-31T12:43:47.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T04:51:19.494Z","etag":null,"topics":["api-skeleton","api-starter","php","rest-api","slim","slim-skeleton","template-project"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuelgfeller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"samuelgfeller"}},"created_at":"2024-03-30T15:39:27.000Z","updated_at":"2025-06-20T10:06:26.000Z","dependencies_parsed_at":"2024-08-15T18:27:59.575Z","dependency_job_id":"14426672-c046-4b85-bd6c-053855722f46","html_url":"https://github.com/samuelgfeller/slim-api-starter","commit_stats":null,"previous_names":["samuelgfeller/slim-api-starter"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/samuelgfeller/slim-api-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgfeller%2Fslim-api-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgfeller%2Fslim-api-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgfeller%2Fslim-api-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgfeller%2Fslim-api-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelgfeller","download_url":"https://codeload.github.com/samuelgfeller/slim-api-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgfeller%2Fslim-api-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28721980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-skeleton","api-starter","php","rest-api","slim","slim-skeleton","template-project"],"created_at":"2024-11-24T16:22:44.486Z","updated_at":"2026-01-24T09:02:19.399Z","avatar_url":"https://github.com/samuelgfeller.png","language":"PHP","funding_links":["https://ko-fi.com/samuelgfeller"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch1\u003eSlim \u003cimg src=\"https://i.imgur.com/YzDYQ0V.png\" width=\"60px\" alt=\"API\"\u003e starter\u003c/h1\u003e\n\n[![Documentation](https://img.shields.io/badge/Documentation-blue?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAia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4zMTQ0IDMuMTMyMjUgMTguNTkxMiAzLjQwOTAxQzE4Ljg2NzkgMy42ODU3NyAxOS4wNDg0IDQuMDc0MzUgMTkuMTQ3IDQuODA4MTJDMTkuMjQ4NiA1LjU2MzQ3IDE5LjI1MDIgNi41NjQ1OCAxOS4yNTAyIDhWMTUuMjVaTTcuMjUwMTkgN0M3LjI1MDE5IDYuNTg1NzkgNy41ODU5NyA2LjI1IDguMDAwMTkgNi4yNUgxNi4wMDAyQzE2LjQxNDQgNi4yNSAxNi43NTAyIDYuNTg1NzkgMTYuNzUwMiA3QzE2Ljc1MDIgNy40MTQyMSAxNi40MTQ0IDcuNzUgMTYuMDAwMiA3Ljc1SDguMDAwMTlDNy41ODU5NyA3Ljc1IDcuMjUwMTkgNy40MTQyMSA3LjI1MDE5IDdaTTcuMjUwMTkgMTAuNUM3LjI1MDE5IDEwLjA4NTggNy41ODU5NyA5Ljc1IDguMDAwMTkgOS43NUgxMy4wMDAyQzEzLjQxNDQgOS43NSAxMy43NTAyIDEwLjA4NTggMTMuNzUwMiAxMC41QzEzLjc1MDIgMTAuOTE0MiAxMy40MTQ0IDExLjI1IDEzLjAwMDIgMTEuMjVIOC4wMDAxOUM3LjU4NTk3IDExLjI1IDcuMjUwMTkgMTAuOTE0MiA3LjI1MDE5IDEwLjVaIiBmaWxsPSIjZmZmIi8%2BIDwvZz4KDTwvc3ZnPg%3D%3D\u0026labelColor=grey)](https://samuel-gfeller.ch/docs)\n[![Latest Version on Packagist](https://img.shields.io/github/release/samuelgfeller/slim-api-starter.svg)](https://packagist.org/packages/samuelgfeller/slim-api-starter)\n[![Code Coverage](https://scrutinizer-ci.com/g/samuelgfeller/slim-api-starter/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/samuelgfeller/slim-api-starter/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/samuelgfeller/slim-api-starter/badges/build.png?b=master)](https://scrutinizer-ci.com/g/samuelgfeller/slim-api-starter/build-status/master)\n[![Quality Score](https://img.shields.io/scrutinizer/quality/g/samuelgfeller/slim-api-starter.svg)](https://scrutinizer-ci.com/g/samuelgfeller/slim-api-starter/?branch=master)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/samuelgfeller/slim-example-project/blob/master/LICENSE)\n\n\n[Slim 4](https://www.slimframework.com/) API starter template with a few examples and some essential [features](#features) to \nhelp you build a secure and scalable API following current best practices and \n[SOLID](https://en.wikipedia.org/wiki/SOLID) principles.  \n\nAn extensive [**documentation**](https://samuel-gfeller.ch/docs) explains \nthe [architecture](https://samuel-gfeller.ch/docs/Architecture), components, \ndesign choices (i.e. [SRP](https://samuel-gfeller.ch/docs/Single-Responsibility-Principle-(SRP))) \nand features.  \n\n\u003c/div\u003e\n\n## Features\n\n* [Dependency Injection](https://samuel-gfeller.ch/docs/Dependency-Injection) - [PHP-DI](https://php-di.org/)\n* [Database migrations](https://samuel-gfeller.ch/docs/Database-Migrations) - [Phinx](https://phinx.org/)\n* [Validation](https://samuel-gfeller.ch/docs/Validation) - [cakephp/validation](https://book.cakephp.org/4/en/core-libraries/validation.html)\n* [Logging](https://samuel-gfeller.ch/docs/Logging) - [Monolog](https://github.com/Seldaek/monolog)\n* [Query Builder](https://samuel-gfeller.ch/docs/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html)\n* [Integration testing](https://samuel-gfeller.ch/docs/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/)\n* [Error handling](https://samuel-gfeller.ch/docs/Error-Handling)\n* [GitHub Actions](https://samuel-gfeller.ch/docs/GitHub-Actions) - [Scrutinizer](https://scrutinizer-ci.com/)\n* [Coding standards fixer](https://samuel-gfeller.ch/docs/Coding-Standards-Fixer) - [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)\n* [Static code analysis](https://samuel-gfeller.ch/docs/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan)\n\n\n## Requirements\n* PHP 8.2+\n* [Composer](https://samuel-gfeller.ch/docs/Composer)\n* MariaDB or MySQL database\n\n## Installation\n#### 1. Create project\nNavigate to the directory you want to create the project in and run the following \ncommand, replacing project-name with the desired name for your project.\n```bash\ncomposer create-project samuelgfeller/slim-api-starter project-name\n```\nThis will create a new directory with the specified name and install all \nnecessary dependencies.\n \n#### 2. Set up the database\nOpen the project and rename the file `config/env/env.example.php` to `config/env/env.php` \nand add the local database credentials.  \n\nThen, create the database for the project and update the `config/env/env.dev.php` \nfile with the name of the database, like this:\n```php\n$settings['db']['database'] = 'my_dev_database_name';\n```\nAfter that, create a separate database for testing and update the `config/env/env.test.php` \nfile with its name. The name must contain the word \"test\". There is a safety measure to \nprevent accidentally truncating the development database while testing:\n```php\n$settings['db']['database'] = 'my_dev_database_name_test';\n```\n\n#### 3. Run migrations\nOpen the terminal in the project's root directory and run the following command to create the \ndemo table `user`:\n```bash\ncomposer migrate\n```\n\n#### 4. Insert demo data\nFour demo users can be inserted into the database to test the API response by\nrunning the following command:\n\n```bash\ncomposer seed\n```\n\n#### 5. Update GitHub workflows\n\nTo run the project's tests automatically when pushing, update the \n`.github/workflows/build.yml` file.   \nReplace the matrix value \"test-database\" with the name of \nyour test database as specified in `config/env/env.test.php`.\n\nIf you don't plan on using Scrutinizer, remove the `.scrutinizer` file at the root of the project,\notherwise you can follow this\n[guide](https://samuel-gfeller.ch/docs/How-to-set-up-Scrutinizer)\non how to set it up.\n\n#### Done!\nThat's it! Your project should now be fully set up and ready to use.  \nIf you are using XAMPP and installed the project in the `htdocs` folder, you can access it \nin the browser at `http://localhost/project-name`.  \nOr you can serve it locally by running `php -S localhost:8080 -t public/` in the project's root \ndirectory.\n\n## Support\nIf you value this project and want to support it, star it on GitHub or\nvisit the [Support❤️](https://samuel-gfeller.ch/docs/Support❤️) page. (thank you!)\n\n## License\nThis project is licensed under the MIT License — see the \n[LICENSE](https://github.com/samuelgfeller/slim-api-starter/blob/master/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgfeller%2Fslim-api-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelgfeller%2Fslim-api-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgfeller%2Fslim-api-starter/lists"}