This process required:
- Python
- Docker
To check your python version uses this command:
$ python --version
Python 3.9.13
Clone this repository in your local system:
git clone https://github.com/omarftt/API-FastAPI-Postgres.git
Create a virtual environment
virtualenv venv
source venv/bin/activate
Install all packages required
cd app
pip install -r requirements.txt
Pull required Docker images
docker pull postgres
Then, to run the development server using docker-compose, use:
cd ..
docker-compose up
Docker compose will up 3 services: FastAPI, Postgres, and PGAdmin. Use user and password configure in docker-compose.yml file
To evaluate the application, you can insert dummy values into the Postgres database (users table). Execute the following command:
bash init_db.sh
To test this API, you could use FastAPI Docs, Postman o CuRL.