This is a project template which uses FastAPI, PostgreSQL database and async SQLModel as ORM.
Create an .env file on root folder and copy the content from .env.example. Feel free to change it according to your own configuration.
Using docker compose command
docker compose -f docker-compose-dev.yml up --buildUsing Makefile command
make run-dev-buildUsing docker compose command
docker compose -f docker-compose-dev.yml upUsing Makefile command
make run-devThis starts the server at http://localhost using nginx as reverse proxy. If you want a direct connection bypassing the proxy, you can use this url http://localhost:8000.
This creates sample users on database.
Using docker compose command
docker compose -f docker-compose-dev.yml exec fastapi_server python app/initial_data.py
Using Makefile command
make init-dbYou can connect to the Database using pgAdmin4 and use the credentials from .env file. Database port on local machine has been configured to 5454 on docker-compose-dev.yml file
(Optional) If you prefer you can run pgAdmin4 on a docker container using the following commands, they should executed on different terminals:
Starts pgadmin
make run-pgadminLoad server configuration (It is required just the first time)
make load-server-pgadminThis starts pgamin in http://localhost:15432.
Using docker compose command
docker compose upUsing Makefile command
make run-prod- This project is licensed under the terms of the MIT license


