Skip to content

ChetanGanta/Bridge-API-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ‰ BRIDGE API Gateway v1.0.4

BRIDGE is a high-performance, self-hosted API gateway built on Node.js and Fastify. It sits between your clients and microservices to handle cross-cutting concerns like authentication, rate limiting, caching, and logging.

โœจ Features

  • Lightning Fast: Powered by Fastify and Pino.
  • Authentication: Native support for JWT and static API Keys.
  • Rate Limiting: Redis-backed fixed-window rate limiting.
  • Type Safe: Configuration validated at startup using Zod.
  • Observability: Structured JSON logging ready for centralized log aggregators.

๐Ÿš€ Quick Start

1. Prerequisites

  • Node.js (v18+)
  • Redis (running locally or via Docker)

2. Installation

Clone the repository and install dependencies: ```bash npm install ```

3. Configuration

Create a `.env` file in the root directory based on the following environment variables:

```env PORT=3000 REDIS_URL=redis://localhost:6379 JWT_SECRET=your_super_secret_jwt_key_here API_KEY=optional_static_api_key LOG_LEVEL=info NODE_ENV=development ```

4. Running the Gateway

To run in development mode with hot-reloading: ```bash npm run dev ```

To build and run for production: ```bash npm run build npm run start ```

๐Ÿ› ๏ธ Architecture

Requests pass through the following lifecycle hooks:

  1. Request Logging: Captures incoming method and path.
  2. Authentication: Validates `Authorization` or `X-API-Key` headers.
  3. Rate Limiting: Checks Redis counters against the configured limits.
  4. Transformation & Proxy: (Pending implementation) Routes traffic to downstream services.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors