Skip to content

Jason-CKY/fastapi-htmx-example

Repository files navigation

FastAPI htmx server

Dependencies

  • docker (docker-desktop if you are using windows)
  • docker-compose (comes with docker-desktop, but can install here if you are not on windows)
  • Node LTS v18

Features

demo_1.mp4
  • FastAPI web server that serves html on htmx endpoints
  • HTMX for interactivity, minimal js needed
  • Lazy loading with HTMX
  • DaisyUI with theme-changing library for CSS styling and themes
  • SortableJS for drag and drop of tasks (sorting and updates)
  • Directus for headless CMS and API routes for CRUD operations

Quickstart (development mode)

You can either start up using docker-compose:

npm ci
make build-dev
# make sure directus is up on http://localhost:8055
make initialize-db

Format on save

Refer to this link on how to install and set prettier to format on save.