{"id":16019665,"url":"https://github.com/tofran/fastapi-htmx-full-text-search-demo","last_synced_at":"2026-01-22T02:04:23.134Z","repository":{"id":230642683,"uuid":"770414729","full_name":"tofran/fastapi-htmx-full-text-search-demo","owner":"tofran","description":"🔎 Python FastAPI HTMX full-text-search demo using SQLite FTS5 and Algolia search.","archived":false,"fork":false,"pushed_at":"2024-09-26T16:32:50.000Z","size":391,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T01:06:09.541Z","etag":null,"topics":["algolia","fastapi","htmx","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tofran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-11T14:09:29.000Z","updated_at":"2024-09-26T16:32:54.000Z","dependencies_parsed_at":"2024-03-31T04:21:39.769Z","dependency_job_id":"4d97d7c6-6741-403e-aaa6-a30aa04ab284","html_url":"https://github.com/tofran/fastapi-htmx-full-text-search-demo","commit_stats":null,"previous_names":["tofran/fastapi-htmx-full-text-search-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tofran/fastapi-htmx-full-text-search-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofran%2Ffastapi-htmx-full-text-search-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofran%2Ffastapi-htmx-full-text-search-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofran%2Ffastapi-htmx-full-text-search-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofran%2Ffastapi-htmx-full-text-search-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tofran","download_url":"https://codeload.github.com/tofran/fastapi-htmx-full-text-search-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofran%2Ffastapi-htmx-full-text-search-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28650630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algolia","fastapi","htmx","sqlite"],"created_at":"2024-10-08T17:05:04.421Z","updated_at":"2026-01-22T02:04:23.117Z","avatar_url":"https://github.com/tofran.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python FastAPI HTMX full-text-search demo\n\nThis project is a **demo** full-text-search application that compares the results from\n[SQLite FT5](https://www.sqlite.org/fts5.html) and \n[Algolia Search platform](https://www.algolia.com/).\n \nConceived as an experimental venture, this project serves as a demonstration of an *unconventional*\nmonolith tech stack. It features an interactive front-end, using a mix of traditional\nServer Side Rendering (SSR) declarative web framework with zero custom JS:\n\n- [FastAPI](https://fastapi.tiangolo.com/) the server framework;\n- [Jinja](https://jinja.palletsprojects.com/) for the SSR templating;\n- [HTMX](https://htmx.org/) to enable front-end interactivity declaratively directly in the HTML.\n\n## Description and demo\n\n**[Live demo](https://full-text-search-demo.tofran.com/)**\n(the server goes to sleep, give at least 30s for a cold start)\n\nhttps://github.com/tofran/fastapi-htmx-full-text-search-demo/assets/5692603/43d642fd-52d5-4e5b-836a-6609d0c3d782\n\nThe outcome of this project is something very simple and minimal. The served content is **tiny** and\n**fast**. There's no initial loading, everything is pre-rendered on the server, and each API request\nrenders HTML that is injected into the DOM - no need for Hydration, Resumability nor even data\nserialization. It is compatible with most browsers, all the way back to IE11, where it struggles a\nlittle with style, but *works*.\n\n![OpenAPI spec (swagger)](https://github.com/tofran/fastapi-htmx-full-text-search-demo/assets/5692603/541f1f1a-fe1d-475c-8723-8f5a13e8f0df)\n\nThe application works by serving a full rendered Jinja HTML template when the user navigates to a\nFront-End route.\nThese templates are composed via smaller reusable templates (using `include`).\nAnd then the templates (*components*) are also served, de-coupled from the whole page in the\n*HTML API* (`/html-api/...`).\nHTMX handles the rest, listens to DOM events and updates it when when necessary.\n\n![Example HTML API request/response](https://github.com/tofran/fastapi-htmx-full-text-search-demo/assets/5692603/8e1aa2a0-53dd-443a-a1d2-caee11cad65c)\n\n## Development\n\n- Create a `.env` file based on the `.env.template`.  \n  You will need an Algolia account, more info in their\n  [Quick start guide](https://www.algolia.com/doc/guides/getting-started/quick-start/).  \n  More information about the env vars can be found in `./text_search_app/config.py`\n\n- Setup a local environment with `make setup-venv`,\n  activate it with `source ./venv/bin/activate`\n  (or with your favourite tool).\n  \n- Install dependencies: `make install-dev`.\n\n- Start the development server: `make dev`.\n\n## Deployment\n\nFor deployment one would use the `./Dockerfile` and set the required environment variables.\n\nFor running locally a production like build, install the dependencies with `make install`\nand run the application with `make start`. That's it.\n\n## Uploading a dataset\n\nTo keep this repository clean, no sample data is provided. \nYou can upload your own data via the `/index/upload-csv` endpoint.\nInformation about the supported CSV columns available in the Swagger UI (`/docs`).\n\nRecommended datasets (adapt column names when needed):\n\n  - [Zara Products on Kaggle](https://www.kaggle.com/datasets/maparla/zara-products)\n  - [Amazon Products Dataset 2023 on Kaggle](https://www.kaggle.com/datasets/asaniczka/amazon-products-dataset-2023-1-4m-products/)\n\n## License \n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofran%2Ffastapi-htmx-full-text-search-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftofran%2Ffastapi-htmx-full-text-search-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofran%2Ffastapi-htmx-full-text-search-demo/lists"}