Skip to content

volfpeter/lipsum-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lipsum chat

This project is a technology demonstration for server-side rendering with Python, FastAPI, and htmx; in the disguise of an AI chatbot that responds to questions about beer and coffee. More specifically the project showcases the following libraries:

  • FastAPI: A modern, async, Python web framework.
  • FastHX: Server-side rendering utility with HTMX support for FastAPI.
  • htmy: A powerful, async, pure-Python server-side rendering engine.
  • htmx: A JavaScript library for making AJAX requests and DOM updates using HTML attributes.

Importantly, the project does not use Jinja or any other traditional templating engine. Instead, it uses htmy – in some cases with plain html and markdown snippets with no custom templating syntax –, so you can enjoy all the benefits of modern IDEs, linters, static code analysis tools, and coding assistants.

Styling is done with TailwindCSS v4 and DaisyUI v5, but the project is not a TailwindCSS or DaisyUI demo, the focus is entirely on server-side rendering.

Support

Need help kickstarting a new project with this or a similar toolchain? Get in touch!

Getting started

For a seamless experience, you need uv to be installed. If not available, you can find the required dependencies in pyproject.toml.

With uv in place, all you need to do is run uv run uvicorn app.main:app --reload and open http://127.0.0.1:8000/ in your browser.

uv run tools:

  • Linting: ruff check . or ruff check . --fix
  • Formatting: ruff format . or ruff format . --check for format check.
  • Static type analysis: uv run mypy .

poethepoet is a development dependency of the project. You can check available tasks by running uv run poe.

Deployment

vercel.json contains the configuration for deployment on Vercel.

The Vercel Python runtime only supports requirements.txt. The requirements file can be generated with uv export --no-dev > requirements.txt. It must be done manually before every push to the main branch.

The Vercel Python runtime is experimental at this time (March 2025), so this config may become outdated relatively soon.

Similar projects

License - MIT

The package is open-sourced under the conditions of the MIT license.

About

Technology demonstration for server-side rendering with Python, FastAPI, and htmx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published