An application for managing categories and their products, which in this case are research, but you can create your own product context
To install the application you will need:
- PHP >= 8.1
- git
- composer
- symfony cli
- Go to the folder where you want to create the project and clone the repository
git clone https://github.com/Janczur/SimpleShopApi.git .
- Go to /app directory
cd app
- Install dependencies
composer install
- Change environment variables to your needs
(skip this part for default configuration)
Information about configuring environment
copy ".env" file to ".env.local.dev" and provide valid DB credentials
DATABASE_URL="mysql://symfony:[email protected]:3306/shop?serverVersion=mariadb-10.8.3&charset=utf8mb4"
- Run docker-compose to create database in container
docker-compose up
- Create database and run migrations
php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate --no-interaction
Create test database if not exists
php bin/console doctrine:database:create --env=test
php bin/console doctrine:schema:create --env=test
For tests run in the main project directory
php bin/phpunit
If you want to populate database with dummy data run:
php bin/console doctrine:fixtures:load
It will create 5 Categories with 10 researches each and 10 researches without category
To start local server type in your project directory
symfony serve
Coming soon
- Move web server and php to docker
- Add swagger documentation
- Simplify installation process
Jan Przybysz - [email protected]