Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

[#10] Setup the FastAPI project directory + Document the API design process - #12

Merged
glopez-dev merged 9 commits into
mainfrom
10-setup-fastapi-project-directory
Jun 11, 2026
Merged

[#10] Setup the FastAPI project directory + Document the API design process#12
glopez-dev merged 9 commits into
mainfrom
10-setup-fastapi-project-directory

Conversation

@glopez-dev

Copy link
Copy Markdown
Contributor

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:

  • Added a new FastAPI-based project in the api directory, including a minimal main.py entrypoint and a pyproject.toml specifying dependencies and Python version (3.13). [1] [2] [3]
  • Created a basic README.md for the API project.

Documentation:

  • Updated the documentation book title and added an introduction and structure for the Homepedia project, including sections describing the REST API architecture and design patterns (services, controllers, repositories, unit of work). [1] [2] [3] [4] [5]

Development Tooling:

  • Modified the Justfile to support starting and stopping a documentation Docker environment using docker compose.

@glopez-dev
glopez-dev requested a review from ndaen March 18, 2026 20:58
@glopez-dev glopez-dev self-assigned this Mar 18, 2026
@glopez-dev glopez-dev added documentation Improvements or additions to documentation API Python labels Mar 18, 2026
@glopez-dev
glopez-dev marked this pull request as draft March 18, 2026 21:02
@glopez-dev

Copy link
Copy Markdown
Contributor Author

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 glopez-dev changed the title [10] Setup the FastAPI project directory + Document the API design process [#10] Setup the FastAPI project directory + Document the API design process Mar 19, 2026
@glopez-dev
glopez-dev marked this pull request as ready for review March 31, 2026 18:15

@glopez-dev glopez-dev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 suffit

Le 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 : IntoductionIntroduction (x2, aussi dans SUMMARY.md)
  • README.md : supproséesupposée, mbBookmdBook
  • SUMMARY.md : DescisionDecision (x2, aussi dans adr.md)
  • api.md : constuireconstruire, accésaccès, cherchescherche

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 .venv en dev — bonne pratique
  • uv.lock committé — reproductibilité garantie
  • Documentation de l'architecture Services/Controllers/Repositories/UoW — utile pour aligner l'équipe
  • Correction du bug up --detach dans la commande down du 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.
@glopez-dev
glopez-dev merged commit 50234fa into main Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

API documentation Improvements or additions to documentation Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant