Passer dâune architecture Jekyll (frontend) + Flask (backend monolith) Ă une architecture Backend FastAPI + Frontend Flask.
| Composant | Avant | RĂŽle |
|---|---|---|
| Frontend | Jekyll dans app/ |
Site statique (blog, pages), déployé sur GitHub Pages |
| Backend | Flask dans app/ |
API + templates (/, /about, /blog, /monitoring), health, rate limiting |
| CI/CD | jekyll-pages.yml, deploy.yml, ci.yml | Build Jekyll â Pages ; Build Flask â Cloud Run |
| Composant | Emplacement | RĂŽle |
|---|---|---|
| Backend | backend/ (FastAPI) |
API REST uniquement : /api/v1/articles, /api/v1/projects, /api/v1/experiences, /health, etc. |
| Frontend | frontend/ (Flask) |
Pages HTML (templates Jinja2), appelle le backend via HTTP (BACKEND_URL) |
| Ancien | app/ |
Conservé pendant la transition (Jekyll + Flask actuel) ; à retirer ou archiver une fois la migration terminée |
backend/ # FastAPI
âââ main.py # App FastAPI, CORS, routers
âââ config.py # Settings (env)
âââ requirements.txt
âââ routers/
âââ health.py # /health, /health/ready, /health/live
âââ api_v1.py # /api/v1/articles, projects, experiences
frontend/ # Flask
âââ app.py # create_app(), routes /, /about, /blog/, /monitoring
âââ requirements.txt
âââ templates/ # base, index, about, blog_list, monitoring
âââ static/css/style.css
cd /chemin/vers/repo
python -m venv .venv
source .venv/bin/activate # ou .venv\Scripts\activate sur Windows
pip install -r backend/requirements.txt
uvicorn backend.main:app --reload --port 8080
â API : http://localhost:8080 â Docs : http://localhost:8080/docs â Health : http://localhost:8080/health
# Dans le mĂȘme venv ou un autre
pip install -r frontend/requirements.txt
export BACKEND_URL=http://localhost:8080
flask --app frontend.app run --port 3000
â Site : http://localhost:3000
Le frontend appelle le backend via BACKEND_URL pour les donnĂ©es (ex. liste dâarticles).
app/src/database/.app/src/services/) dans les routeurs ou services FastAPI./api/rate-limit (Ă©quivalent de lâactuel Flask).BACKEND_URL en prod.deploy.yml pour le backend FastAPI (image + Cloud Run).app/ (Jekyll + ancien Flask).| Variable | Backend (FastAPI) | Frontend (Flask) |
|---|---|---|
DATABASE_URL |
Oui (si DB) | Non |
CORS_ORIGINS |
Oui | â |
BACKEND_URL |
â | Oui (URL de lâAPI) |
DerniĂšre mise Ă jour : 2026-02