FastAPI web service for a vet clinic to store and update the information about dogs.
Astashov I.V., 2023.
This service was developed in accordance with the assignment of the DevOps course during study at HSE Master's Programme.
If you would like to use the deployed service on Render see (3) Quick start.
The clinic needs a microservice to store and update information for dogs in accordance with the documentation in OpenAPI format.
- Python 3.11
- Fast API
- Postgres
- SQLAlchemy
- Uvicorn
The service is deployed on Render. See the documentation at the link.
- Clone this repo and
cd
into repo directory; - Create a virtual environment:
python -m venv venv
; - Activate a virtual environment:
source venv/Scripts/activate
; - Install dependencies:
pip install -r requirements.txt
; - Run the server:
uvicorn main:app --reload
; - Access swagger at: http://127.0.0.1:8000/docs .
You can also run the app locally using Docker
- Build the image
docker build . -t fastapi_app:latest
or usedocker pull astashoviv/fastapi_app
; - Spin up the container
docker run -d -p 5555:8000 fastapi_app
; - Access swagger at: http://127.0.0.1:5555/docs .
Dog
- name
- kind
- pk
Timestamp
- id
- timestamp
/
- GET: Basic information about the app
/post
- POST: Create a new id and timestamp
/dog
- POST: Create a new dog
/dog
- GET: Get a list of all dogs or list of dogs by type
/dog/{pk}
- GET: Get a dog by pk
/dog/{pk}
- PATCH: Update a dog by pk
This repository borrows partially from Артём Шумейко and Gwendolyn Faraday.