Skip to content

amitsk/fastapi-todos

Repository files navigation

API - fastapi-todos

This is a demo project for building an API using FastAPI https://fastapi.tiangolo.com/

It uses

Building

  • Install Python3.11
  • Install pdm https://pdm.fming.dev/latest/
  • Clone from github
  • Build - Install, test, lint make build
  • Tests can be run with make test

Running APIs

Endpoints

Running in Docker

  • Based off python:3.11-slim. Around 260MB image size
  • docker build -t fastapi/todos .
  • docker run --name todos-container -p 8000:8000 --rm -d fastapi/todos

Configuration

  • gunicorn.conf.py

Json Logging using Loguru

  • custom_logging.py

Kubernetes

  • Working installations of minikube and kubectl
  • In a terminal eval $(minikube -p minikube docker-env)
  • Build docker image
  • minikube start
  • Switch to deployments/k8s
  • kubectl create -f deployments.yaml
  • kubectl create -f service.yaml
  • URL = minikube service --url fastapi-todos-svc
  • Access the swagger console at /docs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published