- Docker: Install Docker
- Docker Compose: Install Docker Compose
- Poetry (optional) : Install Poetry
-
Clone the repository:
git clone https://github.com/gr3gorie/todoapp-backend.git cd todoapp-backend -
Install dependencies using Poetry:
poetry install
-
Start Docker containers:
docker-compose up --build -d
-
Verify that the containers are running:
docker ps
There should be two containers:
todoapp_postgres(PostgreSQL database)todoapp_backend(FastAPI backend)
-
Run the FastAPI server locally:
uvicorn src.main:app --reload
-
Access the API at:
http://localhost:8000 -
Access the API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Open pgAdmin and register a new server.
- Use the following details to connect:
- Host:
localhost(or the container's IP) - Port:
6666(or the port you configured) - Username:
user - Password:
password - Database:
todoapp_db
- Host:
To stop the containers, run:
docker-compose down