All Projects → koutsoumposval → Laravel Microservices

koutsoumposval / Laravel Microservices

Pseudo-microservices project written in Laravel

Projects that are alternatives of or similar to Laravel Microservices

laravel5-hal-json
Laravel 5 HAL+JSON API Transformer Package
Stars: ✭ 15 (-89.13%)
Mutual labels:  lumen, laravel5
php-framework-benchmark
php framework benchmark (include laravel、symfony、silex、lumen、slim、yii2、tastphp etc)
Stars: ✭ 17 (-87.68%)
Mutual labels:  lumen, laravel5
cache
Laravel & Lumen Cache Service | File and Redis cache system
Stars: ✭ 19 (-86.23%)
Mutual labels:  lumen, laravel5
Laravel5 Jsonapi
Laravel 5 JSON API Transformer Package
Stars: ✭ 313 (+126.81%)
Mutual labels:  lumen, laravel5
Laravel Short Url
A Laravel package to shorten urls
Stars: ✭ 127 (-7.97%)
Mutual labels:  laravel5
Esp V2
A service proxy that provides API management capabilities using Google Service Infrastructure.
Stars: ✭ 120 (-13.04%)
Mutual labels:  api-gateway
Aws Lambda Blog
AWS Lambda serverless blogging platform
Stars: ✭ 119 (-13.77%)
Mutual labels:  api-gateway
Hello Lambda
🔥 An example of a Python (AWS) Lambda exposed with API Gateway, configured with Terraform.
Stars: ✭ 114 (-17.39%)
Mutual labels:  api-gateway
Concord
Laravel extension for building modular applications where modules are decoupled, re-usable and easily customizable
Stars: ✭ 135 (-2.17%)
Mutual labels:  laravel5
Api Umbrella
Open source API management platform
Stars: ✭ 1,735 (+1157.25%)
Mutual labels:  api-gateway
Enroute
EnRoute Universal Gateway: Cloud Native API gateway with OpenAPI support and free L7 rate-limiting built on Envoy proxy
Stars: ✭ 126 (-8.7%)
Mutual labels:  api-gateway
Apisix Docker
the docker for Apache APISIX
Stars: ✭ 119 (-13.77%)
Mutual labels:  api-gateway
Vim Laravel
Vim support for Laravel/Lumen projects
Stars: ✭ 128 (-7.25%)
Mutual labels:  lumen
Aws Api Gateway Client
A client module of AWS API gateway both for Node.js and browsers
Stars: ✭ 119 (-13.77%)
Mutual labels:  api-gateway
Toastr
👀 toastr.js notifications for Laravel 5 and Lumen
Stars: ✭ 133 (-3.62%)
Mutual labels:  lumen
Vue Lumen Starter
😎 VueJs & Lumen Api Starter.
Stars: ✭ 116 (-15.94%)
Mutual labels:  lumen
Dubbo Go Pixiu
Based on the proxy gateway service of dubbo-go, it solves the problem that the external protocol calls the internal Dubbo cluster. At present, it supports HTTP and gRPC[developing].
Stars: ✭ 124 (-10.14%)
Mutual labels:  api-gateway
Rawcms
RawCMS is the headless CMS written in asp.net core build for developers that embraces API first technology. Please give us a feedback!
Stars: ✭ 132 (-4.35%)
Mutual labels:  api-gateway
Hexaville
The modern serverless web application engine and framework for Swift
Stars: ✭ 123 (-10.87%)
Mutual labels:  api-gateway
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (-13.04%)
Mutual labels:  api-gateway

Laravel Microservices

A simple laravel pseudo-microservices demo project. This is NOT a real "microservices" setup or at least something that is production ready! It is only here to point out the separation of concerns between each service and get you started with a containerized local environment using docker with a reverse proxy on top.

This project consists of three web services user, product & order and one API gateway api-gateway.

The webservices are containerised with Docker and are accessible within a Traefik proxy interface.

traefik image is used for the proxy container and php:7.1-apache is used and extended for the web services containers & the API gateway

The api is using the Guzzle API Client in order to maintain connection with the web services.

Lumen was preferred since it is an easy way to expose APIs.

Set up

Install Docker

The current Docker environment is based on Docker Toolbox. If you don't have Docker Toolbox installed, you can download it here.

Create a docker-machine *

    docker-machine create laravel-microservices
    eval $(docker-machine env laravel-microservices)

Mount volumes as NFS

To prevent permission problems we leverage Docker-Machine-NFS to mount volumes as NFS. First, install docker-machine-nfs and then run the following command:

docker-machine-nfs laravel-microservices --nfs-config="-alldirs -maproot=0" --mount-opts="noacl,async,nolock,vers=3,udp,noatime,actimeo=1"

Create the external network

    docker network create traefik_webgateway

Update the your hosts file

    # Get the ip of the VMachine
    docker-machine ip laravel-microservices
    
    # Update /etc/hosts file
    192.168.99.100 lm.local user.lm.local inventory.lm.local order.lm.local api.lm.local

Setup all services

In order to get up and running, you need to setup each individual service.

Once you set all services, you are ready to use them.

Build & Run

    docker-compose -f docker/docker-compose.yml up -d --build

Access

You can access the applications from:

    #user
    http://user.lm.local
    
    #inventory
    http://inventory.lm.local
    
    #order
    http://order.lm.local
    
    #api gateway
    http://api.lm.local

Reverse proxies

You can access Traefik interface from:

    http://lm.local:8080

Teardown and "Scale"

Teardown

    docker-compose -f docker/docker-compose.yml down --volumes --remove-orphans

Scale

    # DEPRECATED
    docker-compose -f docker/docker-compose.yml scale ${container-name}

Isolate Web Services

Removing the traefik.frontend.rule from the Web services will make them accessible only from the API gateway (traefik backend network)

Your Next Steps

Once you get started, you need to consider some of the following:

  • Use databases to store data. You can add new docker mysql containers in docker/docker-compose.yml and apply proxy configuration in order to be able to access them.
  • Each service must be accessible from a unique entry point, in our case the APIs. This should be the only way for communication between services.
  • Communication between the services should not be direct. One service should not be aware of the other! This type of communication can be achieved by using messaging or events.
  • Tests are essential part of software development. Functionality of each service should be unit tested. Functionality of the whole flow should be functionally tested.
  • This is a setup that is using older versions of Docker, Laravel/Lumen. Update them in order to be able to use their latest features.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].