This project is a web-based tool for annotating LLM-generated text, built using FastHTML, HTMX, and Tailwind CSS, originally built by Alex Volkov in the fasthtml-examples repo
The app uses FastHTML to define routes and handle annotation logic on the server. Key routes include:
/: The main page that renders the initial annotation interface./{idx}: Handles both GET and POST requests for specific annotation items.The app state is managed server-side using a SQLite database:
texts_db: Stores annotation items, including messages, feedback, and notes.total_items_length: Tracks the total number of items in the database.HTMX is used extensively to create a dynamic user interface:
hx-post attributes on forms trigger POST requests to update annotations.hx-get attributes on navigation buttons load new items.hx-swap determines how the new content should replace the old content, using outerHTML to replace entire elements.This app demonstrates the power of combining FastHTML, HTMX, and Tailwind CSS to create a responsive and efficient web application for text annotation tasks.