{"id":22136289,"url":"https://github.com/atrakic/fastapi-htmx-azd-template","last_synced_at":"2026-03-02T13:02:57.484Z","repository":{"id":65250157,"uuid":"585147374","full_name":"atrakic/fastapi-htmx-azd-template","owner":"atrakic","description":"FastAPI for deployment on Azure Container Apps.","archived":false,"fork":false,"pushed_at":"2025-02-01T08:32:43.000Z","size":94,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T00:42:09.070Z","etag":null,"topics":["azd-templates","azure","bicep","htmx-app","python"],"latest_commit_sha":null,"homepage":"","language":"Bicep","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/atrakic.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,"zenodo":null}},"created_at":"2023-01-04T12:46:09.000Z","updated_at":"2025-05-15T19:42:25.000Z","dependencies_parsed_at":"2023-09-28T11:25:55.816Z","dependency_job_id":"953f3639-8221-4fbf-b88f-86c38f0e7bf2","html_url":"https://github.com/atrakic/fastapi-htmx-azd-template","commit_stats":null,"previous_names":[],"tags_count":9,"template":true,"template_full_name":null,"purl":"pkg:github/atrakic/fastapi-htmx-azd-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrakic%2Ffastapi-htmx-azd-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrakic%2Ffastapi-htmx-azd-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrakic%2Ffastapi-htmx-azd-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrakic%2Ffastapi-htmx-azd-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atrakic","download_url":"https://codeload.github.com/atrakic/fastapi-htmx-azd-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrakic%2Ffastapi-htmx-azd-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30003475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T12:19:43.414Z","status":"ssl_error","status_checked_at":"2026-03-02T12:19:02.215Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["azd-templates","azure","bicep","htmx-app","python"],"created_at":"2024-12-01T19:21:14.106Z","updated_at":"2026-03-02T13:02:57.456Z","avatar_url":"https://github.com/atrakic.png","language":"Bicep","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ToDo Application with a FastAPI with sqlite3 and HTMX on Azure Container apps (bicep)\n\n[![Test](https://github.com/atrakic/fastapi-htmx-azd-template/actions/workflows/test.yml/badge.svg)](https://github.com/atrakic/fastapi-htmx-azd-template/actions/workflows/test.yml)\n[![license](https://img.shields.io/github/license/atrakic/fastapi-htmx-azd-template.svg)](https://github.com/atrakic/fastapi-htmx-azd-template/blob/main/LICENSE)\n[![release](https://img.shields.io/github/release/atrakic/fastapi-htmx-azd-template/all.svg)](https://github.com/atrakic/fastapi-htmx-azd-template/releases)\n\n\nA ToDo template that includes everything you need to build, deploy, and monitor an Azure solution.\nUses the Azure Developer CLI (azd) to get you up and running on Azure quickly using Terraform as the IaC provider, Htmx for the Web application, Python (FastAPI) for the API, and Azure Monitor for monitoring and logging.\nIt includes application code, tools, and pipelines that serve as a foundation from which you can build upon and customize when creating your own solutions.\n\n### Prerequisites\n\nThe following prerequisites are required to use this application. Please ensure that you have them all installed locally.\n\n- [Azure Developer CLI](https://aka.ms/azd-install)\n- [Python (3.8+)](https://www.python.org/downloads/) - for the API backend\n- [Azure secrets](https://aka.ms/create-secrets-for-GitHub-workflows)\n\n### Quickstart\n\nThe fastest way for you to get this application up and running on Azure is to use the `azd up` command. This single command will create and configure all necessary Azure resources - including access policies and roles for your account and service-to-service communication with Managed Identities.\n\n1. Open a terminal, create a new empty folder, and change into it.\n2. Create a new [Python virtual environment](https://docs.python.org/3/library/venv.html).\n3. Run the following command to initialize the project.\n\n```bash\nazd init --template atrakic/fastapi-htmx-azd-template\n```\n\nThis command will clone the code to your current folder and prompt you for the following information:\n\n- `Environment Name`: This will be used as a prefix for the resource group that will be created to hold all Azure resources. This name should be unique within your Azure subscription.\n\n4. Run the following commands to package a deployable copy of your application, provision the template's infrastructure to Azure and also deploy the application code to those newly provisioned resources.\n\n```bash\nazd up\n```\n\nThis command will prompt you for the following information:\n\n- `Azure Location`: The Azure location where your resources will be deployed.\n- `Azure Subscription`: The Azure Subscription where your resources will be deployed.\n\n\u003e NOTE: This may take a while to complete as it executes three commands: `azd package` (packages a deployable copy of your application), `azd provision` (provisions Azure resources), and `azd deploy` (deploys application code). You will see a progress indicator as it packages, provisions and deploys your application.\n\nWhen `azd up` is complete it will output the following URLs:\n\n- Azure Portal link to view resources\n- ToDo API application\n\nClick the web application URL to launch the ToDo app. Create a new collection and add some items. This will create monitoring activity in the application that you will be able to see later when you run `azd monitor`.\n\n\u003e NOTE:\n\u003e\n\u003e - The `azd up` command will create Azure resources that will incur costs to your Azure subscription. You can clean up those resources manually via the Azure portal or with the `azd down` command.\n\u003e - You can call `azd up` as many times as you like to both provision and deploy your solution.\n\u003e - You can always create a new environment with `azd env new`.\n\n### Application Architecture\n\nThis application utilizes the following Azure resources:\n\n- [**Azure Container Apps**](https://learn.microsoft.com/en-us/azure/container-apps/overview/) to host the Web app\n\n### Application Code\n\nThe repo is structured to follow the [Azure Developer CLI](https://aka.ms/azure-dev/overview) conventions including:\n\n- **Source Code**: All application source code is located in the `src` folder.\n- **Infrastructure as Code**: All application \"infrastructure as code\" files are located in the `infra` folder.\n- **Azure Developer Configuration**: An `azure.yaml` file located in the root that ties the application source code to the Azure services defined in your \"infrastructure as code\" files.\n- **GitHub Actions**: A sample GitHub action file is located in the `.github/workflows` folder.\n\n### Azure Subscription\n\nThis template will create infrastructure and deploy code to Azure. If you don't have an Azure Subscription, you can sign up for a [free account here](https://azure.microsoft.com/free/). Make sure you have contributor role to the Azure subscription.\n\n### Azure Developer CLI - VS Code Extension\n\nThe Azure Developer experience includes an Azure Developer CLI VS Code Extension that mirrors all of the Azure Developer CLI commands into the `azure.yaml` context menu and command palette options. If you are a VS Code user, then we highly recommend installing this extension for the best experience.\n\nHere's how to install it:\n\n#### VS Code\n\n1. Click on the \"Extensions\" tab in VS Code\n1. Search for \"Azure Developer CLI\" - authored by Microsoft\n1. Click \"Install\"\n\n#### Marketplace\n\n1. Go to the [Azure Developer CLI - VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azure-dev) page\n1. Click \"Install\"\n\nOnce the extension is installed, you can press `F1`, and type \"Azure Developer CLI\" to see all of your available options. You can also right click on your project's `azure.yaml` file for a list of commands.\n\n### Next Steps\n\nAt this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.\n\n#### Set up a pipeline using `azd pipeline`\n\nThis template includes a GitHub Actions pipeline configuration file that will deploy your application whenever code is pushed to the main branch. You can find that pipeline file here: `.github/workflows`.\n\nSetting up this pipeline requires you to give GitHub permission to deploy to Azure on your behalf, which is done via a Service Principal stored in a GitHub secret named `AZURE_CREDENTIALS`. The `azd pipeline config` command will automatically create a service principal for you. The command also helps to create a private GitHub repository and pushes code to the newly created repo.\n\nBefore you call the `azd pipeline config` command, you'll need to install the following:\n\n- [GitHub CLI (2.3+)](https://github.com/cli/cli)\n\nRun the following command to set up a GitHub Action:\n\n```bash\nazd pipeline config\n```\n\n#### Monitor the application using `azd monitor`\n\nTo help with monitoring applications, the Azure Dev CLI provides a `monitor` command to help you get to the various Application Insights dashboards.\n\n- Run the following command to open the \"Overview\" dashboard:\n\n  ```bash\n  azd monitor --overview\n  ```\n\n- Live Metrics Dashboard\n\n  Run the following command to open the \"Live Metrics\" dashboard:\n\n  ```bash\n  azd monitor --live\n  ```\n\n- Logs Dashboard\n\n  Run the following command to open the \"Logs\" dashboard:\n\n  ```bash\n  azd monitor --logs\n  ```\n\n#### Clean up resources\n\nWhen you are done, you can delete all the Azure resources created with this template by running the following command:\n\n```bash\nazd down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrakic%2Ffastapi-htmx-azd-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatrakic%2Ffastapi-htmx-azd-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrakic%2Ffastapi-htmx-azd-template/lists"}