PHP 8 or later
Symfony CLI
Docker
Composer
Nodejs 16 or later
Clone the repository
git clone https://github.com/hossein-vejdani/fruits.git
Go to backend directory
cd backend
Run this command to install the required dependencies.
composer install
Run this commnad to start the PostgreSQL database and mail server.
docker-compose up -d
Run this command to create database.
symfony console doctrine:database:create
Run this command to migrate the database schema.
symfony console doctrine:migrations:migrate
To fetch initial data and save it to the database run:
symfony console fetch-fruits
Run this command to start the development server on port 8000.
symfony server:start -d
Go to frontend directory and open terminal
Then make sure to install the dependencies:
# yarn
yarn install
# npm
npm install
# pnpm
pnpm install
Start the development server on http://localhost:3000
npm run dev
Build the application for production:
npm run build
Locally preview production build:
npm run preview
npm run unit:test
The database credentials are set in the .env file.
To stop the Docker container, run docker-compose down.
To view the database, you can use a PostgreSQL client such as pgAdmin or DBeaver. The database is running on port 5432.