afto / microservice
A microservice project for PHP
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- guzzlehttp/guzzle: ^7.9
- mouf/nodejs-installer: ^1.0
- nikic/fast-route: ^1.3
- nyholm/psr7: ^1.8
- openai-php/client: ^0.10.3
- phpredis/phpredis: ^6.1
- predis/predis: ^2.3
- symfony/http-client: ^7.2
- twig/twig: ^3.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- phpunit/phpunit: ^12.0
- vimeo/psalm: ^6.5
README
Afto is an optimized solution for PHP developers supporting the PSR-4 autoloading standard. It is designed for easy integration, microservice architecture, and optimized performance. This project provides a solid foundation for PHP developers to create scalable and maintainable applications.
Features
- Supports PSR-4 autoloading standard, making it easy to organize classes into namespaces and directories.
- Microservice-based architecture for scalable application development.
- Easy integration with Docker for containerized deployments.
- Optimized and well-tested performance for production use.
Installation
1. Create a New Project
To create a new project, run the following command:
composer create-project afto/microservice
This will create a new project using the afto/microservice
template.
2. Install Dependencies
Once the project is created, navigate into the project directory and install the necessary dependencies using Composer:
composer install
3. Start the PHP Built-in Server
Once the dependencies are installed, you can start the PHP built-in server for testing purposes:
php -S localhost:8000
4. Run Docker
To run the application inside Docker, use the following command to build and start the Docker container in detached mode:
docker-compose up --build -d
This will build the Docker container and run it in the background.
5. PHPUnit Testing
To run the PHPUnit tests and check the functionality of your code, navigate to the core
directory and use the following command:
cd core ../vendor/bin/phpunit
6. Remove Docker
To clean up your Docker environment and remove all stopped containers, unused networks, and volumes, use the following command:
docker system prune -a --volumes
This will remove unused Docker resources and free up disk space.
7. Run psalm.dev
To check the code quality and find potential issues, run Psalm, a static analysis tool for PHP:
vendor/bin/psalm
This will analyze your code and provide suggestions to improve it.
GitHub Repository
Visit the Afto GitHub Repository for more details, issues, pull requests, and contributions.
Repository Statistics
- Stars:
{{stargazers_count}}
- Forks:
{{forks_count}}
- Open Issues:
{{open_issues_count}}
Contributing
We welcome contributions to Afto. If you would like to improve or report bugs in the project, please open an issue or submit a pull request on GitHub.
To contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Make your changes
- Commit your changes (
git commit -am 'Add a new feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a new pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Crafted with ❤️ by Seyed Mohammad Hosseini