Open-Source API Gateway

SentryGate

A high-performance, minimalist API gateway built on Bun. It acts as a secure front door for your microservices — handling routing, authentication, and rate-limiting — configured entirely through a single .toml file.

Built around four pillars

01 · Performance

Near-zero latency

Bun's ultra-fast runtime and native Fetch API keep your gateway out of the critical path.

02 · Security

Auth shielding

Built-in authentication, header masking, and configurable rate limiting at the edge.

03 · Scale

Stateless by design

Handles thousands of concurrent requests without session state or coordination overhead.

04 · Simplicity

One config file

Your entire routing and auth infrastructure lives in a single .toml file.

Pre-compiled binaries

No Bun or Node.js installation required. Download the standalone executable for your OS.

Platform Architecture Download
Windows x64 sentrygate.exe
Linux / macOS x64 / arm64 sentrygate

Quick start

01

Install the command

Run SentryGate globally like nginx. Choose your platform:

bash
# Move binary to your PATH
$ sudo mv ~/Downloads/sentrygate /usr/local/bin/sentry

# Make it executable
$ sudo chmod +x /usr/local/bin/sentry

# Start the gate
$ sentry start
  1. Rename the downloaded sentrygate.exe to sentry.exe
  2. Add its folder to System Environment Variables → Path
  3. Open a new terminal and run:
powershell
PS> sentry start
02

Configure your gate

Create sentrygate.toml in your project root:

toml
# Maps to BaseConfig interface
[base]
logging            = true
default_rate_limit = true
custom_rate_limit  = false

# Maps to ServerConfig interface
[server]
port        = 80
name        = "SentryGate-Lagos-Instance"
ssl_enabled = false
# cert_path = "/path/to/cert"
# key_path  = "/path/to/key"

# "root" → requests hit /users directly
[services.root]
target        = "http://localhost:8000"
strip_prefix  = false
auth_required = false   # set true for SentryAuth shield
timeout_ms    = 5000
rate_limit    = 60

# Second service — demonstrates the Record structure
[services.api]
target        = "http://localhost:8000"
strip_prefix  = true
auth_required = true

Build from source

Prefer compiling the TypeScript source yourself? Bun required.

bash
# Install dependencies
$ bun install

# Development mode
$ bun run src/index.ts

# Compile your own binary
$ bun build ./src/index.ts --compile --outfile sentrygate

Monitoring

SentryGate ships with a built-in health check and status reporter. Access it at:

http://localhost/sentry-status

Project structure

src/
├── core/ — Engine and routing
├── middleware/ — Auth, rate limiting, logging
└── utils/ — Config loader, header masking