Skip to content

Example of a FastAPI full-stack application with Docker and poetry

Notifications You must be signed in to change notification settings

Aron-S-G-H/fastapi-fullstack-todo

Repository files navigation

FastAPI Full-Stack Application (ToDo App)

🌟 Simple example of using FastAPI in a Full-Stack project with Poetry and Docker 🌟


📜 Features

  • Authentication & Authorization
    • JWT
    • Login/Register
  • CRUD operation on ToDos
  • Dockerized
  • Using Alembic as migration tool
  • Using Poetry

🛠 Installation

  1. Clone the repository

    git clone https://github.com/Aron-S-G-H/fastapi-fullstack-todo.git

    then...

    cd fastapi-fullstack-todo

  2. Create and activate a virtual environment

    python3 -m venv venv or virtualenv venv

    then...

    source venv/bin/activate

  3. Install dependencies

    pip install -r requirements.txt or poetry install

  4. Setup DB

    alembic upgrade head

  5. Start the app

    python3 main.py or uvicorn settings:main --host 0.0.0.0 --port 8000 or poetry run python3 main.py

🚀 Run with Docker


⚠️ Ensure that you have Docker installed before you proceed


  1. Clone the repository

    git clone https://github.com/Aron-S-G-H/fastapi-fullstack-todo.git

    then...

    cd fastapi-fullstack-todo

  2. Create an image

    docker build -t todoapp:latest --no-cache .

  3. Run a container

    docker run --name todoApp -p 8000:8000 -d todoapp:latest

Note : If you encounter the error 'ERROR: Exception TimeoutError: timed out' or something strange while creating the image, go to the Dockerfile and either remove or comment out line 27. Then, try building the image again.

🗂️ API documentation

http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc



Any contributions are welcome