Create CRUD applications powered by API Platform with ease. It exposes a description in the OpenAPI format and integrates a by api-platfrom customized version of Swagger UI.
The official project documentation is available on the API Platform website.
Read the official "Getting Started" guide.
docker compose build --no-cachedocker compose updocker compose logs -fTo run multiple instances of this project on the same host, you need to configure different ports for each instance to avoid port conflicts. The application uses the following environment variables to configure ports:
HTTP_PORT: The HTTP port (default: 80)HTTPS_PORT: The HTTPS port (default: 443)HTTP3_PORT: The HTTP/3 port (default: 443)
Example of running a second instance on different ports:
# First instance (default ports)
docker compose up -d
# Second instance (custom ports)
HTTP_PORT=50000 HTTPS_PORT=50001 HTTP3_PORT=50002 DATABASE_PORT=50003 docker compose up -dYou can also create a .env file for each instance with different port configurations.
Using symfony maker bundle, you can create new entities.
# execute in /api directory
bin/console make:entity --api-resourceTo generate new Entities using structured data (currently yaml or json), you can use the implemented app:entity-from-json maker command:
# provide path to a JSON or YAML file
php bin/console app:entity-from-json --file=../path/to/datefile
# or provide JSON data directly
php bin/console app:entity-from-json --data='{...}'Since the automatic initialization of the database isn't implemented yet due to time crunch you need to:
cd crudle_instances/{id}/api # the commands below need to be executed in the symfony directory of the crudle instance
symfony console doctrine:migrations:diff
symfony console doctrine:migrations:migrateHere are two examples of structured data files you can use:
{
"name": "Book",
"apiResource": true,
"fields": [
{
"name": "title",
"type": "string",
"nullable": false
},
{
"name": "publishedAt",
"type": "datetime_immutable",
"nullable": true
},
{
"name": "isbn",
"type": "string",
"nullable": true
},
{
"name": "pages",
"type": "integer",
"nullable": true
}
]
}name: Article
apiResource: true
fields:
- name: title
type: string
nullable: false
- name: author
type: string
nullable: false
- name: publishedAt
type: datetime_immutable
nullable: true
- name: content
type: text
nullable: true
- name: views
type: integer
nullable: falseYannick Fenz'l, Kévin Dunglas, and contributors.
