{"id":18780568,"url":"https://github.com/codelinered/slim-skeleton","last_synced_at":"2025-07-05T14:36:31.688Z","repository":{"id":56991979,"uuid":"117873582","full_name":"CodelineRed/Slim-Skeleton","owner":"CodelineRed","description":"Slim Skeleton with Docrine, ACL, i18N, 2FA, reCaptcha and HTML compress","archived":false,"fork":false,"pushed_at":"2022-12-19T19:54:44.000Z","size":539,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-05T09:42:25.662Z","etag":null,"topics":["acl","csrf","doctrine","doctrine2","localization","monolog","slim","slim-3","slim-framework","slim3","slim3-skeleton","slimframework","slimphp","twig"],"latest_commit_sha":null,"homepage":"https://slim3.codelinered.net/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"slimphp/Slim-Skeleton","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodelineRed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-17T18:07:02.000Z","updated_at":"2022-12-14T17:19:41.000Z","dependencies_parsed_at":"2023-01-14T11:30:59.715Z","dependency_job_id":null,"html_url":"https://github.com/CodelineRed/Slim-Skeleton","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/CodelineRed/Slim-Skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2FSlim-Skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2FSlim-Skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2FSlim-Skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2FSlim-Skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodelineRed","download_url":"https://codeload.github.com/CodelineRed/Slim-Skeleton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2FSlim-Skeleton/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263755953,"owners_count":23506474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["acl","csrf","doctrine","doctrine2","localization","monolog","slim","slim-3","slim-framework","slim3","slim3-skeleton","slimframework","slimphp","twig"],"created_at":"2024-11-07T20:27:11.477Z","updated_at":"2025-07-05T14:36:31.623Z","avatar_url":"https://github.com/CodelineRed.png","language":"PHP","readme":"# Slim Skeleton - CodelineRed\r\n\r\nThis git is for [slim3.codelinered.net](https://slim3.codelinered.net). Take a look at [screenshots](https://github.com/CodelineRed/slim-skeleton/tree/master/screenshots).\r\n\r\n## Table of contents\r\n- [Included Third Party Code](#included)\r\n- Install Guides\r\n    - [Install Skeleton](#install-skeleton)\r\n    - [Install PHP, MySQL, Composer and Adminer (optional)](#install-php-mysql-composer-and-adminer-optional)\r\n- [Path generation with Locale code and Generic locale code](#path-generation-with-locale-code-and-generic-locale-code)\r\n- [How to create further localisations](#how-to-create-further-localisations)\r\n- [How to switch between different url modes](#how-to-switch-between-different-url-modes)\r\n    - [Mode 1](#mode-1)\r\n    - [Mode 2](#mode-2)\r\n    - [Mode 3](#mode-3-default)\r\n- [ACL settings](#acl-settings)\r\n- [Troubleshooting](#troubleshooting)\r\n- [Links](#links)\r\n\r\n## Included\r\n- [Slim 3](https://www.slimframework.com)\r\n- [Slim Twig View 2](https://github.com/slimphp/Twig-View)\r\n- [Slim CSRF 0.8](https://github.com/slimphp/Slim-Csrf)\r\n- [Slim Flash 0.4](https://github.com/slimphp/Slim-Flash)\r\n- [Monolog 1](https://seldaek.github.io/monolog/)\r\n- [Doctrine ORM 2](https://packagist.org/packages/doctrine/orm)\r\n- [Geggleto ACL 1](https://github.com/geggleto/geggleto-acl)\r\n- [Google Authenticator](https://github.com/PHPGangsta/GoogleAuthenticator)\r\n- [Google reCAPTCHA 1](https://github.com/google/recaptcha)\r\n- [HTML Compress Twig Extension](https://github.com/nochso/html-compress-twig)\r\n\r\n\r\n## Install Skeleton\r\n### Required\r\n- PHP 8.0\r\n- MySQL 5.7 (pdo_mysql)\r\n\r\nOpen console on your OS and navigate to your project folder.\r\n[Download zip](https://github.com/CodelineRed/slim-skeleton/archive/production.zip) if you don't have git or composer on your OS.\r\n```bash\r\n+++++ ZIP VERSION +++++\r\n$ (unix) wget -O slim-prod.zip https://github.com/CodelineRed/slim-skeleton/archive/production.zip\r\n$ (unix) unzip slim-prod.zip\r\n$ (win10) curl -L -o slim-prod.zip https://github.com/CodelineRed/slim-skeleton/archive/production.zip\r\n$ (win10) tar -xf slim-prod.zip\r\n$ cd slim-skeleton-production\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall --no-dev\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE slim_skeleton\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ GIT VERSION +++++\r\n$ git clone https://github.com/CodelineRed/slim-skeleton.git\r\n$ cd slim-skeleton\r\n$ git checkout production\r\n$ (optional on unix)  rm -rf .git\r\n$ (optional on win10) rmdir .git /s\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall --no-dev\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE slim_skeleton\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ COMPOSER VERSION +++++\r\n$ php composer create-project codelinered/slim-skeleton slim-skeleton \"dev-production\" --no-dev\r\n$ cd slim-skeleton\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE slim_skeleton\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\nDefault Website login: user = user, pass = password\r\nIf you need PHP, MySQL, Composer and Adminer, see below ⇓.\r\n\r\n## Install PHP, MySQL, Composer and Adminer (optional)\r\n### Required\r\n- [Docker](https://www.docker.com/)\r\n\r\nOpen console on your OS and navigate to the unziped/ cloned app folder.\r\n```bash\r\n$ (unix)    systemctl docker start\r\n$ (windows) \"c:\\path\\to\\Docker Desktop.exe\"\r\n$ docker-compose build\r\n$ docker-compose up -d\r\n$ docker-compose run composer install --no-dev\r\n$ (unix)    docker inspect slim-db | grep \"IPAddress\"\r\n$ (windows) docker inspect slim-db | findstr \"IPAddress\"\r\n$ ---- Add IPAddress as Doctrine \"host\" in \"config\\additional-settings.php\" ----\r\n```\r\nOpen [localhost:7705](http://localhost:7705) for Website or [localhost:7707](http://localhost:7707) for Adminer.\r\n\r\n| DB Login | [Adminer](http://localhost:7707) |\r\n|----------|----------------------------------|\r\n| Server   | IP from `IPAddress`              |\r\n| Username | root                             |\r\n| Password | rootdockerpw                     |\r\n| Database |                                  |\r\n\r\n## Path generation with Locale code and Generic locale code\r\n- Mode 1 - example.com/de/ = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Mode 2 - example.de = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_ENABLED,`\r\n- Mode 3 - example.com (de-DE session) = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_SESSION | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,` (default)\r\n\r\nIt depends on your configuration what will be returned.\r\n\r\n|                     | Mode 1 | Mode 2 | Mode 3 |\r\n|---------------------|--------|--------|--------|\r\n| locale code         | de-DE  | de-DE  | xx-XX  |\r\n| generic locale code | de-DE  | xx-XX  | xx-XX  |\r\n\r\n|                     | Twig        | PHP                                   | Twig Example                            | PHP Example                                                                   |\r\n|---------------------|-------------|---------------------------------------|-----------------------------------------|-------------------------------------------------------------------------------|\r\n| locale code         | `{{ lc }}`  | `LanguageUtility::getLocale()`        | `{{ path_for('user-register-' ~ lc) }}` | `$this-\u003erouter-\u003epathFor('user-register-' . LanguageUtility::getLocale())`     |\r\n| generic locale code | `{{ glc }}` | `LanguageUtility::getGenericLocale()` | `{{ path_for('user-login-' ~ glc) }}`   | `$this-\u003erouter-\u003epathFor('user-login-' . LanguageUtility::getGenericLocale())` |\r\n\r\n## How to create further localisations\r\n- Duplicate one existing file in folder [`locale/`](https://github.com/CodelineRed/slim-skeleton/tree/master/locale) (e.g. copy `de-DE.php` to `fr-FR.php`)\r\n- (if you use Mode 1 or 2) Duplicate one existing file in folder [`config/routes/`](https://github.com/CodelineRed/slim-skeleton/tree/master/config/routes) (e.g. copy `de-DE.php` to `fr-FR.php`)\r\n- (if you use Mode 1 or 2) Change route prefix from `/de/` to `/fr/` in `config/routes/fr-FR.php`\r\n- You can also define paths like `/fr-be/` (`locale/fr-BE.php`/ `config/routes/fr-BE.php`) for example\r\n- If you want to show language in langswitch, add `fr-FR` and domain in `locale =\u003e active` ([`config/additional-settings.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/additional-settings.dist.php#L56))\r\n- (if you use Mode 1 or 2) Add case for `fr/` in [`src/localisation.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/src/localisation.php#L47)\r\n\r\n## How to switch between different url modes\r\n### Mode 1\r\nExample: example.com/de/\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Set up english routes with or without `/en` prefix in [`config/routes/en-US.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/en-US.php)\r\n- Set up german routes with `/de` prefix in [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php)\r\n- [`config/routes/xx-XX.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/xx-XX.php) can be leave untouched\r\n\r\n### Mode 2\r\nExample: de.example.com or example.de\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_ENABLED,`\r\n- Enter your domains in `active`\r\n- Go to [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php)\r\n- Remove `/de` prefix from every `route`\r\n- Go to [`config/routes/xx-XX.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/xx-XX.php)\r\n- Insert all routes where the config is equal between [`config/routes/en-US.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php)\r\n- Remove these equal routes in [`config/routes/en-US.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php)\r\n\r\n### Mode 3 (default)\r\nExample: example.com\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_SESSION | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Set up all routes in [`config/routes/xx-XX.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/xx-XX.php)\r\n- [`config/routes/en-US.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/en-US.php) can be leave untouched\r\n- [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php) can be leave untouched\r\n\r\n## ACL settings\r\nWith [Geggleto ACL](https://github.com/geggleto/geggleto-acl), routes are protected by role the current user has. By default every new route is not accessable until you give the route roles.\r\nRoutes are defined in the route files (e.g. [`config/routes/de-DE.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/routes/de-DE.php)).\r\nAny other resource is defined in [`config/settings.php`](https://github.com/CodelineRed/slim-skeleton/blob/master/config/settings.php#L90).\r\nInside the Twig templates you can use ACL functions [`has_role`](https://github.com/CodelineRed/slim-skeleton/blob/master/templates/partials/navigation.html.twig#L23) and is_allowed.\r\nInside controllers you can also use this ACL functions and [many more](https://github.com/geggleto/geggleto-acl/blob/master/src/AclRepository.php) (e.g. [`isAllowed()`](https://github.com/CodelineRed/slim-skeleton/blob/master/src/Controller/UserController.php#L101)).\r\n\r\n## Troubleshooting\r\n### Error 1\r\nIn some cases you'll get the error message \"Internal Server Error\".\r\n\r\nIf this happened, go to [`public/.htaccess`](https://github.com/CodelineRed/slim-skeleton/blob/master/public/.htaccess) and enable `RewriteBase /`.\r\n\r\nIf project is in sub directory then `RewriteBase /project/public/`.\r\n\r\n### Error 2\r\nMessage: is not resolvable\r\nFile: /var/www/vendor/slim/slim/Slim/CallableResolver.php\r\n\r\nIf this happened, your Doctrine host in `config\\additional-settings.php` is wrong.\r\n\r\n## Links\r\n- [Slim Framework](https://www.slimframework.com/)\r\n- [Twig](https://twig.symfony.com/)\r\n- [Doctrine](https://www.doctrine-project.org/)\r\n- [Slim 3 and Doctrine 2 Website](http://blog.sub85.com/slim-3-with-doctrine-2.html)\r\n- [Slim 3 and Doctrine 2 Github](https://github.com/matthewfedak/slim-3-doctrine-2)\r\n- [Adminer DB-GUI](https://www.adminer.org/)\r\n- [Locale codes](https://www.science.co.il/language/Locale-codes.php)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelinered%2Fslim-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelinered%2Fslim-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelinered%2Fslim-skeleton/lists"}