Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.71 KB

File metadata and controls

56 lines (39 loc) · 1.71 KB

Python Advice Generator

Python FastAPI HTMX Tailwind Jinja2 httpx API Render

Interactive random advice generator with instant results

Fetches fresh advice asynchronously via an external API — no page reload needed.


Endpoints

Path Method Description
/ GET Main page with initial advice
/advice GET Returns a new advice card (HTMX partial)
/api/advice GET Returns raw advice JSON (your own internal API endpoint)

Advice Source

The app fetches advice from the public API:

https://api.adviceslip.com/advice

Handled inside fetch_advice() using httpx.AsyncClient.
You can replace this URL with any other advice source if desired.


Features

  • Get fresh advice instantly (HTMX partial updates)
  • Fully async API fetching (httpx + FastAPI)
  • Beautiful responsive UI (Tailwind)
  • Separate JSON API: /api/advice

Technology Stack

  • Python 3.12
  • FastAPI
  • httpx (async API client)
  • Jinja2
  • HTMX
  • Tailwind CSS
  • Render.com