| .docker | ||
| bin | ||
| config | ||
| migrations | ||
| public | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .env | ||
| .env.dev | ||
| .env.test | ||
| .gitignore | ||
| compose.dev.yml | ||
| composer.json | ||
| composer.lock | ||
| Makefile | ||
| phpcs.xml.dist | ||
| phpunit.dist.xml | ||
| README.md | ||
| symfony.lock | ||
FOX Shop API
A RESTful API for managing products.
This project provides a foundation for a products management system via a REST API. It is set up to run in a Docker environment for easy development and deployment.
Table of Contents
Getting Started
Follow these instructions to get the project up and running on your local machine.
Prerequisites
Make sure you have the following software installed:
- Docker
- Docker Compose
make
Installation
-
Clone the repository
git clone <repository-url> cd fox-shop -
Configure your hosts file
Add the following line to your system's hosts file (
/etc/hostson macOS/Linux,C:\Windows\System32\drivers\etc\hostson Windows) to access the application locally via a custom domain.127.0.0.1 fox-shop.loc -
Build and run the application
This command will build the Docker images and start the services in detached mode.
make build -
Run database migrations
This command will create the necessary database tables.
make migrate
The application should now be running and accessible at http://fox-shop.loc.
API Documentation
The API is documented using OpenAPI (Swagger). You can access the interactive API documentation in your browser to see all available endpoints and test them.
- API Documentation: http://fox-shop.loc/api/docs
- OpenAPI Specification (YAML): http://fox-shop.loc/api/docs.yaml
Running Tests
To run the application's test suite, use the following command. It will set up the test database, run migrations, and then execute the PHPUnit tests.
make test
Available Makefile Commands
This project uses a Makefile to simplify common development tasks.
| Command | Description |
|---|---|
make up |
Start the Docker containers. |
make upd |
Start the Docker containers in detached mode. |
make down |
Stop the Docker containers. |
make build |
Rebuild and start the Docker containers in detached mode. |
make restart |
Restart the Docker containers. |
make shell |
Open a bash shell inside the PHP container. |
make migrate |
Run Doctrine database migrations. |
make db-reset |
Drop the database, create a new one, and run migrations. |
make test |
Run the PHPUnit test suite. |
make cs-check |
Check for PHP Code Sniffer coding standard violations. |
make cs-fix |
Automatically fix PHP Code Sniffer violations. |
make stan |
Run PHPStan for static analysis. |
make console |
Run any Symfony console command (e.g., make console a=debug:router). |