{"id":14974431,"url":"https://github.com/koutsoumposval/laravel-microservices","last_synced_at":"2025-04-09T09:10:01.537Z","repository":{"id":37546942,"uuid":"106948248","full_name":"koutsoumposval/laravel-microservices","owner":"koutsoumposval","description":"Pseudo-microservices project written in Laravel","archived":false,"fork":false,"pushed_at":"2023-04-19T18:41:59.000Z","size":187,"stargazers_count":220,"open_issues_count":6,"forks_count":88,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T07:10:02.708Z","etag":null,"topics":["api-gateway","docker","laravel-microservices","laravel5","lumen","traefik"],"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/koutsoumposval.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-14T17:28:20.000Z","updated_at":"2025-02-13T03:46:27.000Z","dependencies_parsed_at":"2024-10-11T10:51:45.787Z","dependency_job_id":null,"html_url":"https://github.com/koutsoumposval/laravel-microservices","commit_stats":{"total_commits":8,"total_committers":3,"mean_commits":"2.6666666666666665","dds":0.375,"last_synced_commit":"592d6e7dd545c2bcef07119e70705adc10edcdb4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koutsoumposval%2Flaravel-microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koutsoumposval%2Flaravel-microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koutsoumposval%2Flaravel-microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koutsoumposval%2Flaravel-microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koutsoumposval","download_url":"https://codeload.github.com/koutsoumposval/laravel-microservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"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":["api-gateway","docker","laravel-microservices","laravel5","lumen","traefik"],"created_at":"2024-09-24T13:50:33.246Z","updated_at":"2025-04-09T09:10:01.521Z","avatar_url":"https://github.com/koutsoumposval.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Microservices\n\nA simple laravel pseudo-microservices demo project.\nThis is NOT a real \"microservices\" setup or at least something that is production ready!\nIt is only here to point out the separation of concerns between each service and get you started\nwith a containerized local environment using docker with a reverse proxy on top.\n\nThis project consists of three web services `user`, `product` \u0026 `order` and \none API gateway `api-gateway`.\n\nThe webservices are containerised with Docker and are accessible within a\nTraefik proxy interface. \n\n`traefik` image is used for the proxy container and `php:7.1-apache` is used and extended\nfor the web services containers \u0026 the API gateway\n\nThe `api` is using the Guzzle API Client in order to maintain connection with the web services.\n\nLumen was preferred since it is an easy way to expose APIs.\n\nSet up\n------------\n\n#### Install Docker\nThe current Docker environment is based on Docker Toolbox. \nIf you don't have Docker Toolbox installed, you can download it [here](https://www.docker.com/products/docker-toolbox).\n\n\n#### Create a docker-machine *\n```\n    docker-machine create laravel-microservices\n    eval $(docker-machine env laravel-microservices)\n```\n\n#### Mount volumes as NFS\nTo prevent permission problems we leverage Docker-Machine-NFS to mount volumes as NFS.\nFirst, [install docker-machine-nfs](https://github.com/adlogix/docker-machine-nfs) and then run the following command:\n```bash\ndocker-machine-nfs laravel-microservices --nfs-config=\"-alldirs -maproot=0\" --mount-opts=\"noacl,async,nolock,vers=3,udp,noatime,actimeo=1\"\n```\n\n#### Create the external network\n```\n    docker network create traefik_webgateway\n```\n\n#### Update the your hosts file\n```\n    # Get the ip of the VMachine\n    docker-machine ip laravel-microservices\n    \n    # Update /etc/hosts file\n    192.168.99.100 lm.local user.lm.local inventory.lm.local order.lm.local api.lm.local\n```\n\nSetup all services\n------------\nIn order to get up and running, you need to setup each\nindividual service.\n\n- [user](user/readme.md)\n- [order](order/readme.md)\n- [inventory](user/readme.md)\n- [api gateway](api-gateway/readme.md)\n\nOnce you set all services, you are ready to use them.\n\nBuild \u0026 Run\n------------\n```\n    docker-compose -f docker/docker-compose.yml up -d --build\n```\n\nAccess\n------------\nYou can access the applications from:\n```\n    #user\n    http://user.lm.local\n    \n    #inventory\n    http://inventory.lm.local\n    \n    #order\n    http://order.lm.local\n    \n    #api gateway\n    http://api.lm.local\n```\n\n#### Reverse proxies\nYou can access Traefik interface from:\n```\n    http://lm.local:8080\n```\n\nTeardown and \"Scale\"\n------------\n#### Teardown\n```\n    docker-compose -f docker/docker-compose.yml down --volumes --remove-orphans\n```\n\n#### Scale\n```\n    # DEPRECATED\n    docker-compose -f docker/docker-compose.yml scale ${container-name}\n```\n\nIsolate Web Services\n------------\nRemoving the `traefik.frontend.rule` from the Web services will make\nthem accessible only from the API gateway (traefik backend network)\n\nYour Next Steps\n------------\nOnce you get started, you need to consider some of the following:\n\n- Use databases to store data. You can add new docker `mysql` containers in `docker/docker-compose.yml` and apply \nproxy configuration in order to be able to access them.\n- Each service must be accessible from a unique entry point, in our case the APIs.\nThis should be the only way for communication between services.\n- Communication between the services should not be direct. One service should not be aware of the other!\nThis type of communication can be achieved by using messaging or events.\n- Tests are essential part of software development. Functionality of each service should be\nunit tested. Functionality of the whole flow should be functionally tested.\n- This is a setup that is using older versions of Docker, Laravel/Lumen. Update them in order to be able to\nuse their latest features.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoutsoumposval%2Flaravel-microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoutsoumposval%2Flaravel-microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoutsoumposval%2Flaravel-microservices/lists"}