📝 Demo Form

This form demonstrates the complete data flow: from HTML form → FastAPI backend → PostgreSQL database. Perfect starting point for your hackathon project!

We'll use this for the database demo - no spam, promise!
Share your thoughts, ideas, or feedback about this template
🔧 What happens when you submit:
  • HTMX sends form data via AJAX
  • FastAPI validates input with Pydantic
  • SQLAlchemy saves to PostgreSQL
  • Success message displays dynamically

💻 Code Example

Frontend (HTMX)
<form hx-post="/submit" 
      hx-swap="outerHTML">
  <input name="email" type="email">
  <button type="submit">Submit</button>
</form>
Backend (FastAPI)
@router.post("/submit")
async def create_user(
    email: str = Form(...),
    db: Session = Depends(get_db)
):
    user = User(email=email)
    db.add(user)
    db.commit()
    return response