This is a RESTful API built with Symfony 7 and API Platform to manage events, attendees, and bookings.
- Create, update, delete, and list events
- Register and manage attendees
- Book events with attendee registration
- Prevent duplicate and overbooked bookings
- Designed with clean architecture, validation, and error handling
- Ready for future authentication/authorization integration
-
Event
id,name,capacity,date,country
-
Attendee
id,name,email
-
Booking
id,bookedAt,event(relation),attendee(relation)
Authentication is not implemented but designed for future integration.
- Use JWT (JSON Web Tokens)
- Secure event/attendee management endpoints
- Allow public access to booking endpoints
| Role | Permissions |
|---|---|
Admin/User |
Create, update, delete, and list events and attendees (requires authentication) |
Attendee |
Can book events anonymously (no authentication required) |
access_control:
- { path: ^/api/bookings, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api, roles: ROLE_USER }This application supports Docker for easy setup and deployment. Follow the steps below to get started:
- Clone the repository:
git clone <your-repo-url>
cd event-booking-api- Build the Docker containers:
docker compose build --no-cache- Start the containers:
docker compose up --wait- Run the database migrations:
docker compose exec php bin/console doctrine:migrations:migrateAuto-generated and available at:
/docs
Includes OpenAPI support with custom request examples.
To run all the unit tests together, use the following command:
docker compose exec php bin/phpunitThis will execute all the test cases, including unit and integration tests, for the application.
- Symfony 7
- API Platform
- Doctrine ORM
- PHP 8.2+
- PHPUnit
- Docker
- Custom OpenAPI examples for better developer experience
- Booking validator to enforce event capacity and prevent duplicate bookings
For any questions or suggestions, feel free to open an issue or contact the maintainer.