Fooder API in fastapi
Find a file
2026-04-08 12:02:35 +02:00
.github/workflows [runner] change to available one 2024-08-04 16:13:56 +02:00
doc readme 2026-04-08 12:02:35 +02:00
fooder [prod] works 2026-04-07 23:11:03 +02:00
requirements [user] views [docs] openapi 2026-04-07 22:05:03 +02:00
.dockerignore add fiber and new pydantic 2023-07-30 20:18:42 +02:00
.gitignore initial push 2023-04-01 16:19:12 +02:00
.pre-commit-config.yaml [pre-commit] black 2023-04-17 23:35:11 +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 [prod] works 2026-04-07 23:11:03 +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