Understanding the API Platform Project Structure
Understanding the API Platform Project Structure
~12 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026
Under the hood, aufgaben-manager-api is a COMPLETELY NORMAL Symfony project (EXACTLY the structure from chapter 3 of the Symfony course) – API Platform just adds a few extra directories and bundles.
The project structure at a glance
The structure right after installation
aufgaben-manager-api/ ├── api/ ← the actual Symfony/API Platform project │ ├── bin/console │ ├── config/ │ │ └── packages/ │ │ └── api_platform.yaml ← API-Platform-specific configuration │ ├── migrations/ │ ├── public/ │ ├── src/ │ │ ├── ApiResource/ ← optional: resources without a dedicated Doctrine entity │ │ ├── Controller/ │ │ ├── Entity/ ← our ApiResource entities live HERE (chapter 9+) │ │ └── Repository/ │ └── tests/ ├── docker/ ← Dockerfiles for the individual containers └── compose.yaml ← defines ALL containers (php, database, mercure, ...)
The DECISIVE difference from the Symfony course: the actual Symfony project lives in an api/ SUBDIRECTORY, not directly in the project root – the root is instead reserved for Docker/infrastructure configuration coordinating MULTIPLE services (currently only the API server, from chapter 7 on also the separate React project ALONGSIDE it, not inside it).
config/packages/api_platform.yaml: the core configuration
api_platform:
title: Task Manager API
version: 1.0.0
formats:
json: ['application/json']
jsonld: ['application/ld+json']
docs_formats:
json: ['application/json']
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']title/version appear LATER in the automatically generated Swagger UI documentation (chapter 6). formats defines WHICH response formats the API supports – jsonld (JSON-LD, with additional semantic metadata) is API Platform's DEFAULT format, json a simpler format, usually sufficient for our React frontend.
src/Entity/: the central place for API resources
EXACTLY as in the Symfony course, Doctrine entities live under src/Entity/ – the difference from chapter 9 on: the same classes ADDITIONALLY carry the #[ApiResource] attribute, which turns them AUTOMATICALLY into API endpoints, WITHOUT writing a custom controller.
The bundled Makefile
build:
docker compose build --pull --no-cache
up: ## Start all containers
docker compose up -d --wait
down: ## Stop all containers
docker compose down --remove-orphansmake up
make downTipp: The distribution already ships with a Makefile of common shortcuts – make up/make down instead of the more verbose docker compose commands. This course keeps spelling out the full docker compose commands, so what's happening stays EXACTLY traceable even without make.