Skip to content

Latest commit

 

History

History
137 lines (96 loc) · 3.63 KB

README.md

File metadata and controls

137 lines (96 loc) · 3.63 KB

Logo

api-gateway Python License Release Last Commit GitHub issues

A lightweight API gateway for AI, REST, SOAP, GraphQL, gRPC, and WebSocket APIs. Fully managed with built-in RESTful APIs for configuration and control. This is your application’s gateway to the world.

🔗 pygate.org

No specialized low-level language expertise required. Just a simple, cost-effective API Gateway built in Python. 🐍

Features

  • ✅ Authentication & Authorization
  • ✅ Dynamic Routing
  • ✅ Role & Group Management
  • ✅ Rate Limiting & Throttling
  • ✅ Logging files
  • ✅ Caching with Redis
  • ✅ MongoDB Integration
  • ✅ REST Support
  • ✅ AI Support
  • ✅ SOAP Support
  • 🔜 GraphQL Support
  • 🔜 gRPC Support
  • 🔜 WebSocket Support
  • 🔜 Request Validation
  • 🔜 Transformation
  • 🔜 Field Encryption
  • 🔜 Orchestration

Releases

Documentation

🔗 API documentation

🔗 Postman collection

🔗 OpenAPI swagger

Installation

Ensure you have a MongoDB server and redis running.

Clone pygate repository

  git clone https://github.com/pygate-dev/pygate.git

Install requirements

  pip install -r requirements.txt

Set environment variables

# Startup admin should be used for setup only
[email protected]
STARTUP_ADMIN_PASSWORD=SecPassword!12345

# Mongo DB Config
MONGO_DB_HOSTS=localhost:27017 # Comma separated
MONGO_REPLICA_SET_NAME=rs0

# Redis Config
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0

# Authorization Config
JWT_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# API Encryption Key (for API Keys)
ENC_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# HTTP Config
ALLOWED_ORIGINS=https://localhost:8443  # Comma separated
ALLOW_CREDENTIALS=True
ALLOW_METHODS=GET,POST,PUT,DELETE,OPTIONS,PATCH,HEAD  # Comma separated
ALLOW_HEADERS=*  # Comma separated, allow all for now. Will set this per API
HTTPS_ONLY=True
COOKIE_DOMAIN=localhost # should match your origin host name

# Application Config
PORT=8443
THREADS=4
DEV_RELOAD=False # Helpful when running in console for debug
SSL_CERTFILE=./certs/localhost.crt # Update to your cert path if using HTTPS_ONlY
SSL_KEYFILE=./certs/localhost.key # Update to your key path if using HTTPS_ONlY
PID_FILE=pygate.pid

Start pygate background process

  python pygate.py start

Stop pygate background process

  python pygate.py stop

Run pygate console instance

  python pygate.py run

License Information

The contents of this repository are property of pygate.org.

Review the Apache License 2.0 for valid authorization of use.

View License - Apache-2.0

Disclaimer

This project is under active development and is not yet ready for production environments.

Use at your own risk. By using this software, you agree to the Apache 2.0 License and any annotations found in the source code.

We welcome contributors and testers!