Skip to content

romusters-code/fast-api-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Personal code to showcase my abilities, such as:

  1. Software Engineering in Python:

    1. Code (e.g. design patterns)

    2. Tests (unit and integration)

    3. Project tooling (pre-commit, Ruff)

  2. Docker

  3. Terraform

  4. Cloud Engineering

  5. DevOps

Prerequisites

  • Python 3.12 and Pip/Poetry
  • Docker
  • Terraform
  • Azure subscription
  • Pre-commit
  • Hadolint binary (when using pre-commit)

How to run

Python

To run the project locally using Python, run:

poetry run fastapi run app/main.py --host 0.0.0.0 --port 8080

TODO: try uv instead of Poetry.

Go to e.g.: http://0.0.0.0:81/docs

Tests

poetry run pytest tests/

Docker

First navigate to the function_app folder and then build the container:

docker build -t functionapp:latest .

Then run the container:

docker run -p 80:80 -it functionapp:latest

Docker-compose

docker-compose up

Cloud

Terraform

Terraform information

Azure

Use the function app to Go to e.g.: http://*.azurewebsites.com.

TODO:

  • exception handling
  • logging
  • devops pipeline
  • integration test
  • create package from model and handler so that I can use it in Docker image
  • caching requests for FastAPI using external database

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors