{"id":15753595,"url":"https://github.com/marella/test-lumen","last_synced_at":"2025-10-07T17:49:35.787Z","repository":{"id":66207405,"uuid":"49384472","full_name":"marella/test-lumen","owner":"marella","description":"Test monolith and microservices implementation in lumen.","archived":false,"fork":false,"pushed_at":"2016-01-10T20:50:40.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T12:15:38.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-10T20:37:51.000Z","updated_at":"2021-07-06T11:57:01.000Z","dependencies_parsed_at":"2023-03-17T14:15:35.840Z","dependency_job_id":null,"html_url":"https://github.com/marella/test-lumen","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/marella%2Ftest-lumen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Ftest-lumen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Ftest-lumen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Ftest-lumen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marella","download_url":"https://codeload.github.com/marella/test-lumen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436052,"owners_count":20776960,"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-10-04T07:41:23.237Z","updated_at":"2025-10-07T17:49:30.755Z","avatar_url":"https://github.com/marella.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Overview\nEach service shares only the framework code and the `Api` service located in *services/Api/Api.php*. Each service including main app can interact with other services only through `Api` service. `Api` service will use internal routing in monolith. When dividing monolith into microservices only this has to change.\n\n### Initial setup\n\nfile or dir|action\n---|---\nstorage/|make it writable by apache\npublic/index.php|change to `$app-\u003erun($app['request'])`\nbootstrap/app.php|uncomment `Dotenv::load`\nbootstrap/app.php|uncomment `$app-\u003ewithFacades()`\nbootstrap/app.php|move app route group to *app/Http/routes.php*\n.env|copy *.env.example* to *.env*\nconifg/|copy *vendor/laravel/lumen-framework/config/*\napp/Http/routes.php|add `$app-\u003econfigure('app')`\nservices/|mkdir *services* and use *app* dir structure for each service and change namespaces, filenames etc.\ncomposer.json|add `\"Services\\\\\": \"services/\"` and run `composer dump-autoload`\nbootstrap/app.php|add *services/ServiceName/Http/routes.php*\nconfig/services/|mkdir *services* and add service specific config here\nservices/ServiceName/Http/routes.php|add `$app-\u003econfigure('services/service_name')`\n\n### Monolith to Microservices\n- Make copies of the framework code and do initial setup for each microservice\n- Copy *config/services/service_name.php* and *services/ServiceName/* dir\n- Copy other config like *config/database.php* that is used by common services like `DB`, `Cache` etc.\n- Keep only current service routes in *bootstrap/app.php*\n- Implement `Api` service to make requests to respective endpoints instead of doing internal routing\n\n### Test\n```bash\n# cd to www root\nmkdir test \u0026\u0026 cd test\ngit clone https://github.com/marella/test-lumen.git\ncd test-lumen/monolith\ncomposer install\n# now cd to other dirs (app, service_a, service_b) and run composer install\n# or simply copy composer.lock and vendor dir\n```\nIf required change `$base_url` in `services/Api/Api.php` inside *test-lumen/app/*, *test-lumen/service_a/* and *test-lumen/service_b/*. Default `$base_url` is `http://localhost/test/test-lumen/`.\n\n- [Monolith app](http://localhost/test/test-lumen/monolith/public/test)\n- [Monolith Service A](http://localhost/test/test-lumen/monolith/public/service/service-a/test)\n- [Monolith Service B](http://localhost/test/test-lumen/monolith/public/service/service-b/test)\n- [app](http://localhost/test/test-lumen/app/public/test)\n- [Microservice A](http://localhost/test/test-lumen/service_a/public/service/service-a/test)\n- [Microservice B](http://localhost/test/test-lumen/service_b/public/service/service-b/test)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Ftest-lumen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarella%2Ftest-lumen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Ftest-lumen/lists"}