This is a simple API built to manage locations using Laravel.
- Docker
- Docker Compose
-
Clone this repository:
git clone https://github.com/ArturRA/location-crud
-
Navigate to the project directory:
cd location-crud
-
Start the Docker containers:
docker-compose up -d
-
Wait for the laravelapp container to finish running
composer install
(you can monitor the progress in the container logs):docker-compose logs -f laravelapp
-
Run database migrations to create the locations table:
docker exec -it laravelapp sh -c "php artisan migrate"
To check and ensure everything is set up correctly you can run the provided automated tests(that are inside the Locationtest.php
file) with the following command:
docker exec -it laravelapp sh -c "php artisan test"
To facilitate testing you can import the provided Backend challenge location crud api.postman_collection.json
file into Postman to access all API endpoints and examples on how to use them.
- POST /api/locations: Create a new location.
- GET /api/locations/{id}: Retrieve a specific location by its ID.
- GET /api/locations: List all locations or filter them by name.
- PUT /api/locations/{id}: Update a location.