rolandinsh / SemartApiGateway

Simple Yet Powerful Api Gateway Based On Symfony Component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Semart Api Gateway

Semart Api Gateway is Fast, Simple Yet Powerful API Gateway base on Symfony Component that aim to simplify your day

If you want to get more feature that we don't provide, just use Kong

Requirements

  • PHP >= 7.2

  • Redis

  • Elasticsearch 7.X

  • PHP Redis Extension

Workflow

Workflow

Super Fast

Screenshot

Screenshot use SemartApiSkeleton demo on my Digital Ocean VPS with 1 GB of RAM

Install

git clone https://github.com/KejawenLab/SemartApiGateway.git gateway
cd gateway
cp .env.example .env
cp gateway.yaml.example gateway.yaml
cp routes.yaml.example routes.yaml
cp services.yaml.example services.yaml
cp aggregates.yaml.example aggregates.yaml
composer update
php gateway create-index
php -S localhost:8000 -t public/

Configuration

Please Check Main Configuration Example, Service Configuration Example and Routes Configuration Example

Statistic

You can see statistic by call path /gateway/statistic and the response be like

Reponse

Services Status

You can see statistic by call path /gateway/status and the response be like

Response

Health Check

Add to crontab

* * * * * php gateway health-check > /dev/null

Features

  • Easy to Install and Configure

  • Api Versioning

  • Public and Private Api

  • Aggregate Query

  • Load Balancer

  • Response Cache

  • Authentication Using JWT

  • Resource Limiter

  • Request Limiter

  • Request Timeout

  • Health Check

  • Statistic

Documentation

See The Doc

TODO

  • Trusted IPs
  • Implement Load Balancer
    • Random Method
    • Round Robin Method
    • Sticky (Master/Slave) Method
    • Weight Method
  • Multiple Service Per Route
  • Authorization
    • Authorization Header (Bearer) Forwarder
    • Trusted Ip List for Internal Call
    • Authetication For Internal Call
  • Api Versioning Per Service
  • Public and Private Api
  • Implement Rate Limiter
    • Limit Resource (Not Work When Using Random Balancer)
    • Limit Request
    • Request Timeout
  • Implement Health Check
  • Statistic Api
  • Services Status Api
  • Add Docker Support
  • Aggregate Query
  • Unit Testing

License

MIT License

About

Simple Yet Powerful Api Gateway Based On Symfony Component

License:MIT License


Languages

Language:PHP 96.2%Language:Dockerfile 2.7%Language:Shell 1.2%