/backend-- App/Admin panel backend, Laravel/admin-- Admin panel frontend (React, Vite)/build-- Infrastructure (Dockerfiles, config files)
To run the project locally, you need Docker and Docker Compose.
The project is configured using environment variables. For development convenience, .env files can be used. .env files are not stored in vcs. Examples of filled .env files are provided in .env.example.
/backend/.env-- Backend application configuration/admin/.env-- Admin panel application configuration
cp docker-compose.example.yaml docker-compose.yaml
cp backend/.env.example backend/.env
cp admin/.env.example admin/.env
At this stage, no changes are required.
Start the containers:
docker compose up -d
Now, install dependencies:
docker compose run --rm back composer install --ignore-platform-reqs
Run this command whenever backend dependencies are updated (i.e., when backend/composer.lock changes).
Besides PHP dependencies, the admin panel also has frontend dependencies.
docker compose run --rm admin yarn install
Install these dependencies when admin/yarn.lock changes.
APP_KEY is a special environment variable for Laravel, used as a symmetric encryption key. Generate it once using:
docker compose run --rm back php artisan key:generate
Then run:
docker compose exec db psql -U postgres -c 'create database "backend"'
S3 (e.g., minio is used for image storage.
Modify these params in backend/.env for S3 configuration:
S3_ENDPOINT=
S3_KEY=
S3_SECRET=
S3_REGION=us-east-1
S3_BUCKET=
Other integration options can also be found at backend/.env file
Migrate using:
docker compose run --rm back php artisan migrate
Populate using:
docker compose run --rm back php artisan db:seed
docker compose up -d
The nginx container exposes port 80 on the host machine, backend should be accessible at: http://localhost:802.
The admin container exposes port 3000 on the host machine, admin panel should be accessible at: http://localhost:3000.