gemvc / library
core library of gemvc
Requires
- firebase/php-jwt: ^6.8
- phpmailer/phpmailer: ^6.8
- symfony/dotenv: ^7.2
Requires (Dev)
- phpstan/phpstan: ^2.1
- dev-main
- 4.0.71
- 4.0.70
- 4.0.69
- 4.0.68
- 4.0.67
- 4.0.66
- 4.0.65
- 4.0.64
- 4.0.63
- 4.0.62
- 4.0.61
- 4.0.60
- 4.0.59
- 4.0.58
- 4.0.57
- 4.0.56
- 4.0.55
- 4.0.54
- 4.0.53
- 4.0.52
- 4.0.51
- 4.0.50
- 4.0.49
- 4.0.48
- 4.0.47
- 4.0.46
- 4.0.45
- 4.0.44
- 4.0.43
- 4.0.42
- 4.0.41
- 4.0.40
- 4.0.39
- 4.0.38
- 4.0.37
- 4.0.36
- 4.0.35
- 4.0.34
- 4.0.33
- 4.0.32
- 4.0.31
- 4.0.30
- 4.0.29
- 4.0.28
- 4.0.27
- 4.0.26
- 4.0.25
- 4.0.24
- 4.0.23
- 4.0.22
- 4.0.21
- 4.0.20
- 4.0.19
- 4.0.18
- 4.0.17
- 4.0.16
- 4.0.15
- 4.0.14
- 4.0.13
- 4.0.12
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- v3.28.2
- v3.28.1
- v3.28.0
- v3.27.8
- v3.27.7
- v3.27.6
- v3.27.5
- v3.27.4
- v3.27.3
- 3.27.2
- v3.27.1
- v3.27.0
- v3.26.8
- v3.26.7
- v3.26.5
- v3.26.4
- v3.26.3
- v3.26.2
- v3.26.1
- v3.26
- v3.25
- v3.24
- v3.23
- v3.22
- v3.21
- v3.20
- v3.19
- v3.18
- v3.17
- v3.16
- v3.15
- v3.14
- v3.13
- v3.12
- v3.11.3
- v3.11.2
- v3.11.1
- v3.11.0
- v3.10.2
- v3.10.1
- v3.10.0
- v3.9.0
- v3.8.0
- v3.7.0
- v3.6.6
- v3.6.5
- v3.6.4
- v3.6.3
- v3.6.2
- v3.6.1
- v3.6.0
- v3.5.0
- v3.4.5
- v3.3.4
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.0
- v3.1.12
- v3.1.11
- v3.1.10
- v3.1.9
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v2.8.6
- v2.8.5
- v2.8.4
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.13
- v2.3.12
- v2.3.11
- v2.3.10
- v2.3.9
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.4
- v2.2.3
- v2.2.0
- v2.1.1
- v2.0.6
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- 1.5.2
- v1.5.1
- v1.5.0
- V1.4.0
- V1.3.1
- V1.3.0
- V1.2.0
- V1.1.0
- V1.0.0.5
- V1.0.0
- dev-db
- dev-post
- dev-dev
This package is auto-updated.
Last update: 2025-07-04 20:56:27 UTC
README
Transform your PHP development with GEMVC - a modern PHP framework where security meets simplicity! Build professional, secure APIs in minutes, not hours.
📋 Table of Contents
🔥 Installation
composer require gemvc/library
Initialize Your Project
# Initialize a new GEMVC project
vendor/bin/gemvc init
This will:
- Create the necessary directory structure
- Generate a sample
.env
file - Set up local command wrappers
🔄 Quick Start
1. Development Environment Setup
GEMVC comes with a complete Docker development environment that includes:
- PHP server (Apache or OpenSwoole)
- MySQL 8.0 database
- PHPMyAdmin for easy database management
To start the development environment:
# Start all services
docker-compose up --build
This will start:
- Web server on port 9501 for swoole or 80 for apache depends on init selected option
- MySQL database on port 3306
- PHPMyAdmin on port 8080
- Redis
Database Access
- PHPMyAdmin: http://localhost:8080
- Username:
root
- Password:
rootpassword
- Username:
- MySQL Direct Access:
- Host:
localhost
- Port:
3306
- Username:
root
- Password:
rootpassword
- Host:
2. Basic Configuration
Create an .env
file in your app directory:
# Database Configuration DB_HOST=localhost DB_PORT=3306 DB_NAME=your_db DB_USER=root DB_PASSWORD='yourPassword' # Security Settings TOKEN_SECRET='your_secret' TOKEN_ISSUER='your_api'
3. Create Your First API
namespace App\Api; use Gemvc\Core\ApiService; use Gemvc\Http\Request; use Gemvc\Http\JsonResponse; use Gemvc\Core\RedisManager; class User extends ApiService { public function __construct(Request $request) { parent::__construct($request); } public function getUsers():JsonResponse { if(!$this->request->auth(['admin'])) { return $this->request->returnResponse(); } $redis = new RedisManager::getInstance(); $redis_key = md5($this->request->requestedUrl); $response = $redis->getJsonResponse($redis_key); if(!$response) { $response = (new UserController($this->request))->list(); //cach for 10 minutes 600 seconds $redis->setJsonResponse($redis_key,$response,time()+600); return $response; } return $response; } }
4. Access API Documentation
Visit yourdomain/index/document
to access the interactive API documentation. The documentation is automatically generated from your API service classes and includes:
- Endpoint details
- Request/response examples
- Parameter documentation
- Postman collection export
🎯 Core Features
- Modern Architecture: Type-safe, modular design with clean structure
- Swoole Ready: Seamlessly switch between OpenSwoole and Apache servers - your code works identically on both without any modifications
- Dual Server Support: Works with both Apache and OpenSwoole
- Security First: Built-in JWT authentication, input sanitization, and protection
- Database Abstraction: Type-safe queries, ORM capabilities, and table generation
- Real-time Ready: WebSocket support with Redis scaling
- Developer Experience: CLI tools, code generation, and comprehensive documentation
- Database Connection Pooling: Optimized connection management for maximum performance and resource efficiency
- Built-in ORM: Powerful query builder and ORM with intuitive CRUD operations
- Built-in Redis Support: Seamless Redis integration for caching and real-time features
- Auto Documentation: Interactive API documentation with Postman export
- AI Ready: Built-in APIs and interfaces optimized for AI assistant integration and automation
📚 Documentation
For a comprehensive overview of all components, features, and architecture, please refer to our Documentation.md
📋 Requirements
- PHP 8.0+
- PDO Extension
- OpenSSL Extension
- GD Library
- OpenSwoole Extension (optional)
- Redis Extension (optional)
- Docker and Docker Compose (for development environment)
About
Author: Ali Khorsandfard ali.khorsandfard@gmail.com
GitHub: secure73/gemvc
License: MIT
Made with ❤️ for developers who love clean, secure, and efficient code.