This is a REST API built using Symfony famework, providing various endpoints to interact
with a system (e.g., users, fames places, etc.). This API is secured using X-Auth-Token
I developed this API by following the Create a REST API with Symfony 3 tutorial by Zest du Savoir, to learn the essential principles of REST. Then, I upgraded it to Symfony 4 and later to Symfony 6 by following the Upgrading to Symfony 6.0 tutorial by Symfony Cast.
This guide will walk you through setting up the project, running the server, and testing the API.
Before you begin, ensure you have the following installed:
- PHP (8.1 or higher)
- Composer
- Symfony CLI (optional but recommended)
- Database (MySQL, etc., depending on your setup)
-
Clone the repository:
git clone https://github.com/rhidja/symfony-rest-api.git cd symfony-rest-api -
Then run the following
makecommand to install the application
make initThis command will:
- Run
composer install. - Drop the old database if it exists.
- Create a new database.
- Run migrations.
- Run fixtures
- And start the Symfony local server. https://127.0.0.1:8000
- A
Postmancollection is included to test different endpoints of the api.
./docs/postman_collection.json // Contain a collection of endpoints.
./docs/postman_environnement.json // The environment variables.
To see different endpoints of the api https://127.0.0.1:8000/api/doc