Download the PHP package ahmedessam/microservice-installer without Composer
On this page you can find all versions of the php package ahmedessam/microservice-installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ahmedessam/microservice-installer
More information about ahmedessam/microservice-installer
Files in ahmedessam/microservice-installer
Package microservice-installer
Short Description An advanced CLI tool to create and manage Laravel microservices from a template repository
License MIT
Homepage https://github.com/aahmedessam30/microservice-installer
Informations about the package microservice-installer
Laravel Microservice Installer
An advanced, professional CLI tool to create Laravel microservices from the laravel-microservice-template repository.
Similar to Laravel/Symfony CLI with interactive wizards, dry-run mode, system diagnostics, and service management features.
Features
Core Features (V1)
- ✅ PSR-4 Compliant - Clean, professional code structure
- ✅ Single Command - Create a complete microservice instantly
- ✅ Automatic Configuration - Updates all service-specific files
- ✅ Docker Ready - Configures docker-compose.yml with unique ports
- ✅ JWT Keys - Generates RSA key pairs automatically
- ✅ No Temp Folders - Creates services in your current directory
- ✅ Clean Architecture - Small, focused classes with single responsibilities
Advanced Features (V2)
- ✨ Interactive Mode - Smart wizard when service name is omitted
- ✨ Verbose Mode - Detailed output with
-vflag - ✨ Dry Run - Preview changes before creating files
- ✨ Auto Port Detection - Automatically finds available ports
- ✨ User Config - Personal preferences in
~/.microservice-config - ✨ Doctor Command - System health checks and diagnostics
- ✨ List Services - View all services with status and ports
- ✨ Open Service - Quick access via VSCode or file explorer
- ✨ Update Command - Self-update the installer
- ✨ Version Tracking -
.service-versionfile for each service - ✨ Colorful UI - Enhanced console output with tables
Requirements
- PHP 8.2 or higher
- Composer
- Git
- Docker (optional, for running services)
- OpenSSL (for JWT key generation)
Installation
Global Installation (Recommended)
Install globally via Composer:
Make sure your global Composer bin directory is in your system's PATH:
Local Installation
Or install locally in your project:
Then use it with:
Usage
Quick Start
Interactive Mode
Omit the service name to enter interactive wizard:
Dry Run Mode
Preview all changes before creating files:
Output:
Available Commands
microservice new [name]
Create a new microservice.
Options:
-p, --port: Port number (default: 8100)-v, --verbose: Show detailed output--dry-run: Preview changes without creating files--auto-port: Auto-detect next available port--no-keys: Skip JWT key generation
Examples:
microservice doctor
Check system requirements and configuration.
Output shows:
- PHP version (>= 8.2)
- Required PHP extensions
- Composer, Git, Docker availability
- Docker daemon status
- OpenSSL availability
- Write permissions
- Template repository accessibility
microservice list
List all microservices in current directory.
Shows table with:
- Service name
- Port number
- Docker status (Running/Stopped)
- Full path
microservice open <service>
Open a service in VSCode or file explorer.
microservice update
Update the installer to the latest version.
Configuration File
Create ~/.microservice-config to customize defaults:
Complete Workflow Example
What Gets Configured
The installer automatically configures the following:
1. Service Identity
- Updates
config/service.phpwith service name and version - Sets
SERVICE_NAMEin.envand.env.example
2. Application Settings
- Updates
APP_NAMEin.env - Sets unique
APP_PORTfor the service - Updates
APP_URLwith the correct port
3. Database Configuration
- Creates unique database name:
{service-name}_db - Updates
DB_DATABASEin.env
4. Cache & Queue
- Sets unique
CACHE_PREFIXto prevent collisions - Configures Redis with service-specific prefixes
5. Docker Setup
- Updates all container names:
{service-name}-php,{service-name}-nginx, etc. - Configures unique port mapping
- Updates volume names for isolation
6. Composer Package
- Updates
composer.jsonname:ahmedessam/{service-name} - Sets appropriate description
7. JWT Keys
- Generates RSA key pair (2048-bit)
- Creates
keys/private.pemandkeys/public.pem - Adds
keys/to.gitignore
Service Naming Rules
Service names must:
- Contain only lowercase letters, numbers, and hyphens
- Not start or end with a hyphen
- Be descriptive and meaningful (e.g.,
auth-service,payment-gateway)
✅ Valid names:
auth-serviceuser-managementpayment-gatewaynotification-service
❌ Invalid names:
Auth-Service(uppercase)-auth-service(starts with hyphen)auth_service(underscores not allowed)auth service(spaces not allowed)
Port Management
Recommended port allocation strategy:
| Service | Port |
|---|---|
| Auth Service | 8000 |
| User Service | 8001 |
| Payment Service | 8002 |
| Order Service | 8003 |
| Notification Service | 8004 |
| ... | ... |
Or use incremental base (e.g., 8100, 8101, 8102...)
Architecture
The installer follows clean architecture principles:
Design Principles
- Single Responsibility: Each class has one focused purpose
- Dependency Injection: All dependencies injected via constructor
- Strict Typing: All parameters and returns are type-hinted
- PSR-4 Autoloading: Proper namespacing and autoloading
- Testable: Small, focused methods that are easy to test
Troubleshooting
"Failed to clone template repository"
Ensure you have:
- Git installed and in your PATH
- Internet connection
- Access to GitHub
"Failed to generate private key"
Ensure:
- OpenSSL extension is enabled in PHP
- You have write permissions in the current directory
"Port must be between 1024 and 65535"
Use a valid port number:
"Directory already exists"
The service directory already exists. Choose a different name or remove the existing directory:
Next Steps After Creation
-
Install Dependencies
-
Generate Application Key
-
Start Docker Containers
-
Run Migrations
-
Access API Documentation
- Check Health Endpoint
Template Repository
This installer uses the official template:
- Repository: aahmedessam30/laravel-microservice-template
- Features: Laravel 12, Clean Architecture, Docker, JWT Auth, OpenAPI
- Architecture: Action/DTO/Service/Repository pattern
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This installer is open-source software licensed under the MIT license.
Credits
- Author: Ahmed Essam
- Template: laravel-microservice-template
- Inspired by: Laravel Installer
Support
For issues, questions, or contributions:
- GitHub Issues: Create an issue
- Email: [email protected]
Made with ❤️ for Laravel Microservices
All versions of microservice-installer with dependencies
symfony/console Version ^6.0|^7.0
symfony/process Version ^6.0|^7.0
symfony/yaml Version ^6.0|^7.0