[#10] Setup the FastAPI project directory + Document the API design process - #12
Conversation
|
The documentation is not finished yet neither the project setup. I need to take new architectural decisions for the API that may impact the libraries used in the project setup. |
glopez-dev
left a comment
There was a problem hiding this comment.
Code Review — Setup FastAPI + Documentation API
🔴 Points à corriger
1. Double uv sync redondant dans le Dockerfile prod (api/docker/prod/Dockerfile)
RUN uv sync --frozen --no-install-project --no-dev # inutile
COPY . .
RUN uv sync --frozen --no-dev # celui-ci suffitLe premier uv sync est redondant car le second réinstalle tout après COPY . .. Soit supprimer le premier, soit restructurer pour vraiment profiter du cache Docker.
2. Version uv non épinglée (dev + prod Dockerfiles)
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv:latest nuit à la reproductibilité des builds. Épingler une version spécifique, ex: ghcr.io/astral-sh/uv:0.7.2.
3. .gitignore racine supprimé
Le fichier .gitignore a été déplacé vers api/.gitignore, laissant le repo sans .gitignore à la racine. Les fichiers générés hors de api/ (ex: webapp/, artefacts CI) ne sont plus couverts.
4. Newline manquante en fin de api/main.py
return {"Hello": "World"}
\ No newline at end of file🟡 Suggestions mineures
5. Fautes de frappe dans la documentation
README.md:Intoduction→Introduction(x2, aussi dansSUMMARY.md)README.md:supprosée→supposée,mbBook→mdBookSUMMARY.md:Descision→Decision(x2, aussi dansadr.md)api.md:constuire→construire,accés→accès,cherches→cherche
6. Variable ENV non consommée
ENV=development / ENV=production est injectée dans Compose mais pas encore utilisée dans main.py. Pas bloquant pour un bootstrap, mais à documenter ou à connecter à pydantic-settings.
✅ Points positifs
- Multi-stage build propre en prod
- Cache Docker bien exploité (deps avant le code source)
- Bind mount du
.venven dev — bonne pratique uv.lockcommitté — reproductibilité garantie- Documentation de l'architecture Services/Controllers/Repositories/UoW — utile pour aligner l'équipe
- Correction du bug
up --detachdans la commandedowndu Justfile
Keep the shell recipe from main, combine compose.dev.yml (build args from main, api service and volume preservation from the branch), keep api/.gitignore.
This pull request introduces the initial setup for the Homepedia project, including foundational configuration for the API, documentation, and development tooling. The most important changes are grouped below by theme.
API Setup:
apidirectory, including a minimalmain.pyentrypoint and apyproject.tomlspecifying dependencies and Python version (3.13). [1] [2] [3]README.mdfor the API project.Documentation:
Development Tooling:
Justfileto support starting and stopping a documentation Docker environment usingdocker compose.