Fooder API in fastapi
Find a file
Piotr Domański 0318793cae
Some checks failed
Python Quality & Tests / Lint, Typecheck, and Test (push) Failing after 31s
[alembic] just one revision
2026-04-16 15:19:47 +02:00
.github/workflows [workflow] bump 2026-04-15 17:24:27 +02:00
doc [preset create] view for creating empty preset 2026-04-08 19:31:48 +02:00
fooder [alembic] just one revision 2026-04-16 15:19:47 +02:00
requirements [user] views [docs] openapi 2026-04-07 22:05:03 +02:00
.dockerignore [cleanup] clean .dockerignore and pre commit hooks 2026-04-08 13:33:44 +02:00
.gitignore initial push 2023-04-01 16:19:12 +02:00
ARCHITECTURE.md [repo] soft delete changes 2026-04-07 19:07:59 +02:00
docker-compose.yml [alembic] better docker building 2026-04-02 21:08:55 +02:00
Dockerfile [user] views [docs] openapi 2026-04-07 22:05:03 +02:00
Makefile [preset create] view for creating empty preset 2026-04-08 19:31:48 +02:00
mypy.ini [mypy] 2026-04-07 17:07:38 +02:00
pyrightconfig.json [pyright] 2026-04-07 17:14:47 +02:00
pytest.ini begin tedious work 2026-04-02 18:22:05 +02:00
Readme.md readme 2026-04-08 12:02:35 +02:00
setup.cfg [flake] 2026-04-07 17:12:27 +02:00
setup.py [alembic] better docker building 2026-04-02 21:08:55 +02:00
test.sh begin tedious work 2026-04-02 18:22:05 +02:00

FOODER

Simple API for food diary application. It uses FastAPI and async postgres.

Overview and key points of configurating and deploying API

API is maily suited for being run as docker container, either via docker compose or inside kubernetes/openshift, tho no configuration for those are provided in this repository. Example docker-compose.yml for deployment is provided in doc/install/docker-compose.yml.

Configuration is passed through env variables. Sample configuration is provided in doc/install/env.template.

Database migrations are handled through alembic. For ease of use, doc/install/Makefile provides formula for make migrate that upgrades database to head migration.

Development

Project architecture design was summarized in ARCHITECTURE.md, altho summary was generated with usage of AI for now so might not be perfect or informative ;)

Overall, project consists of:

  • fooder/alembic - alembic python scripts, migrations, autogenerated
  • fooder/context - context with authorized session, repositories
  • fooder/domain - sqlalchemy domain definitions
  • fooder/controller - controllers for domain models, controllers hold logic linked with only one model
  • fooder/repository - repositories for domain models, again single repo per model, altho because of joins there are some methods that touch more than one model
  • fooder/model- pydantic models
  • fooder/view - fastapi routes
  • fooder/utils - utils
  • fooder/app - fastapi app definitions
  • fooder/db - sqlalchemy database core functionality
  • fooder/recaptcha - recaptcha implementation
  • fooder/exc - exceptions live there
  • fooder/router - fastapi main router
  • fooder/settings - pydantic-settings for app