{"id":20472675,"url":"https://github.com/maxpou/symfony-rest-beer-edition","last_synced_at":"2025-04-13T11:22:03.549Z","repository":{"id":68227455,"uuid":"50193111","full_name":"maxpou/symfony-rest-beer-edition","owner":"maxpou","description":":beers: A Symfony application with a REST API","archived":false,"fork":false,"pushed_at":"2016-10-03T18:55:12.000Z","size":134,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T02:38:29.867Z","etag":null,"topics":["beer","hateoas","php","rest","symfony"],"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/maxpou.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":"2016-01-22T16:29:33.000Z","updated_at":"2018-05-03T11:08:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5a02dab-bc24-42fc-baca-acaef041d7ed","html_url":"https://github.com/maxpou/symfony-rest-beer-edition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpou%2Fsymfony-rest-beer-edition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpou%2Fsymfony-rest-beer-edition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpou%2Fsymfony-rest-beer-edition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpou%2Fsymfony-rest-beer-edition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxpou","download_url":"https://codeload.github.com/maxpou/symfony-rest-beer-edition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703745,"owners_count":21148225,"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":["beer","hateoas","php","rest","symfony"],"created_at":"2024-11-15T14:21:14.662Z","updated_at":"2025-04-13T11:22:03.532Z","avatar_url":"https://github.com/maxpou.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Symfony Rest Beer Edition (Work in progress)\n============================================\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/665c060e-aa8a-458a-b74c-44c5725c7155/big.png)](https://insight.sensiolabs.com/projects/665c060e-aa8a-458a-b74c-44c5725c7155)  \n[![Build Status](https://travis-ci.org/maxpou/symfony-rest-beer-edition.svg?branch=master)](https://travis-ci.org/maxpou/symfony-rest-beer-edition)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/maxpou/symfony-rest-beer-edition/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/maxpou/symfony-rest-beer-edition/?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/maxpou/symfony-rest-beer-edition/badge.svg?branch=master)](https://coveralls.io/github/maxpou/symfony-rest-beer-edition?branch=master)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/)\n\n\nWelcome to the Symfony Rest Beer Edition!  \n\nFeatures in this application:\n\n* Specific HTTP Status Codes (204, 206, 400, 404...), HTTP Verbs (GET/POST/PUT/DELETE/OPTIONS)\n* Routes with subresources, collection filters...\n* Fully swagger documentation (visit /api/doc)\n* Symfony's Form component support\n* Routes pluralization (beer -\u003e beers \u0026 brewery -\u003e breweries).  \n*See class ApiBundle\\Util\\Inflector\\BreweryInflector.*\n* Serialization exclusion strategies\n* HATEOAS with exclusions policies - use [Hypertext Application Language](http://stateless.co/hal_specification.html) (HAL)\n* Support JSON/XML format\n\n## Installation\n\n1. Update parameters.yml (create a new secret key)\n2. Execute this commands\n\n    ```\n    composer install\n    php app/console doctrine:database:create  \n    php app/console doctrine:schema:create  \n    php app/console doctrine:fixtures:load -n\n    ```\n3. Check configuration by executing `php app/check.php`\n4. Test `composer test`\n\n## What's inside?\n\n* All Symfony default bundles (FrameworkBundle, DoctrineBundle, TwigBundle, MonologBundle...)\n* [JMSSerializerBundle](https://github.com/schmittjoh/JMSSerializerBundle) - Easily serialize, and deserialize data of any complexity (supports XML, JSON, YAML)\n* [FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle) provides several tools to assist in building REST applications\n* [BazingaHateoasBundle](https://github.com/willdurand/BazingaHateoasBundle) provide HATEOAS\n* [NelmioApiDocBundle](https://github.com/nelmio/NelmioApiDocBundle) provide a nice documentation for API (inspired by Swagger UI project)\n* [NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) adds CORS headers support in your Symfony2 application\n* [DoctrineFixturesBundle](DoctrineFixturesBundle) provide breweries and beers (see Maxpou\\BeerBundle\\DataFixtures\\ORM\\LoadBeersData.php)\n\nAnd in /src :\n\n* **ApiBundle** : contain API controllers\n* **MaxpouBeerBundle** : contains entities, forms, fixtures and back office controllers\n* **AppBundle** : Back office controllers... not very important!\n\n*Back-office views use [Bootstrap](http://getbootstrap.com) (CDN Host)*\n\n## Focuses\n\n**Entities:**  \nWe have only 2 entities: Brewery and Beer (Many-To-One relationship).\n\n**Code First approach:**  \nI use Code First approach (by opposition to Database/Model First). It's mean that I start by writing classes not model/SQL DDL orders. Otherwise it's hard to maintain (I know, doctrine is reverse engineering compliant).\n\n**UUID:**  \nPrefer UUID instead of auto increment because, it's make harder to discover existing resources (for malignant users). Also, it's might not be unique in distributed systems.\n\n\n## TODO\n\n**REST misconfiguration:**  \n- [ ] POST /whatever-collection... -\u003e must return HTTP header: `Location: http://app.com/breweries/newidcreated`\n- [ ] GET /whatever on array objects, Only put URI\n- [ ] GET /whatever-collection -\u003e must return HTTP code 206 (Partial content) and add links into Link HTTP headers (e.g. fist, prev, next and last page)\n\n**Enhancements:**  \n- [ ] Make controllers **more thins!** (use ParamConverter, avoid doctrine researches in controllers)\n- [ ] Implement PATCH HTTP method\n- [ ] Exclusion strategy: allow HTTP header Prefer/Vary (Request) and Vary/Preference-Applied (Response). Because clients don't need the same information\n- [ ] Allow sort collection\n- [ ] Add a /serve API to implement HTTP Rate limitation.  \nHTTP Headers:\n  * X-RateLimit-Limit: Total number of beer allow to drink ;)\n  * X-RateLimit-Remaining: Beer left\n  * X-RateLimit-Reset: remaining window before rate limit resets (UTC epoch seconds)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpou%2Fsymfony-rest-beer-edition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxpou%2Fsymfony-rest-beer-edition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpou%2Fsymfony-rest-beer-edition/lists"}