If you have docker installed just run the following command:
docker compose up --build
If you prefer using the default way of start a fastapi application you can follow the next steps:
1 Create a virtual environment and activate it
python3 -m venv venv && source venv/bin/activate
2 Install the packages:
pip install -r requirements.txt
- Once it is installed you can initiate the wsgi server from fastapi using uvcorn:
uvicorn main:app --reload
ps: remember you should be in the root directory to run this command.
There are all the CRUD opertions as:
/tasks/
Read all (GET)/tasks/
Create Todo (POST)/tasks/{todo_id}
Read Todo (GET)/tasks/{todo_id}
Update Todo (PUT)/tasks/{todo_id}
Patch Todo (PATCH)/tasks/{todo_id}
Delete Todo (DELETE)
For the endpoints above the payload is as follow:
{
"title": "string",
"description": "string",
"completed": true
}
There have tests for all endpoints and database integration using pytest
.
To check the functionalities, with the requirements.txt
installed just write:
pytes -s
To check the tests just go to test/
.
This service was deployed using render.com
using docker and a postgres database created on AWS RDS
.