{"id":20613220,"url":"https://github.com/robiningelbrecht/symfony-skeleton","last_synced_at":"2026-02-11T02:45:04.448Z","repository":{"id":261980185,"uuid":"885867574","full_name":"robiningelbrecht/symfony-skeleton","owner":"robiningelbrecht","description":"A Symfony skeleton I use to bootstrap new projects","archived":false,"fork":false,"pushed_at":"2024-12-10T10:23:52.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-10T11:27:35.850Z","etag":null,"topics":["skeleton","symfony","website"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/robiningelbrecht/symfony-skeleton","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/robiningelbrecht.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":"2024-11-09T15:52:02.000Z","updated_at":"2024-12-10T10:23:10.000Z","dependencies_parsed_at":"2024-11-09T17:51:03.146Z","dependency_job_id":null,"html_url":"https://github.com/robiningelbrecht/symfony-skeleton","commit_stats":null,"previous_names":["robiningelbrecht/symfony-skeleton"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fsymfony-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fsymfony-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fsymfony-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robiningelbrecht%2Fsymfony-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robiningelbrecht","download_url":"https://codeload.github.com/robiningelbrecht/symfony-skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234309754,"owners_count":18811947,"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":["skeleton","symfony","website"],"created_at":"2024-11-16T11:09:09.819Z","updated_at":"2025-09-26T12:31:00.625Z","avatar_url":"https://github.com/robiningelbrecht.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSymfony Skeleton\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/robiningelbrecht/symfony-skeleton/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/robiningelbrecht/symfony-skeleton/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://php.net/\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dependency-v/robiningelbrecht/symfony-skeleton/php.svg?color=%23777bb3\u0026logo=php\u0026logoColor=white\u0026version=dev-master\" alt=\"PHP\"\u003e\u003c/a\u003e\n\u003ca href=\"https://symfony.com/\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dependency-v/robiningelbrecht/symfony-skeleton/symfony%2Fframework-bundle?logo=symfony\u0026label=symfony\u0026version=dev-master\" alt=\"Symfony\"\u003e\u003c/a\u003e\n\u003ca href=\"https://phpstan.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PHPStan-level%2010-succes.svg?logo=php\u0026logoColor=white\u0026color=31C652\" alt=\"PHPStan Enabled\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/robiningelbrecht/symfony-skeleton/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/robiningelbrecht/symfony-skeleton?color=428f7e\u0026logo=open%20source%20initiative\u0026logoColor=white\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Bootstrap new project\n\n```bash\n\u003e composer create-project robiningelbrecht/symfony-skeleton [app-name] --no-install --ignore-platform-reqs\n```\n\nOpen `.env` and set following ENV VARIABLES:\n\n```\nDOCKER_CONTAINER_BASE_NAME=skeleton\nDOCKER_MYSQL_PORT=3306\nDOCKER_NGINX_PORT=8081\n```\n\n```bash\n# Install dependencies\n\u003e make composer arg=\"install\"\n# Setup project (configure containers and functionality)\n\u003e make console arg=\"app:setup\"\n```\n\n```bash\n# Build docker containers\n\u003e make build-containers\n```\n\n## Makefile\n\nThere are some predefined commands in the `Makefile`:\n\n```bash\n# Run test suite\n\u003e make phpunit\n# Run cs fixer\n\u003e make csfix\n# Run PHPstan\n\u003e make phpstan\n# Create and run migrations\n\u003e make migrate-diff\n\u003e make migrate-run\n# Run a console command\n\u003e make console arg=\"your:fancy:command\"\n```\n\n## Events\n\n### Recording Events\n\nIn your entity `use RecordsEvents;` and record events when needed:\n\n```php\nclass User\n{\n    use RecordsEvents;\n    \n    public static function create(\n        UserId $id,\n    ): self {\n        // ...\n        $user-\u003erecordThat(new UserWasCreated(\n            userId: $user-\u003egetUserId(),\n        ));\n\n        return $user;\n    }\n}\n```\n\n### Publishing Events\n\nIn your repository, inject the `EventBus` and publish the recorded events:\n\n```php\nfinal readonly class UserRepository implements CommandHandler\n{\n    public function __construct(\n        private EventBus $eventBus,\n    ) {\n    }\n    \n    public function save(User $user): void\n    {\n        // ...\n        $this-\u003eeventBus-\u003epublishEvents($user-\u003egetRecordedEvents());\n    }    \n\n```\n\n### Registering Event Listeners\n\nCreate a manager / event listener and add the `AsEventListener` attribute:\n\n```php\nfinal readonly class UserEmailManager\n{\n    #[AsEventListener]\n    public function reactToUserWasCreated(UserWasCreated $event): void\n    {\n        // ...\n    }\n}\n```\n\nMore info: [https://symfony.com/doc/current/event_dispatcher.html#defining-event-listeners-with-php-attributes](https://symfony.com/doc/current/event_dispatcher.html#defining-event-listeners-with-php-attributes)\n\n## Rate Limiter\n\n## Create a Rate Limiter\n\nDefine a new rate limiter in `config/packages/rate_limiter.yaml`:\n\n```yml\nframework:\n  rate_limiter:\n    anonymous:\n      policy: 'sliding_window'\n      limit: 100\n      interval: '60 minutes'\n```\n\n## Apply a limiter to a route\n\nThen apply it to the necessary routes:\n\n```php\n    #[RateLimiter('anonymous')]\n    #[Route(path: '/your/important/route', methods: ['GET', 'POST'])]\n    public function handle(Request $request): Response\n    {\n      // ...\n    }\n```\n\nmore info: [https://symfony.com/doc/current/rate_limiter.html](https://symfony.com/doc/current/rate_limiter.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobiningelbrecht%2Fsymfony-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobiningelbrecht%2Fsymfony-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobiningelbrecht%2Fsymfony-skeleton/lists"}