Skip to content

lmalvins/fastapi-simple-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Simple Project

A lightweight, modular FastAPI project using Poetry and a Hexagonal Architecture approach for clean separation of concerns.


Features

  • FastAPI as the web framework
  • Hexagonal architecture (domain, application, infrastructure layers)
  • Pytest for testing
  • SQLAlchemy ready (DB adapter)
  • Dependency management via Poetry

Pre-requisites

Before getting started, make sure you have:

  • Python 3.11
  • Poetry installed
    (Recommended install method: brew install poetry or use the official installer)
# Install Poetry (if not already)
brew install poetry
# OR
curl -sSL https://install.python-poetry.org | python3 -

🚀 Running the Application

After installing dependencies, you can start the FastAPI server using Uvicorn.

1. Install dependencies

If you haven’t already, run:

poetry install

2. Start the server

Run the following command from the project root:

PYTHONPATH=src uvicorn main:app --reload
  • PYTHONPATH=src ensures that internal modules (like api, services, etc.) are correctly resolved.
  • --reload enables automatic reload on code changes (useful during development).

The app will be available at:

About

FastAPI project with Poetry and hexagonal architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages