{"id":13642175,"url":"https://github.com/tataraba/simplesite","last_synced_at":"2025-04-20T16:30:38.688Z","repository":{"id":150906130,"uuid":"606898154","full_name":"tataraba/simplesite","owner":"tataraba","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-13T05:05:19.000Z","size":7073,"stargazers_count":94,"open_issues_count":6,"forks_count":17,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-03T01:25:49.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tataraba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-26T21:46:32.000Z","updated_at":"2024-07-22T20:24:42.000Z","dependencies_parsed_at":"2024-01-07T00:06:59.998Z","dependency_job_id":null,"html_url":"https://github.com/tataraba/simplesite","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tataraba%2Fsimplesite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tataraba%2Fsimplesite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tataraba%2Fsimplesite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tataraba%2Fsimplesite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tataraba","download_url":"https://codeload.github.com/tataraba/simplesite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223832846,"owners_count":17210724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-02T01:01:28.195Z","updated_at":"2024-11-09T13:30:43.676Z","avatar_url":"https://github.com/tataraba.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003eSimple Site\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003eFeaturing htmx and TailwindCSS\u003c/h2\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\n[![GitHub Issues](https://img.shields.io/github/issues/tataraba/simplesite)](https://github.com/tataraba/simplesite/issues)\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/tataraba/simplesite)](https://github.com/tataraba/simplesite/pulls)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e Create a Python-backed frontend with FastAPI, htmx, and TailwindCSS. Build it from scratch and follow the guide. Alternatively, clone the repo/use the template, or better yet, spin up a Codespace and start right away!\n    \u003cbr\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\n \u003cimg width=400px height=400px src=\"https://github.com/tataraba/simplesite/blob/main/assets/simple-site-demo.gif\" alt=\"Project demo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 📝 Table of Contents\n\n- [📝 Table of Contents](#-table-of-contents)\n- [🧐 About ](#-about-)\n- [🏁 Getting Started ](#-getting-started-)\n  - [Prerequisites](#prerequisites)\n  - [Installing](#installing)\n    - [Using Codespaces](#using-codespaces)\n    - [Locally](#locally)\n- [🔧 Running the tests ](#-running-the-tests-)\n- [🚗 💨 Need to Catch Up?](#--need-to-catch-up)\n- [🎈 Guide ](#-guide-)\n  - [:sparkles:Build a Python-Backed Frontend With HTMX and TailwindCSS:sparkles:](#sparklesbuild-a-python-backed-frontend-with-htmx-and-tailwindcsssparkles)\n- [⛏️ Built Using ](#️-built-using-)\n- [✍️ Authors ](#️-authors-)\n- [🎉 Acknowledgements ](#-acknowledgements-)\n\n## 🧐 About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nBuild a beautiful web application using nothing more than Python, htmx, and TailwindCSS. Harness the power of Jinja templates and server-side rendering to create a dynamic, REST-ful web app.\n\n## 🏁 Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\nThis repository was prepared for a workshop on how to create a python-backed frontend, featuring Jinja templates for HTML rendering, TailwindCSS for style, and htmx for pizzazz! 😎\n\nThe workshop consists of [four chapters](#-guide-), each introducing an additional tool on the road to creating a beautiful* Python-backed frontend.\n\n\u003e *Note: Beauty is in the eye of the beholder.\n\n### Prerequisites\n\nThe example app was created with **Python 3.11**, but it is likely compatible with earlier versions. However, I would highly recommend using the latest version of Python. The rest of the dependencies are listed in the `requirements.txt` file.\n\n```\nfastapi[all]\njinja2\njinja2-fragments\npython-multipart\npytest\npytailwindcss\ntinydb\n```\n\nThe `fastapi[all]` dependency installs some other optional dependencies and features. It also includes `uvicorn`, which is used as the server to run your code. (You could choose to just use `fastapi` and `uvicorn[standard]` separately, if you prefer.)\n\n\u003e Why is there a `pyproject.toml` file? If you use a package manager (i.e., I use `pdm`), you can use your package manager to install dependencies. Otherwise, you can go the more traditional route using the `requirements.txt` file. If you use Codespaces, you won't need to worry about dependencies!\n\n### Installing\n\n#### Using Codespaces\nPress the `\u003c\u003e Code` button above and select `Create a Codespace on main`. This will open a new window in your browser, where you can run the code in a virtual environment.\n\nhttps://user-images.githubusercontent.com/8632637/228152014-a73297f5-dfd7-400c-96b1-17239dcdb633.mp4\n\n#### Locally\nCreate a copy of the repo using the `Use this template` button above. Select `Create a new repository`.\n\n\u003e **Warning**\n\u003e Be sure to select **`Include all branches`** when cloning the repo.\n\nAfter cloning or using this template, you will need to create a virtual environment. Navigate to the location where you have cloned the project (your project root) and run the following command in your terminal:\n\n```\npython -m venv .venv\n```\n\nThis will create a `.venv` directory within your project.\n\nNext, activate your environment:\n\n```\n# On Windows\n.\\.venv\\Scripts\\activate\n\n# On MacOS/Linux\n$ source .venv/bin/activate\n```\n\nThen, install the requirements:\n\n```\npython -m pip install -r requirements.txt\n```\n\n## 🔧 Running the tests \u003ca name = \"tests\"\u003e\u003c/a\u003e\n\nAfter activating your virtual environment, you can run tests by typing `pytest` on the command line. This makes sure that your application runs and can generate a \"Hello World\" message.\n\n```\npytest\n```\n\nIf everything has gone well so far, all tests should pass.\n\n## 🚗 💨 Need to Catch Up?\nIf you are using Codespaces, there is a script you can use to catch up to the current chapter. Just run the following command in your terminal and choose the section we're on:\n\n```shell\n. catchup.sh\n```\n\nhttps://user-images.githubusercontent.com/8632637/228153775-a3ca38fa-c467-402d-bf60-5c55b0f9b9e9.mp4\n\nOr (if you're developing locally) to catch up **manually**...\n\n\nCheckout the branch that corresponds to the appropriate section (see below).\n\n## 🎈 Guide \u003ca name=\"guide\"\u003e\u003c/a\u003e\n\nThis repo was created primarily to aid in a workshop setting, so your mileage may vary. Feel free to clone it and make it your own. But most of all, have fun! 🥳\n\nTo take a more structured approach, you can follow sequentially with the accompanying markdown files for each branch of the repo.\n\nThese Chapters are all located in the \"docs\" directory. The direct links to the corresponding chapters are listed here for convenience.\n\n### :sparkles:Build a Python-Backed Frontend With HTMX and TailwindCSS:sparkles:\n\n| Chapter | Title | Branch\n| --- | --- | --- |\n| Preface | [Getting Started](https://github.com/tataraba/simplesite/blob/main/docs/00_Preface.md) | [`main`](https://github.com/tataraba/simplesite) |\n| Chapter 1 | [Using Jinja Templates to Render HTML](https://github.com/tataraba/simplesite/blob/main/docs/01_Chapter_1.md) | [`01_templates`](https://github.com/tataraba/simplesite/tree/01_templates) |\n| Chapter 2 | [Harnessing TailwindCSS for Consistent Design](https://github.com/tataraba/simplesite/blob/main/docs/02_Chapter_2.md) | [`02_tailwindcss`](https://github.com/tataraba/simplesite/tree/02_tailwindcss) |\n| Chapter 3 | [A Thin Database Layer](https://github.com/tataraba/simplesite/blob/main/docs/03_Chapter_3.md) | [`03_tinydb`](https://github.com/tataraba/simplesite/tree/03_tinydb) |\n| Chapter 4 | [Modern Browser Features Directly from HTML](https://github.com/tataraba/simplesite/blob/main/docs/04_Chapter_4.md) | [`04_htmx`](https://github.com/tataraba/simplesite/tree/04_htmx)  |\n\n## ⛏️ Built Using \u003ca name = \"built_using\"\u003e\u003c/a\u003e\n\n- FastAPI\n- Jinja2\n- TailwindCSS\n- TinyDB\n- htmx\n\n## ✍️ Authors \u003ca name = \"authors\"\u003e\u003c/a\u003e\n\n- [@tataraba](https://github.com/tataraba) - Mario Munoz, _Python By Night_\n\n## 🎉 Acknowledgements \u003ca name = \"acknowledgement\"\u003e\u003c/a\u003e\n\n- [@kjaymiller](https://github.com/kjaymiller) - Jay Miller, _Senior Cloud Advocate-Python_, Microsoft\n","funding_links":[],"categories":["Introductory Resources 🔰","Python"],"sub_categories":["But Will it Work in Production?"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftataraba%2Fsimplesite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftataraba%2Fsimplesite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftataraba%2Fsimplesite/lists"}