Hekate is a Laravel-based API Gateway designed for dynamic route management, authentication, and authorization. It is tailored for microservice architectures, providing seamless integration and high performance through Laravel Octane and Redis.
- Dynamic Routing: Configure routes via the database, allowing for real-time updates without redeployment.
- Authentication & Authorization: Powered by Laravel Sanctum, enabling secure token-based authentication and fine-grained access control.
- High Performance: Built with Laravel Octane and Redis for efficient request handling and low latency.
- Containerized Deployment: Includes Docker support for consistent and straightforward deployment.
- Extensibility: Easily customizable to fit specific project needs.
- PHP >= 8.1
- Composer
- Docker & Docker Compose (optional, for containerized deployment)
- Redis
-
Clone the repository:
git clone https://github.com/dreadkopp/hekate.git cd hekate
-
Install dependencies:
composer install npm install
-
Configure environment variables: Create a new
.env
file in the project root and configure it as needed. Refer to theconfig
directory or Laravel documentation for required settings.touch .env
-
Generate application key:
php artisan key:generate
-
Run migrations:
php artisan migrate
-
Start the application:
- Locally:
php artisan serve
- With Docker:
docker-compose up -d
- Locally:
Routes are managed in the database. Use the following command to show routes:
php artisan route:list
Extend the rounting using Tinker
php artisan tinker
Inside Tinker:
$routing = new App\Models\Routing();
$routing->path = '/foo';
$routing->endpoint = 'https://api.foo.example';
$rourting->save();
The API gateway uses Laravel Sanctum for authentication. To issue tokens:
php artisan tinker
Inside Tinker:
$user = App\Models\User::find(1);
$token = $user->createToken('API Token', ['/foo/*'])->plainTextToken;
Use the generated token in API requests:
Authorization: Bearer <token>
Run the test suite with:
php artisan test
app
: Core application logic (controllers, models, middleware, etc.).routes
: Route definitions (e.g., API routes).config
: Application configuration files.public
: Public-facing assets and entry points.tests
: Automated test cases.Dockerfile
&docker-compose.yml
: Configuration for containerized deployment.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add your feature"
- Push to the branch:
git push origin feature/your-feature
- Open a pull request.
Hekate is open-source software licensed under the MIT license.
For any questions or issues, please open an issue on the GitHub repository.