Skip to content

Mavdii/GetPilot

Repository files navigation

GatePilot

πŸ›‘οΈ GatePilot

Enterprise-Grade API Gateway & Developer Portal

A self-hostable, production-ready API Gateway solution for managing, securing, and monitoring your APIs at scale.

Features β€’ Tech Stack β€’ Quick Start β€’ API Reference β€’ Architecture β€’ Developer

TypeScript React Node.js PostgreSQL Tailwind CSS Supabase


πŸ“‹ Overview

GatePilot is a comprehensive API management platform designed for developers and organizations who need complete control over their API infrastructure. Built with modern technologies and security best practices, GatePilot provides everything you need to manage API access, enforce rate limits, and monitor usage.

Why GatePilot?

  • Self-Hostable: Full control over your data and infrastructure
  • Enterprise Security: SHA-256 hashed API keys, audit logging, and role-based access
  • Real-time Analytics: Monitor API usage, latency, and error rates
  • Developer-Friendly: Clean UI, comprehensive documentation, and OpenAPI support

✨ Features

🏒 Organizations & Multi-tenancy

  • Create and manage multiple organizations
  • Invite team members with role-based permissions (Owner, Admin, Member, Viewer)
  • Isolated projects per organization

πŸ“¦ Project Management

  • Create unlimited API projects
  • Configure routes, keys, and rate limits per project
  • Enable/disable projects instantly

πŸ”€ API Routes

  • Define proxy routes to upstream services
  • Path prefix matching with HTTP method filtering
  • Scope-based access control per route

πŸ” Secure API Keys

  • SHA-256 hashed key storage (keys never stored in plaintext)
  • Unique key prefixes for identification (gp_xxxxxxx)
  • Scope-based permissions
  • Key expiration and revocation

⚑ Rate Limiting

  • Per-key requests per minute (RPM) limits
  • Per-IP rate limiting
  • Daily quota enforcement
  • Configurable rate limit policies

πŸ“Š Request Logging & Analytics

  • Complete request history with metadata
  • Latency tracking and status code monitoring
  • Visual analytics dashboard with charts:
    • Requests over time
    • Endpoint distribution
    • Latency percentiles
    • Error rate tracking

πŸ“– OpenAPI Documentation

  • Upload and host OpenAPI/Swagger specifications
  • Auto-generated API documentation
  • Version management

πŸ“ Audit Logging

  • Complete trail of administrative actions
  • Compliance-ready logging
  • Filter by action, resource, and time

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui
Backend Express.js, TypeScript, Node.js
Database PostgreSQL with Drizzle ORM
Authentication Supabase Auth (Email/Password)
Charts Recharts
State Management TanStack Query
Routing Wouter

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • Supabase account (for authentication)

Installation

  1. Clone the repository
git clone https://github.com/Mavdii/GetPilot.git
cd GetPilot
  1. Install dependencies
npm install
  1. Configure environment variables
cp .env.example .env
# Edit .env with your credentials
  1. Set up the database
# Run migrations
npm run db:push

# Or use SQL files
psql -d your_database -f migrations/000_run_all.sql
  1. Start the development server
npm run dev

The application will be available at http://localhost:5000


πŸ”§ Environment Variables

Variable Description
DATABASE_URL PostgreSQL connection string
SESSION_SECRET Secret key for session encryption
SUPABASE_URL Supabase project URL
SUPABASE_ANON_KEY Supabase anonymous key
SUPABASE_SERVICE_ROLE_KEY Supabase service role key

See .env.example for a complete list.


πŸ“ Project Structure

gatepilot/
β”œβ”€β”€ client/                     # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”‚   └── ui/             # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/                # Utilities and query client
β”‚   β”‚   └── pages/              # Page components
β”‚   └── index.html
β”œβ”€β”€ server/                     # Backend Express application
β”‚   β”œβ”€β”€ routes.ts               # API route handlers
β”‚   β”œβ”€β”€ storage.ts              # Database storage layer
β”‚   β”œβ”€β”€ supabase-auth.ts        # Authentication logic
β”‚   └── index.ts                # Server entry point
β”œβ”€β”€ shared/                     # Shared types and schemas
β”‚   β”œβ”€β”€ tables/                 # Database table definitions
β”‚   β”‚   β”œβ”€β”€ users.ts
β”‚   β”‚   β”œβ”€β”€ organizations.ts
β”‚   β”‚   β”œβ”€β”€ projects.ts
β”‚   β”‚   β”œβ”€β”€ api-keys.ts
β”‚   β”‚   β”œβ”€β”€ rate-limits.ts
β”‚   β”‚   β”œβ”€β”€ request-logs.ts
β”‚   β”‚   β”œβ”€β”€ openapi-specs.ts
β”‚   β”‚   └── audit-logs.ts
β”‚   └── schema.ts               # Combined schema exports
β”œβ”€β”€ migrations/                 # SQL migration files
β”‚   β”œβ”€β”€ 001_create_sessions.sql
β”‚   β”œβ”€β”€ 002_create_users.sql
β”‚   └── ...
└── drizzle.config.ts           # Drizzle ORM configuration

πŸ”Œ API Reference

Gateway Usage

Proxy requests through the gateway:

POST /gateway/{projectId}/your/api/path
Headers:
  x-api-key: gp_your_api_key_here
  Content-Type: application/json

Authentication Endpoints

Method Endpoint Description
POST /api/auth/signup Register new user
POST /api/auth/login Login with credentials
POST /api/auth/logout Logout current user
GET /api/auth/user Get current user info

Organization Endpoints

Method Endpoint Description
GET /api/orgs List user's organizations
GET /api/orgs/:slug Get organization details
POST /api/orgs Create new organization

Project Endpoints

Method Endpoint Description
GET /api/projects/:id Get project with routes
POST /api/orgs/:slug/projects Create new project
PATCH /api/projects/:id Update project
DELETE /api/projects/:id Delete project

API Key Endpoints

Method Endpoint Description
GET /api/projects/:projectId/keys List API keys
POST /api/projects/:projectId/keys Generate new API key
POST /api/keys/:id/revoke Revoke API key

πŸ”’ Security Features

API Key Security

  • Keys are hashed with SHA-256 before storage
  • Only the key prefix (first 11 characters) is stored for display
  • Full key is shown only once at creation time

Session Security

  • HTTP-only cookies
  • Secure flag in production
  • Session expiration (7 days default)

Audit Trail

  • All sensitive operations are logged
  • Actor, action, resource, and timestamp recorded
  • Compliance-ready audit logs

πŸ“ˆ Analytics Dashboard

GatePilot provides comprehensive analytics including:

  • Requests Over Time: Line chart showing API traffic trends
  • Status Code Distribution: Pie chart of response codes (2xx, 4xx, 5xx)
  • Endpoint Popularity: Bar chart of most-used endpoints
  • Latency Percentiles: P50, P95, P99 latency metrics
  • Error Rate Tracking: Monitor API health in real-time

πŸ—„οΈ Database Schema

The database consists of 11 tables organized for optimal performance:

Table Description
users User accounts
sessions Session storage
orgs Organizations
memberships User-org relationships
projects API projects
routes Proxy route configurations
api_clients Registered API consumers
api_keys Hashed API keys
rate_limit_policies Rate limiting configs
request_logs API request history
openapi_specs OpenAPI specifications
audit_logs Administrative action log

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘¨β€πŸ’» Developer

Developer

Platform Contact
πŸ‘€ Name Umar
πŸ™ GitHub @Mavdii
πŸ“§ Email omarelmhdi@gmail.com
πŸ“± Telegram @dev_umar
πŸ’¬ WhatsApp 01550875414

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ by Umar

GitHub Stars

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages