{"id":13828372,"url":"https://github.com/narration/narration","last_synced_at":"2026-02-03T19:37:12.310Z","repository":{"id":57023780,"uuid":"165215869","full_name":"narration/narration","owner":"narration","description":"The Narration PHP Framework -  Empowering everyone to build reliable and loosely coupled web apps.","archived":false,"fork":false,"pushed_at":"2019-03-21T19:08:55.000Z","size":346,"stargazers_count":117,"open_issues_count":1,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-20T09:13:47.454Z","etag":null,"topics":["api","application","framework","php","psr-11","psr-15","psr-7","rest","web"],"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/narration.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-11T09:22:59.000Z","updated_at":"2024-10-28T17:28:39.000Z","dependencies_parsed_at":"2022-08-23T13:50:33.684Z","dependency_job_id":null,"html_url":"https://github.com/narration/narration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/narration/narration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narration%2Fnarration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narration%2Fnarration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narration%2Fnarration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narration%2Fnarration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narration","download_url":"https://codeload.github.com/narration/narration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narration%2Fnarration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29054855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: 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","application","framework","php","psr-11","psr-15","psr-7","rest","web"],"created_at":"2024-08-04T09:02:43.497Z","updated_at":"2026-02-03T19:37:12.294Z","avatar_url":"https://github.com/narration.png","language":"PHP","readme":"**THIS PACKAGE HASN'T BEEN RELEASED, DO NOT USE YET**\n\n\u003cp align=\"center\"\u003e\n    \u003cimg title=\"Narration\" width=\"30%\" src=\"https://raw.githubusercontent.com/narration/art/master/png/logotype.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg title=\"Narration\" width=\"70%\" src=\"https://raw.githubusercontent.com/narration/art/master/code.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/narration/narration\"\u003e\u003cimg src=\"https://img.shields.io/travis/narration/narration/master.svg\" alt=\"Build Status\"\u003e\u003c/img\u003e\u003c/a\u003e\n  \u003ca href=\"https://scrutinizer-ci.com/g/narration/narration\"\u003e\u003cimg src=\"https://img.shields.io/scrutinizer/g/narration/narration.svg\" alt=\"Quality Score\"\u003e\u003c/img\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/narration/narration\"\u003e\u003cimg src=\"https://poser.pugx.org/narration/narration/d/total.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/narration/narration\"\u003e\u003cimg src=\"https://poser.pugx.org/narration/narration/v/stable.svg\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/narration/narration\"\u003e\u003cimg src=\"https://poser.pugx.org/narration/narration/license.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**This is a work in progress**.\n\nNarration is the source for modern PHP - It enforces the implementation of proven patterns to bring resilience, reliability, and coordination to your web application.\n\n## Philosophies\n\n- **DDD** oriented code architecture\n- **Zero coupling** to the framework\n- **Strong PHPStan** rules to ensure the quality of the code\n- For **Scalable PSR-7 and PSR-15** compliant REST services.\n\n## Quick start\n\n\u003e **Requires [PHP 7.1.3+](https://php.net/releases/)**\n\nCreate your project using [Composer](https://getcomposer.org):\n\n```bash\ncomposer create-project narration/narration blog --stability=dev --prefer-source\n```\n\nThen, serve the appplication at `http://127.0.0.1:8000/`:\n\n```bash\nphp -S 127.0.0.1:8000 serve.php\n```\n\n## Structure\n\n### Application\n\nThe application logic is where you implement all use cases that depend on a given front end. It delegates the execution of business rules to the domain layer. **Keep this layer thin**.\n\n#### Application \u003e Http \u003e Request Handlers\n\nHTTP request handlers are a fundamental part of any web application. Server-side code receives a request message, processes it, and produces a response message:\n\n```php\nfinal class Index\n{\n    /**\n     * Handle the given request.\n     *\n     * @param  \\Psr\\Http\\Message\\ServerRequestInterface $request\n     *\n     * @return array\n     */\n    public function __invoke(ServerRequestInterface $request): array\n    {\n        return [\n            'quote' =\u003e 'Intellectuals solve problems, geniuses prevent them.',\n        ];\n    }\n}\n```\n\nRequest handlers **should** be placed at `Appplication/Http/RequestHandlers`. The routes are defined within the `config/routes/http.php` file.\n\nThis convention leads code that is easier to maintain, refactor and test.\n\n#### Application \u003e Http \u003e Middleware\n\nAn HTTP middleware component participates in processing an HTTP message. It acts on the request, generating the response, or forwarding the request to a subsequent middleware and possibly acting on its response. It provides a convenient mechanism for filtering HTTP requests entering your application:\n\n```php\nfinal class TrimStrings implements MiddlewareInterface\n{\n    /**\n     * Filters the given request before or after sending it to the handler.\n     *\n     * @param  \\Psr\\Http\\Message\\ServerRequestInterface $request\n     * @param  \\Psr\\Http\\Server\\RequestHandlerInterface $handler\n     *\n     * @return \\Psr\\Http\\Message\\ResponseInterface\n     */\n    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n    {\n        foreach ($request-\u003egetAttributes() as $name =\u003e $value) {\n            if (is_string($value)) {\n                $request = $request-\u003ewithAttribute($name, trim($value));\n            }\n        }\n\n        return $handler-\u003ehandle($request);\n    }\n}\n```\n\nThe middleware are defined within the `config/routes/http.php` file.\n\n#### Application \u003e Injectors\n\nWe provide a simple, yet powerful, IOC container. The framework doesn’t couple you to our container, feel free to swap to another PSR-11 implementation on the ‘config/container.php’ file.\n\nThe container is used by the default  PSR-7 router of the framework to inject the necessary dependencies on the request handlers.\n\nAn injector injects the dependencies of the application on the container. They **should** be placed at `Appplication/Injectors`.\n\nInjectors are defined within the `config/container.php` file.\n\n### Domain\n\nResponsible for representing concepts of the business rules. This layer is the **heart of business software**.\n\n### Infrastructure\n\nThe infrastructure layer is how the data that is initially held in domain entities (in memory) is persisted in databases or another persistent store. An example is using Doctrine code to implement the Repository pattern classes that use Entities to **persist data** in a relational database.\n\n## Contributing\n\nThank you for considering to contribute to Narration. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).\n\nYou can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates \u0026 detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro)\n\n## Support the development\n\n**Do you like this project? Support it by donating**\n\n- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=66BYDWAT92N6L)\n- Patreon: [Donate](https://www.patreon.com/nunomaduro)\n\n## Credits\n\nLot of this readme is based on [Design a DDD-oriented microservice](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/microservice-ddd-cqrs-patterns/ddd-oriented-microservice) by Microsoft.\n\n## License\n\nNarration is an open-sourced software licensed under the [MIT license](LICENSE.md).\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=66BYDWAT92N6L","https://www.patreon.com/nunomaduro"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarration%2Fnarration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarration%2Fnarration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarration%2Fnarration/lists"}