{"id":21277952,"url":"https://github.com/b13/slimphp-bridge","last_synced_at":"2025-04-08T04:19:15.135Z","repository":{"id":42661606,"uuid":"203154567","full_name":"b13/slimphp-bridge","owner":"b13","description":"SlimPHP Integration in TYPO3 Frontend for rapid API development","archived":false,"fork":false,"pushed_at":"2024-09-30T09:09:02.000Z","size":66,"stargazers_count":18,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T09:41:05.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-08-19T10:54:10.000Z","updated_at":"2024-11-18T07:58:19.000Z","dependencies_parsed_at":"2024-02-12T14:54:38.087Z","dependency_job_id":"f6d80d7d-156e-40ba-9847-7381cd1b81bd","html_url":"https://github.com/b13/slimphp-bridge","commit_stats":{"total_commits":32,"total_committers":6,"mean_commits":5.333333333333333,"dds":0.59375,"last_synced_commit":"e140841a6c1b89f8b6a83e9487d2787d833e3f30"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fslimphp-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fslimphp-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fslimphp-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fslimphp-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/slimphp-bridge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773726,"owners_count":20993639,"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":[],"created_at":"2024-11-21T10:08:23.801Z","updated_at":"2025-04-08T04:19:15.105Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SlimPHP - TYPO3 Bridge Extension\n\nBoot up a SlimPHP application within a PSR-15 middleware of the TYPO3 Frontend\nRequest.\n\nThere are two things you need for this:\n\n1. Create your endpoints with a SlimPHP `RequestResponseArgs` strategy in PHP\n2. Configure your endpoints in your site configuration file\n\nClear caches and you should be good to go.\n\n## Description\n\nTYPO3 v9 offers a flexible way to hook into the Frontend Rendering process\nand do something completely different - thanks to PSR-7 and PSR-15.\n\nSlimPHP is also based on the PSR standards and is a perfect fit if a TYPO3\ndeveloper needs to integrate a proper API via e.g. REST.\n\nThis small wrapper extension helps to get going very quickly when needing\na small API layer for arbitrary endpoints. It is not meant to become a fully\nheadless solution for TYPO3 as a CMS.\n\nHowever, a TYPO3 PHP developer should be familiar with starting off\nreally quickly to handle custom endpoints without having to write TypoScript.\n\n## Installation\n\nInstall it via `composer req b13/slimphp-bridge` (currently composer-only as some PHP dependencies\nare needed).\n\nActivate the extension in the backend of TYPO3. \n\n## Configuration\n\nThen adapt your site configuration to add custom routes.\n\nThe `type: slim` entry enables a SlimPHP Application. The current Site object\nis then available in the request object.\n\n````yml\nroutes:\n  - route: '/api'\n    type: 'slim'\n    # add middlewares for the whole application. Convenient for any error handling or adding Preflight checks (OPTIONS)\n    middlewares:\n      - 'B13\\MyExtension\\Middleware\\PreflightCheck'\n    groups:\n    - route: '/v1'\n      middlewares:\n        # enable this if you don't manage your languages via the URL endpoint + the base site handling.\n        - 'B13\\SlimPhp\\Middleware\\PreferredClientLanguageSelector'\n        # enable this if you need extbase in your custom setup\n        - 'B13\\SlimPhp\\Middleware\\ExtbaseBridge'\n      routes:\n        # load a file\n        - methods: [any]\n          route: '/schema.json'\n          file: 'EXT:myextension/Resources/Private/Api/schema_v1.json'\n          contentType: 'application/json'\n        - methods: [get]\n          route: '/article'\n          callback: B13\\MyExtension\\Controller\\LoadArticlesController\n        - methods: [get]\n          route: '/customer'\n          callback: B13\\MyExtension\\Controller\\CustomerController:fetchAll\n          middlewares: [B13\\MyExtension\\Middleware\\JwtAuthentication]\n        - methods: [get]\n          route: '/customer/{id}'\n          callback: B13\\MyExtension\\Controller\\Api\\CustomerController:fetch\n          middlewares: [B13\\MyExtension\\Middleware\\JwtAuthentication]\n        - methods: [put]\n          route: '/customer/{id}'\n          callback: B13\\MyExtension\\Controller\\Api\\CustomerController:update\n          middlewares: [B13\\MyExtension\\Middleware\\JwtAuthentication]\n````\n\nThe configuration is similar to what you can do with SlimPHP and with TYPO3, and your controllers just follow\nthe `RequestResponseArgs` strategy pattern in SlimPHP.\n\nOnce you create your endpoints (callbacks), clear your caches and you can run your installation directly.\n\n__TYPO3 10.4__: If you wan't to use DI in your callbacks, you will have to make them public in the DI configuration:\n\n```yaml\nservices:\n  B13\\MyExtension\\Controller\\Api\\CustomerController:\n    public: true\n```\n\nCurrently, the extension ships with Tobias Nyholm's PSR implementation, as this provides proper PSR-17 factories.\n\n### Caveats\n\nEvery time you change your configuration, ensure to clear the TYPO3 core caches.\n\n## ToDo\n\n- More documentation to get started and define all options available\n- More Tests\n- More flexibility with the routing parameters\n- Proper error handling\n\n## License\n\nAs TYPO3 Core, this extension is licensed under GPL2 or later. See the LICENSE file for more details.\n\n## Authors \u0026 Maintenance\nThis extension was initially created for a customer project by Benni Mack for [b13, Stuttgart](https://b13.com).\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fslimphp-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fslimphp-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fslimphp-bridge/lists"}