Skip to content

thiarley/kongy

Repository files navigation

Kongy 🦍

Kong Gateway Manager - Open source visual interface for managing routes, services, plugins, and consumers in Kong Gateway.

License: MIT Python 3.11+ TypeScript Vite Kong

Note

Leia em PortuguΓͺs: README.pt-BR.md


✨ Features

  • πŸ” Self-contained Authentication - JWT with initial setup, no external service dependencies
  • 🌍 Internationalization - Support for Portuguese (BR) and English (US) with automatic detection
  • πŸ›‘οΈ Security - Rate limiting, security headers, brute-force protection
  • πŸ“¦ Docker Ready - Ready for deployment with Docker Compose
  • πŸ§ͺ Kong Local - Development environment with integrated Kong
  • πŸ”Œ Plugin Management - Apply plugins to routes, services, and consumers
  • πŸ“€ Import/Export - Export and import route configurations
  • ⚑ Vite + TypeScript - Modern frontend with Hot Module Replacement

πŸ“Έ Screenshots

Initial Setup Services View Routes View Plugin Management


πŸš€ Quick Start

Using Docker (Recommended)

# Clone the repository
git clone https://github.com/your-username/kongy.git
cd kongy

# Copy the environment file
cp .env.example .env

# Start all services (Kong + Kongy)
docker compose up -d

# Access http://localhost:8081

If port 8081 is already in use, set another frontend port:

FRONTEND_PORT=8082 docker compose up -d
# Access http://localhost:8082

On first access, you will be redirected to create the administrator user.

Local Development

# Backend
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

# Frontend (in another terminal)
cd frontend
npm install
npm run dev

The frontend will be available at http://localhost:8081 with HMR.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Kongy Container                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Frontend (Vite)   │───▢│  Backend (FastAPI)         β”‚  β”‚
β”‚  β”‚   :8081             β”‚    β”‚  :8000                     β”‚  β”‚
β”‚  β”‚   TypeScript/HTML   β”‚    β”‚  - Auth (JWT)              β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  - Kong Proxy              β”‚  β”‚
β”‚                              β”‚  - Rate Limiting           β”‚  β”‚
β”‚                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                         β”‚                    β”‚
β”‚                                         β–Ό                    β”‚
β”‚                               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚                               β”‚   Kong Admin API    β”‚       β”‚
β”‚                               β”‚   :8001 (internal)  β”‚       β”‚
β”‚                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

kongy/
β”œβ”€β”€ backend/              # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ auth/         # JWT authentication
β”‚   β”‚   β”œβ”€β”€ kong/         # Kong Admin API proxy
β”‚   β”‚   β”œβ”€β”€ storage/      # In-memory storage
β”‚   β”‚   └── middleware/   # Security, rate limiting
β”‚   └── tests/            # Pytest tests
β”œβ”€β”€ frontend/             # Vite + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ services/     # API, Auth, i18n
β”‚   β”‚   β”œβ”€β”€ types/        # TypeScript interfaces
β”‚   β”‚   β”œβ”€β”€ utils/        # Helpers, constants
β”‚   β”‚   β”œβ”€β”€ app.ts        # Main application
β”‚   β”‚   β”œβ”€β”€ ui.ts         # UI rendering
β”‚   β”‚   └── store.ts      # State management
β”‚   β”œβ”€β”€ locales/          # Translations
β”‚   └── vite.config.ts    # Vite configuration
β”œβ”€β”€ docker-compose.yml    # Dev environment (with Kong)
β”œβ”€β”€ docker-compose.prod.yml # Production (external Kong)
└── .env.example          # Environment template

βš™οΈ Configuration

Variable Description Default
SECRET_KEY JWT signing key change-me...
KONG_ADMIN_URL Kong Admin API URL http://kong:8001
DEBUG Enable debug mode false
JWT_EXPIRE_MINUTES Token expiration 60
CORS_ORIGINS Allowed CORS origins ["http://localhost:8081"]

See .env.example for all options.

KONG_ADMIN_URL is the initial Kong Admin API URL on each application startup. If initial setup provides a different URL, that override only lives in memory until the next restart.


πŸ”’ Security

⚠️ Important: Data is stored in memory and lost upon restart. Configure the admin user at every startup.

  • JWT Authentication
  • Rate Limiting (configurable)
  • Brute-force protection
  • Security Headers (CSP, X-Frame-Options, etc.)
  • Non-root containers

πŸ§ͺ Testing

# Backend
cd backend
pip install -r requirements-dev.txt
pytest --cov=app

# Frontend Build
cd frontend
npm run build

On the routes screen, the actions bar includes a button to download a routes-import-example.json file with a valid import example.

The import flow now shows a summary before execution and a result modal afterwards with successes and failures per route/plugin. Route import always uses the currently selected service in the UI, and exported route JSON does not include service.id.


🐳 Docker Production

Build and Deploy

# Production Build
docker compose -f docker-compose.prod.yml build

# Deploy
docker compose -f docker-compose.prod.yml up -d

For container registry publishing, the frontend Dockerfile now builds the production Nginx image by default:

docker build \
  --provenance=false \
  --build-arg NPM_REGISTRY=https://nexus.example/repository/npm-group/ \
  -t kongy-frontend:1.0.0 \
  frontend

Use --target dev only when you explicitly want the Vite development image.

Kubernetes

Deployment example available in k8s/ (coming soon).


🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md.


πŸ“„ License

MIT License - see LICENSE.


Made with ❀️ by the community

About

A Web Interface to configure Services and Routes in Kong API Gateway

Topics

Resources

License

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors