{"id":24563707,"url":"https://github.com/mildronize/reaction","last_synced_at":"2025-03-17T00:24:43.143Z","repository":{"id":269245991,"uuid":"906844311","full_name":"mildronize/reaction","owner":"mildronize","description":"isunjn/reaction in Azure, Zola-theme-serene's anonymous reaction api endpoint","archived":false,"fork":false,"pushed_at":"2024-12-24T02:53:39.000Z","size":747,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T10:15:16.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mildronize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-22T04:30:23.000Z","updated_at":"2024-12-24T02:53:42.000Z","dependencies_parsed_at":"2024-12-22T05:25:12.790Z","dependency_job_id":"7d1377a5-4e03-4a3f-995c-9c825c1109f2","html_url":"https://github.com/mildronize/reaction","commit_stats":null,"previous_names":["mildronize/reaction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Freaction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Freaction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Freaction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Freaction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mildronize","download_url":"https://codeload.github.com/mildronize/reaction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243951704,"owners_count":20373781,"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":"2025-01-23T10:15:20.614Z","updated_at":"2025-03-17T00:24:43.095Z","avatar_url":"https://github.com/mildronize.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reaction\n\nThis project is a reimplementation of [isunjn/reaction](https://github.com/isunjn/reaction) on Azure, designed to support Zola-theme-serene's anonymous reaction API endpoint.\n\nWith this setup, you can deploy your own reaction endpoint on Azure.\n\n**Cost**: For low-traffic sites, it should be free or cost less than $1 per month (primarily for [Azure Functions](https://azure.microsoft.com/en-us/services/functions) and [Azure Storage Table](https://learn.microsoft.com/en-us/azure/storage/tables/table-storage-overview)).\n\n## Stack\n\n- Server Framework: [Hono](https://hono.dev)\n- Server Environment: [Azure Functions](https://azure.microsoft.com/en-us/services/functions)\n- Database: [Azure Storage Table](https://learn.microsoft.com/en-us/azure/storage/tables/table-storage-overview)\n\n## Prerequisites\n\n- A Azure account\n- Have `node` (alone with `npm` and `npx`) installed\n- Have `pnpm` installed, you can install it by running `npm install -g pnpm` (Note: `pnpm` cannot be use with Azure Functions Windows, you need to use Azure Functions Linux)\n\n## Instructions\n\n1. Use this template to create a new repository of your own\n\n2. Clone your repository to your local machine\n\n3. Run `yarn install`\n\n4. Config the environment variables in `.env` (you can copy `.env.example` to `.env` and fill in the values):\n    ```bash\n    EMOJIS=[\"👍\", \"👀\", \"😠\"]\n    ORIGINS=[\"*\"]\n    AZURE_TABLE_CONNECTION_STRING=\u003cyour-azure-storage-table-connection-string\u003e\n    ```\n\n5. Deploy the worker\n    - Make sure you created [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-function-app-portal?pivots=programming-language-typescript) and Azure Storage Accounts, bassically Storage Account will be created automatically when you create Azure Functions and Azure Storage Table is one of the services in Azure Storage Account.\n    - Run `func azure functionapp publish \u003cyour-function-app-name\u003e`\n    - Your deployed endpoint will be available at `https://\u003cyour-function-app-name\u003e.azurewebsites.net`\n\n6. Config CORS on Azure Functions\n    - Go to your Azure Functions in the Azure Portal\n    - Click on `CORS` Left Menu\n    - Add your `\u003cFrontend URL\u003e` to the allowed origins\n    ![CORS](./docs/cors-in-azure-functions.jpg)\n\n7. In your zola site's `config.toml`:\n    ```toml\n    reaction = true\n    reaction_align = \"right\"\n    reaction_endpoint = \"https://\u003cyour-function-app-name\u003e.azurewebsites.net/api\"\n    ```\n## Examples\n\n- You can see the full example at my blog: https://github.com/mildronize/blog-v8\n\n## Notes\n\n- For detailed setup instructions, refer to the Azure documentation:\n    - [Azure Functions Documentation](https://learn.microsoft.com/en-us/azure/azure-functions/)\n    - [Azure Storage Table Overview](https://learn.microsoft.com/en-us/azure/storage/tables/table-storage-overview)\n\nFeel free to open issues or contribute improvements!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildronize%2Freaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmildronize%2Freaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildronize%2Freaction/lists"}