This project provides a simple RESTful API for managing products and categories.
- PHP 8.0 or higher
- MySQL
- Docker(Optional)
To run this project, you will need to have Docker installed on your system. Once Docker is installed, you can follow these steps to set up the project:
- Clone the repository to your local machine.
git clone https://github.com/your-username/your-repo.git
- Navigate to the project directory.
cd your-repo
- Build the Docker containers.
docker-compose build
- Start the containers.
docker-compose up -d
In this repo you will find both the db and the apche server (Dockerfile)
Here is a brief summary of the available endpoints:
- GET /api/products: Returns a list of all products.
- GET /api/products/{id}: Returns a specific product by ID.
- GET /api/products/category/{category}: Returns a list of products in a specific category.
- POST /api/products: Creates a new product.
- PATCH /api/products/{id}: Updates a specific product by ID.
- DELETE /api/products/{id}: Deletes a specific product by ID.
- GET /api/categories: Returns a list of all categories.
- GET /api/categories/{id}: Returns a specific category by ID.