Libreforum is a project to create a discussion forum around free software. and free software appliances. It's meant as a space of help between each others and to make people progress in the knowledge of free softwares.
It combines a Symfony backend, a React + Vite frontend, a Python microservice for LLM support, and Docker for local development.
- Backend: Symfony 8 PHP application, REST API + service layer, JWT authentication, Mercure real-time notifications, Doctrine ORM, email simulation with Mailhog.
- Frontend: React + Vite application using TypeScript, React Router, React Query, Tailwind CSS, forms and markdown support.
- LLM service: A Python FastAPI-based microservice that uses an Ollama container to provide a local generative AI endpoint.
- Database: MySQL 8.4 managed inside Docker.
- Development environment: Docker Compose orchestrates PHP, Nginx, MySQL, phpMyAdmin, Mailhog, frontend dev server, LLM service, Ollama, and Mercure.
libreforum/
├── backend/ # Symfony application source and configuration
│ ├── config/
│ ├── public/
│ ├── src/
│ ├── migrations/
│ └── tests/
├── frontend/ # React + Vite application
│ ├── public/
│ ├── src/
│ ├── package.json
│ └── tsconfig.json
├── llm/ # Python microservice for local LLM API
│ ├── app/main.py
│ ├── requirements.txt
│ └── Dockerfile
├── docker/ # Docker configuration for PHP, Nginx, MySQL, certs
│ ├── mysql/
│ ├── nginx/
│ └── php/
├── docker-compose.yml # Main service orchestration
├── .env.example # Environment configuration template
├── make_certs.sh # Generate self-signed TLS certs for local HTTPS
└── README.md # This file
- Community forum for free software and open source discussions
- User management with roles and permissions
- Topics, posts, tags, categories and chat room features
- Local development with secure HTTPS and automatic Docker service orchestration
- Demo data loaded by Doctrine fixtures
- Local email preview via Mailhog
- Local LLM endpoint using Ollama + Python API
- Docker Engine
- Docker Compose (
docker-composeordocker compose) - Bash shell and OpenSSL for
make_certs.sh
- Docker Desktop
- Bash shell (Terminal)
- OpenSSL is typically available through the system or via Homebrew
- Docker Desktop with WSL2 backend (recommended)
- Git Bash or WSL2 terminal for shell commands
- If using PowerShell, run the certificate script inside WSL or Git Bash
If you are on Windows, the repository uses a Bash script to generate self-signed certificates, so it is easiest to run setup commands in WSL2 or Git Bash.
- Clone the repository and move into the project folder:
git clone <repository-url> libreforum
cd libreforum- Copy the environment template:
cp .env.example .env- Review
.envand update secrets if needed:
DATABASE_URLconnects Symfony to the MySQL containerJWT_PASSPHRASEis required for Symfony JWT signing and JWT token generationMERCURE_JWT_SECRETis required for Mercure real-time messagesVITE_API_URLandVITE_API_BASE_URLare the frontend API URLs
If you are on Windows, don't forget to disable the two lines UID and GID.
- Generate local TLS certificates:
sh ./make_certs.shIf you are on Windows and make_certs.sh does not run, use WSL2 or Git Bash:
bash ./make_certs.shStart all Docker services with build:
docker-compose up -d --buildIf your Docker installation uses the compose plugin, this also works:
docker compose up -d --buildWait until all containers are healthy. The first build may take several minutes.
Install PHP dependencies and prepare the Symfony application:
docker-compose run --rm php composer installGenerate the JWT key pair for the Symfony backend:
docker-compose run --rm php bin/console lexik:jwt:generate-keypair --overwrite --no-interactionCreate the database and apply migrations:
docker-compose run --rm php bin/console doctrine:database:create --if-not-exists
docker-compose run --rm php bin/console doctrine:migrations:migrate --no-interactionLoad demo data with Doctrine fixtures:
docker-compose run --rm php bin/console doctrine:fixtures:load --no-interactionPull the Mistral model into the Ollama container:
docker-compose exec ollama ollama pull mistralThis downloads the Mistral LLM model (~5 GB) for use by the Python LLM API service. The process may take several minutes depending on your internet connection.
By default, docker-compose.yml sets OLLAMA_KEEP_ALIVE: 10h to keep the Mistral model loaded in memory for 10 hours. This ensures fast response times during live demonstrations without model reload delays.
To adjust this value for your use case:
- Edit
docker-compose.ymland change theOLLAMA_KEEP_ALIVEvalue under theollamaservice - Use duration strings like
5m(5 minutes),1h(1 hour), or0(infinite) - Restart the container:
docker-compose restart ollama
Install frontend dependencies and keep the Vite dev server running:
docker-compose run --rm frontend npm installThe frontend service already runs in development mode when Docker Compose starts, using:
npm run dev -- --host 0.0.0.0All services might not running well at this stage. So run the following two commands to ensure a clean restart.
docker-compose down
docker-compose up -dOpen the browser and use the following addresses:
https://localhost:8443- Main application entry point via Nginx HTTPShttp://localhost:8080- HTTP redirect proxy to HTTPShttp://localhost:5173- Frontend Vite development serverhttp://localhost:8081- phpMyAdmin database administrationhttp://localhost:8025- Mailhog web interfacehttp://localhost:1025- Mailhog SMTP serverhttp://localhost:8000- Local LLM Python API
The HTTPS endpoint uses self-signed certificates, so your browser will warn about the certificate. Accept the warning to continue.
The sample fixtures load a few users with the following credentials:
admin@libreforum.local/password(ROLE_ADMIN)alice@libreforum.local/passwordbob@libreforum.local/passwordcharlie@libreforum.local/password(ROLE_MODERATOR)
| Service | URL | Purpose |
|---|---|---|
| Symfony backend | https://localhost:8443 |
Main web app and API |
| Nginx HTTP | http://localhost:8080 |
Redirect to HTTPS |
| Frontend Vite | http://localhost:5173 |
React development server |
| phpMyAdmin | http://localhost:8081 |
Database admin UI |
| Mailhog UI | http://localhost:8025 |
Inspect outgoing email |
| MySQL | internal Docker service | App database |
| LLM API | http://localhost:8000 |
Python microservice endpoint |
| Ollama | internal Docker service | Local model host |
- If Docker fails to start the
ollamaservice because your machine has no GPU, remove or adapt the GPU reservation section indocker-compose.yml. - If port collisions occur, stop the conflicting local service or change the exposed ports in
docker-compose.yml. - On Windows, prefer WSL2 for the
make_certs.shstep and for Docker file permissions. - If Symfony cannot connect to the database, verify that
.envcontains the correct MySQL credentials and that themysqlcontainer is healthy.
- Backend code:
backend/src/ - Frontend code:
frontend/src/ - LLM API:
llm/app/main.py - Docker service configuration:
docker-compose.yml,docker/ - Symfony migrations:
backend/migrations/ - Fixtures:
backend/src/DataFixtures/AppFixtures.php
If you want to completely remove the project from your system, you can use the following command:
docker-compose down -v --rmi all --remove-orphansThis command will remove all containers, volumes, networks and images that belong to the docker-compose.yml project.
This repository demonstrates a complete full-stack exam project with:
- a practical web forum use case,
- a multi-service Docker architecture,
- frontend/backend separation,
- real-time messaging and AI integration,
- database migrations and sample data loading.
Enjoy exploring LibreForum and adapting it for your own use.