Init photobooth - borne photo evenementielle RPi4

Backend FastAPI complet : camera gphoto2, filtres/overlays Pillow,
chroma key OpenCV, multi-shot/collage, GIF, impression CUPS, email SMTP,
QR code. Frontend web vanilla (HTML/CSS/JS) pour Chromium kiosk.
Menu admin cache (appui long coin ecran). Toutes les fonctionnalites
activables/desactivables. Scripts install + systemd pour RPi4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 21:46:31 +01:00
commit c8e4ec80c1
29 changed files with 2854 additions and 0 deletions

39
scripts/install.sh Normal file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# Installation du photobooth sur Raspberry Pi 4
set -e
echo "=== Installation Photobooth ==="
# Mise a jour systeme
sudo apt update && sudo apt upgrade -y
# Dependances systeme
sudo apt install -y \
python3 python3-pip python3-venv \
libgphoto2-dev \
cups libcups2-dev \
chromium-browser \
libopencv-dev python3-opencv \
unclutter
# Creer le venv
cd "$(dirname "$0")/.."
python3 -m venv .venv
source .venv/bin/activate
# Installer les dependances Python
pip install -r backend/requirements.txt
# Creer les dossiers de donnees
mkdir -p data/photos data/exports
mkdir -p frontend/assets/overlays frontend/assets/backgrounds frontend/assets/sounds
# Installer le service systemd
sudo cp scripts/photobooth.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable photobooth
echo ""
echo "=== Installation terminee ==="
echo "Demarrer avec : sudo systemctl start photobooth"
echo "Ou manuellement : ./scripts/start.sh"

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Photobooth
After=network.target graphical.target
[Service]
Type=simple
User=jules
WorkingDirectory=/home/jules/Documents/Projet/photobooth-app
ExecStart=/home/jules/Documents/Projet/photobooth-app/scripts/start.sh
Restart=always
RestartSec=5
Environment=DISPLAY=:0
[Install]
WantedBy=graphical.target

39
scripts/start.sh Normal file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# Demarrage du photobooth (backend + chromium kiosk)
set -e
DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$DIR"
# Activer le venv
source .venv/bin/activate
# Demarrer le backend en arriere-plan
echo "Demarrage du backend..."
python -m backend.main &
BACKEND_PID=$!
# Attendre que le backend soit pret
sleep 3
# Cacher le curseur souris
unclutter -idle 0.1 -root &
# Demarrer Chromium en mode kiosk
echo "Demarrage de Chromium kiosk..."
chromium-browser \
--kiosk \
--noerrdialogs \
--disable-infobars \
--disable-translate \
--disable-features=TranslateUI \
--disable-session-crashed-bubble \
--disable-component-update \
--check-for-update-interval=31536000 \
--autoplay-policy=no-user-gesture-required \
--start-fullscreen \
--incognito \
http://localhost:8080
# Si Chromium se ferme, arreter le backend
kill $BACKEND_PID 2>/dev/null