API-Platform Template is a project template designed to streamline the development of REST APIs using API Platform. This template includes various tools and dependencies to help you create robust APIs efficiently.
Before you begin, make sure you have the following prerequisites:
- Docker (for local development)
- Docker compose (for local development)
- Taskfile.dev
- Traefik (https://doc.traefik.io/traefik)
Follow these steps to set up your development environment:
-
Clone this Repository:
git clone https://github.com/adnanjaw/api-platform.git cd api-platform
-
Start Docker Containers and Initialize the Application:
task up
This command will:
- Start Docker containers.
- Install application dependencies using Composer.
- Run database migrations.
-
Initialize GrumPHP:
task grum:init
This command will initialize GrumPHP, which runs code quality checks on every commit.
This template includes a Taskfile that simplifies common development tasks. You can run these tasks using the task
command:
-
Check Code Style:
task phpcs
-
Fix Code Style Issues:
task phpcs:fix
-
Lint Twig Templates:
task twigcs
-
Fix Twig Template Issues:
task twigcs:fix
-
Run PHPStan for Static Analysis:
task phpstan
-
Update PHPStan Baseline:
task phpstan:baseline
-
Run PHPUnit Tests:
task phpunit
-
Generate PHPUnit Configuration:
task phpunit:config
This template provides a starting point for your API development. Customize it to suit your specific project requirements. You can create API resources and configure endpoints using API Platform documentation.
If you'd like to contribute to this project, please follow the standard GitHub fork-and-pull-request workflow.
This template is open-source and available under the MIT License.
We would like to express our gratitude to the following individuals for their invaluable contributions, support:
- ToshY for providing the main building block in ToshY/symfony-docker