Skip to content

MichaelStaHelena/fastapi-htmx-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI + htmx Project

This project is a simple FastAPI application integrated with htmx for building dynamic, interactive web pages. The project includes configurations for code formatting, linting, import sorting, and type checking using popular tools like black, flake8, isort, and mypy.

Table of Contents

Getting Started

Prerequisites

  • Python 3.9 or higher
  • pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/MichaelStaHelena/fastapi-htmx-experiments.git
    cd fastapi-htmx-experiments
  2. Create a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate
  4. Install dependencies:

    pip install -r requirements.txt

Running the Project

To run the FastAPI application, use fastapi dev:

fastapi dev main.py --reload --port=8081

The application will be accessible at http://127.0.0.1:8081.

Formatting Code

Install the tools:

pip install black flake8 flake8-pyproject isort mypy

This project uses black for code formatting. To format the code, run:

black .

Linting Code

flake8 is used for linting the code. To check for linting issues, run:

flake8 .

Sorting Imports

isort is used to sort imports. To sort imports in the project, run:

isort .

Type Checking

mypy is used for type checking. To check for type issues, run:

mypy .

Running Tests

If you have tests, you can run them using pytest. To run tests, execute:

pytest

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published