This project is a Symfony application running inside Docker containers. It is easily deployable to a local environment on macOS or Linux.
Before setting up the project, ensure the following are installed on your machine:
- Docker (https://www.docker.com/products/docker-desktop)
- Docker Compose (usually bundled with Docker Desktop)
Note: Ensure that Docker and Docker Compose are up-to-date.
Clone the repository to your local machine:
git clone https://github.com/Ronaca/cogify-task.gitand navigate to the project directory:
cd cogify-taskBefore building the application, you need to set up your environment variables.
Copy the .env.example file to .env:
cp .env.example .env
To start the application using Docker Compose, use the following command:
docker-compose up --build -dOnce the containers are built and running, you can access the application at http://localhost:8000.
Enter the PHP container and install the application dependencies:
composer installTo set up the database, run the following commands:
php bin/console doctrine:migrations:migrateYou can access the application at http://localhost:8000.
From there, you can go to the /api endpoint to view the API documentation.
Create the test database:
php bin/console doctrine:database:create --env=testRun migrations:
php bin/console doctrine:migrations:migrate --env=testCopy the phpunit.xml.example file to phpunit.xml:
cp phpunit.xml.example phpunit.xmlRun tests:
php bin/phpunit --testdox