afto/microservice

A microservice project for PHP

v1.0.0 2025-03-13 16:29 UTC

This package is auto-updated.

Last update: 2025-03-14 11:35:38 UTC


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:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Make your changes
  4. Commit your changes (git commit -am 'Add a new feature')
  5. Push to the branch (git push origin feature/your-feature)
  6. 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