{"id":44289922,"url":"https://github.com/r0mdau/fradoos","last_synced_at":"2026-02-10T23:32:59.128Z","repository":{"id":43386645,"uuid":"236558144","full_name":"r0mdau/fradoos","owner":"r0mdau","description":"PHP DDD Skeleton using Slim framework, Doctrine ORM and PHPUnit tests","archived":false,"fork":false,"pushed_at":"2022-03-04T00:45:07.000Z","size":591,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-30T19:52:06.241Z","etag":null,"topics":["ddd","doctrine-orm","example-project","hexagonal-architecture","php","phpunit"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r0mdau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-01-27T18:09:35.000Z","updated_at":"2024-05-12T00:58:00.000Z","dependencies_parsed_at":"2022-08-24T11:31:23.526Z","dependency_job_id":null,"html_url":"https://github.com/r0mdau/fradoos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/r0mdau/fradoos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0mdau%2Ffradoos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0mdau%2Ffradoos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0mdau%2Ffradoos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0mdau%2Ffradoos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r0mdau","download_url":"https://codeload.github.com/r0mdau/fradoos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0mdau%2Ffradoos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29321390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["ddd","doctrine-orm","example-project","hexagonal-architecture","php","phpunit"],"created_at":"2026-02-10T23:32:57.894Z","updated_at":"2026-02-10T23:32:59.116Z","avatar_url":"https://github.com/r0mdau.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fradoos\n\n![PHPUnit](https://github.com/r0mdau/fradoos/actions/workflows/unit-tests.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/r0mdau/fradoos/badge.svg?branch=main)](https://coveralls.io/github/r0mdau/fradoos?branch=main)\n\nThis project is a CRUD demo written in PHP. It's goal is to build a simple reliable and fast developing API\nusing :\n- Hexagonal Architecture\n- Domain Driven Design\n- PHP\n- [Slim micro framework](http://www.slimframework.com/)\n- [Doctrine ORM](https://www.doctrine-project.org)\n- [PHPunit](https://phpunit.de/) tests.\n\nThis demo project is under development. See todolist below. I mention commits in front of todo items to see the minimum\ndiff of code to produce to make it working.\n\n## Quickstart\n\nPrerequisites :\n- plenty php7 packages\n- [composer](https://getcomposer.org/)\n- [docker](https://www.docker.com/)\n\nAdd this in your hosts file :\n```\n127.0.0.1 mysql-fradoos fradoos.local\n```\n\nThen prepare folders :\n```bash\nmkdir -p build/log/apache2/fradoos.local\nmkdir -p build/log/fradoos.local\nmkdir -p build/data/fradoos\nchmod -R 777 build/log\n```\n\nLaunch containers :\n```bash\ncomposer start\n# or\ndocker-compose up\n```\nPhpmyadmin is available at http://localhost:8090\n\nBut for the first time you will need to create tables and the the schema before running the examples.\n```bash\ncomposer update-db\n```\n\nTo launch unit tests, check code style and flush out bugs, run\n```bash\ncomposer verify\n```\n\n### CRUD client examples\nWorking Group CRUD\n```bash\ncurl -XPOST fradoos.local:8080/workingGroup -d \"name=ceo\"\ncurl -XGET fradoos.local:8080/workingGroup/1\ncurl -XPUT fradoos.local:8080/workingGroup/1 -d \"name=cto\"\ncurl -XDELETE fradoos.local:8080/workingGroup/1\n```\n\nCreate user adding a company\n```bash\n#create company\ncurl -XPOST fradoos.local:8080/company -d \"name=bigbossindustry\"\n#create user with previous company\ncurl -XPOST fradoos.local:8080/user -d \"name=toto\u0026email=ko@email.fr\u0026company=1\"\n```\n\nAdd working groups to user\n```bash\ncurl -XPUT fradoos.local:8080/user/1 -d \"name=toto\u0026email=ko@email.fr\u0026company=2\u0026workingGroups[]=1\u0026workingGroups[]=2\"\n```\n\n\n## Domain details\n\n- A user has a name and email, both are mandatory.\n- A user work in a company but not mandatory\n- A user can belong to many working groups\n- A working group can belong to many users\n- We can retrieve user's working groups, but not the opposite\n- A company has a name\n- A working group has a name\n\n## Folder structure\n\n### Application\n\nTo store everything exposed to external potential clients. Here it's a HTTP API.\n\nWe use `Presentations` to choose the content type you need to return. Using JSON here.\n\n#### GET reserved keyword\n\nTo lose HTTP data exchanges, we use a reserved keyword `fields` in GET parameters to filter properties the client needs.\nExample :\n```bash\ncurl -XGET fradoos.local:8080/user?fields=id\n--\u003e\n[{\"id\":2},{\"id\":3},{\"id\":4}]\n\ncurl -XGET fradoos.local:8080/user?fields=id,name\n--\u003e\n[{\"id\":2,\"name\":\"romain\"},{\"id\":3,\"name\":\"romain\"},{\"id\":4,\"name\":\"romain\"}\n```\n\nIf no fields is specified, all specified default properties are returned.\n\n#### Swagger docs\n\nOf course, swagger doc is presented through `/api-docs`.\n\n### Domain\n\nHere we find the logic, very important : the doctrine entities and interfaces to discuss from Application and\nInfrastructure to Domain.\n\n### Infrastructure\n\nWe don't put the mapping between entities and ORM in annotations in Domain entities. Instead they are in\n`Infrastructure/Repository/Doctrine/Mapping`. So if we need to change Doctrine by something else, Domain entites stay\nthe same.\n\n## Tests\n\nYou can disable the launch of a sql server in docker and use an alternative.\n\n```bash\n./run.sh\n# to launch only unit tests\ncomposer test-unit\n# you need mysql running for infrastructure tests\ncomposer test-infra\n# to launch all tests\ncomposer test\n```\n\n## Composer Scripts\n\nMutliple composer scripts to help daily tasks.\n\n## TODOs\n\nClick on commit id to see changes\n\n- [x] [75eddfe](https://github.com/r0mdau/fradoos/commit/75eddfe458ad039f23e19352e72ccef5eaa5cc55) Upgrade slimframework\n- [x] [75eddfe](https://github.com/r0mdau/fradoos/commit/75eddfe458ad039f23e19352e72ccef5eaa5cc55) Upgrade Doctrine orm\n- [x] [75eddfe](https://github.com/r0mdau/fradoos/commit/75eddfe458ad039f23e19352e72ccef5eaa5cc55) Upgrade PHPUnit\n- [ ] Add specifications\n- [x] [f6c467e](https://github.com/r0mdau/fradoos/commit/f6c467e333580c6f100815ee1d7e3fd323ae2279) Implement MessageLog class\n- [ ] Use abstraction of databases to test Infrastructure, perhaps sqlite in memory\n- [ ] Add entities history change management\n- [ ] Add flyway to automatically maintain database structure with new entities in other environments than local\n- [ ] Add Doctrine Second Level Cache\n- [ ] Mermaid class diagram\n- [ ] Update README.md after all todos\n\nAdd more entities to show links using doctrine\n- [x] [1b92c10](https://github.com/r0mdau/fradoos/commit/1b92c102456ec90c9a7f019872827db85a94e596) ManyToOne\n- [ ] OneToMany\n- [x] [5eff472](https://github.com/r0mdau/fradoos/commit/5eff472f7a3c2125bbf07feba4b5de5af19ea895) Simple CRUD : associated with ManyToMany below\n- [x] [8a7584f](https://github.com/r0mdau/fradoos/commit/8a7584f80ec2354fdf65370766331d33680cf2ff) ManyToMany\n- [ ] Inheritance\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr0mdau%2Ffradoos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr0mdau%2Ffradoos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr0mdau%2Ffradoos/lists"}