After cloning the repository, install the git hooks to ensure code quality and commit message standards:
./.githooks/install-hooks.shThis will install two hooks:
- pre-commit: Runs PHP CodeSniffer on staged PHP files to enforce code style standards
- commit-msg: Enforces that all commit messages start with
BUR-XXX(where XXX is a ticket number)
See .githooks/README.md for more details.
This project uses Docker and Dev Containers for local development.
-
Create your environment file:
cp .env.dist .env
Replace the
LITUS_API_KEYwith a valid key to enable login with Litus Oauth2. -
Start the development environment:
make up
-
Set up the database:
make db
-
Connect to the development container:
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Select "Dev Containers: Reopen in Container"
- Choose either "Burgieclan Backend" or "Burgieclan Frontend"
- Press
That's it! You can now work on the frontend or backend code within the containerized environment.
- Frontend: http://localhost:3000
- Backend: http://localhost:8000
To stop all services:
make downFor future development sessions, simply run:
make upThen reopen in your chosen development container (Backend or Frontend).
The Makefile contains many useful commands designed to be run from the host machine. If you are running commands directly inside the container, run the underlying command itself (e.g., php bin/console instead of docker compose exec backend php bin/console).
make ps: Show running containersmake logs: Show logs from all servicesmake backend-shell: Open a shell in the backend containermake frontend-shell: Open a shell in the frontend containermake admin: Create an admin usermake reset-password: Reset a user's passwordmake phpstan: Run PHP static analysismake phpunit: Run PHP unit testsmake phpcs: Run PHP code style checksmake phpcbf: Auto-fix PHP code style issues
This guide will help you deploy the application on a new server.
- Docker (v20.10 or higher) and Docker Compose (v2.0 or higher)
- SSH access to the production server
- A domain name with DNS configured
- An external reverse proxy handling HTTPS (e.g., Caddy, Traefik, nginx, apache2)
The application is automatically deployed via GitHub Actions. No manual intervention is required if the following are configured:
GitHub Secrets (Settings → Secrets and variables → Actions):
SSH_USER: SSH username for the serverSSH_HOST: Server hostname/IP addressSSH_PRIVATE_KEY: SSH private key for authenticationSENTRY_AUTH_TOKEN: (Optional) For Sentry source map uploads
GitHub Variables (Settings → Secrets and variables → Actions):
DEPLOY_DIR: Deployment directory (e.g.,/opt/burgieclan)DATA_DIR: Data directory path (e.g.,/opt/burgieclan/data)JWT_DIR: JWT keys directory (e.g.,/opt/burgieclan/jwt)
Server Requirements:
- Docker and Docker Compose installed
- Directories created (see Manual Deployment section below)
.envfile configured (see Manual Deployment section below)
Trigger: When a GitHub release is published
Target: https://burgieclan.vtk.be
The deployment pipeline will:
- Build production Docker images
- Push to GitHub Container Registry
- SSH to the production server
- Pull latest images
- Start/restart containers
- Run database migrations
- Generate JWT keys
Trigger: When code is pushed to the main branch
Target: https://dev.burgieclan.vtk.be
The development environment uses the same production-grade Docker setup but deploys automatically on every push to the main branch. This allows testing changes in a production-like environment before creating a release.
Note: Both environments require separate server configurations with their own GitHub secrets/variables (configure per environment in GitHub repository settings).
See PRODUCTION.md for detailed CI/CD pipeline documentation.
If you prefer manual deployment or GitHub Actions is not configured:
-
Create required directories on your production server:
mkdir -p /opt/burgieclan/data mkdir -p /opt/burgieclan/jwt mkdir -p /opt/burgieclan/postgres
-
Create a
.envfile in your deployment directory (e.g.,/opt/burgieclan/.env), see.docker/.env.dist:# Docker Images IMAGE_TAG=prod # Use 'prod' for production, 'dev' for development # Application APP_SECRET=your-generated-secret-here # Database POSTGRES_PASSWORD=your-strong-password-here POSTGRES_DATA_DIR=/opt/burgieclan/postgres # Directories DATA_DIR=/opt/burgieclan/data JWT_DIR=/opt/burgieclan/jwt # OAuth (Litus) LITUS_API_KEY=your-litus-api-key LITUS_SECRET=your-litus-secret # JWT JWT_PASSPHRASE=your-jwt-passphrase # Sentry error tracking SENTRY_DSN=your-sentry-dsn
-
Download the production compose file:
cd /opt/burgieclan curl -o docker-compose.prod.yml https://raw.githubusercontent.com/vtkleuven/burgieclan/main/.docker/docker-compose.prod.yml curl -o nginx.conf https://raw.githubusercontent.com/vtkleuven/burgieclan/main/.docker/nginx.conf -
Log in to GitHub Container Registry:
echo "YOUR_GITHUB_TOKEN" | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
-
Pull and start the application:
# For production deployment (use prod images) IMAGE_TAG=prod docker compose -f docker-compose.prod.yml pull IMAGE_TAG=prod docker compose -f docker-compose.prod.yml up -d # For development deployment (use dev images) IMAGE_TAG=dev docker compose -f docker-compose.prod.yml pull IMAGE_TAG=dev docker compose -f docker-compose.prod.yml up -d
-
Run database migrations:
docker compose -f docker-compose.prod.yml exec backend php bin/console doctrine:migrations:migrate --no-interaction -
Generate JWT keys:
docker compose -f docker-compose.prod.yml exec backend php bin/console lexik:jwt:generate-keypair
The application will be available at http://your-server:8000. Configure your external reverse proxy to forward HTTPS traffic to this port.
View logs:
# All services
docker compose -f docker-compose.prod.yml logs
# Specific service
docker compose -f docker-compose.prod.yml logs backend
docker compose -f docker-compose.prod.yml logs frontend
# Follow logs in real-time
docker compose -f docker-compose.prod.yml logs -fCheck service health:
docker compose -f docker-compose.prod.yml psRestart services:
docker compose -f docker-compose.prod.yml restartFor detailed information about the production setup, including architecture, CI/CD pipeline, configuration files, and operational guidelines, see PRODUCTION.md.
The production deployment consists of 4 Docker containers:
- nginx: Reverse proxy routing requests to backend/frontend (port 8000)
- backend: Symfony API with PHP-FPM + nginx (internal port 8080)
- frontend: Next.js application (internal port 3000)
- db: PostgreSQL 18 database (internal port 5432)
Images are automatically built and deployed via GitHub Actions when releases are published.