
Api Gateway
A powerfull ready-to-deploy api gateway
Postgres
railwayapp-templates/postgres-ssl:16
Just deployed
/var/lib/postgresql/data
api-gateway-ui
Root-101/api-gateway
Just deployed
api-gateway
Root-101/api-gateway
Just deployed
Api-Gateway
title: Api-Gateway
description: A basic ready-to-deploy api gateway
tags:
- api-gateway
- spring boot
- native
For the full docs go to: GitHub Repo
Deploy and Host Api-Gateway on Railway
Api-Gateway (we are looking for a better name) is a free open-source project developed to facilitate out of the box the role that API gateways play in a multi-service architecture. It provides the routing, backups, restores, and in a future not so far away, logs, rate limiters and others commons use cases, all in the click of a button with no extra config nor headaches.
About Hosting Api-Gateway
Hosting Api-Gateway give you access to 3 main components:
1 - A Postgres DB where all the config will be stored.
2 - An UI client to make the work easy, no need to use the API. And in the core of the project,
3 - A service where the magic happens, the one in charge of all management and routing. In this service we can (with the help of the DB and the UI, or the API for the more hardcore developers) configure the routes to which we want to redirect, create them, edit them, delete them, save the configurations, restore other configurations, the classic use cases for this type of services.
Common Use Cases
- Api-Gateway: Right now there is basically just one use case we are trying to address: The ability to have an unified public service exposed to the internet, where it will handle all the calls, and redirect to the correct service.
- Security: Having this service, you can always use private network for all the services, and only expose the gateway to the internet, improving to the minimum the amount of vulnerable services exposed.
- In The Future: In the future we will provide other use cases like logs, real-time analytics of traffic, monitoring...
Dependencies for Api-Gateway
Core Dependencies:
PostgreSQL: Primary database for storing configurations
Deployment Dependencies:
Railway PostgreSQL Template: https://railway.com/template/postgres
Api-Gateway Repo: https://github.com/Root-101/api-gateway
Implementation Details
- Your Api-Gateway deployment will start 3 services, a PostgreSQL DB, a web for the management, and the gateway service. All three will consume about 150-200MB of ram.
- By default, an admin user is configured with username admin and password admin123**. We recommend you to change this values in the ADMIN_USERNAME and the ADMIN_PASSWORD env variables of the gateway service.
- The main service and the DB are connected through private networking, so the project must have private networking enabled in order for it to work correctly. Otherwise, the PGHOST variable is initialized empty and both components must be manually restarted to obtain the correct value.
- The client UI is connected to the gateway service through RAILWAY_PUBLIC_DOMAIN, pointing to the admin path defined in the env ADMIN_PATH of the gateway service.
Why Deploy Api-Gateway on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure, so you don't have to deal with configuration, while allowing you to vertically scale it.
By deploying Api-Gateway on Railway via this template, you get a simple, but powerful, fully configured ready to use, super magic with sprinkles, and reliable api gateway, that would take you multi services architecture to the next level.
This is after all a project designed for deploy in railway as a template... so:
Template Content
api-gateway-ui
Root-101/api-gatewayapi-gateway
Root-101/api-gateway