Fooder API in fastapi
Find a file
2026-04-07 17:14:47 +02:00
.github/workflows [runner] change to available one 2024-08-04 16:13:56 +02:00
fooder [flake] 2026-04-07 17:12:27 +02:00
requirements [alembic] init 2026-04-02 21:03:44 +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 [architecture] finalize architecutre 2026-04-07 15:06:56 +02:00
docker-compose.yml [alembic] better docker building 2026-04-02 21:08:55 +02:00
Dockerfile begin tedious work 2026-04-02 18:22:05 +02:00
env.template [refactor] cleanup dead code 2026-04-07 16:48:30 +02:00
Makefile [refactor] cleanup dead code 2026-04-07 16:48:30 +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 [barcode] small fix 2024-05-20 16:46:58 +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.

Usage

Simply build docker images with:

docker-compose build

And then start them up with:

docker-compose up -d

Create .env file with configuration by copying template env.template. You have to generate secret keys! They are stored under SECRET_KEY and REFRESH_SECRET_KEY in .env file and both could be generated with openssl rand -hex 32.

To initialize database exec:

docker-compose exec api bash -c python -m fooder --create-tables

Deployment

For deployment delete:

    volumes:
      - ./fooder:/opt/fooder/fooder

and

    command: "uvicorn fooder.app:app --host 0.0.0.0 --port 8000 --reload"

lines from docker-compose.yml. This line makes app reload everytime code changes and is only recommended for development purposes.

I highly recommend using reverse proxy like nginx for HTTPS.

Documentation

When api is started using docker, by default it runs on 8000 port on local machine (it can be changed within docker-compose.yml file). Swagger documentation is available on http://0.0.0.0:8000/docs when you start the app.

Alternatively you can visit my own instance of the API docs.