feat: add base FastAPI project structure with static frontend and API v1

This commit is contained in:
Lino Mallevaey
2025-08-18 00:22:50 +02:00
parent ff5026b8f7
commit 49bcb38261
14 changed files with 487 additions and 13 deletions

View File

@@ -0,0 +1,85 @@
# =========================
# ENVIRONMENT CONFIGURATION
# =========================
ENV=dev # dev, prod
# =========================
# DATABASE CONFIGURATION
# =========================
# URL de connexion SQLAlchemy
# Pour PyMySQL (synchrone)
DATABASE_URL=mysql+pymysql://user:password@localhost:3306/db_name
# Pour aiomysql (async)
# DATABASE_URL=mysql+aiomysql://user:password@localhost:3306/mokpyo
# Pooling / Options SQLAlchemy (optionnel)
# MAX_CONNECTIONS=10
# MIN_CONNECTIONS=1
# POOL_RECYCLE=3600
# =========================
# FASTAPI SETTINGS
# =========================
# Debug mode (True/False)
DEBUG=True
# Nom et version de lAPI
APP_TITLE=MokPyo
APP_VERSION=1.0.0
APP_DESCRIPTION=MokPyo
APP_DOMAIN=localhost
# =========================
# SERVER CONFIGURATION
# =========================
# Host et port de lAPI
HOST=0.0.0.0
PORT=8000
# =========================
# SECURITY / AUTH
# =========================
# Clé secrète pour JWT
SECRET_KEY=change_me_to_a_long_random_string
# Expiration des tokens JWT en minutes
ACCESS_TOKEN_EXPIRE_MINUTES=30
# Algorithme de chiffrement JWT
ALGORITHM=HS256
# =========================
# EMAIL / VALIDATION
# =========================
# SMTP Server (pour envoyer emails, si nécessaire)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your_email@example.com
SMTP_PASSWORD=super_secret_password
EMAIL_FROM=no-reply@example.com
# =========================
# LOGGING
# =========================
# Niveau de log : DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO
LOG_FILE=logs/app.log
# =========================
# STATIC FILES / FRONTEND
# =========================
# Répertoire static
STATIC_DIR=app/static
# =========================
# OPTIONAL / CUSTOM
# =========================
# Nombre de workers uvicorn
UVICORN_WORKERS=4
# Limite upload fichiers (en bytes)
MAX_UPLOAD_SIZE=10485760 # 10MB
# Mode ORJSON strict (True/False)
ORJSON_STRICT=True