{"id":21600583,"url":"https://github.com/davidfowl/TodoApp","last_synced_at":"2025-07-17T04:30:47.710Z","repository":{"id":43351938,"uuid":"364304792","full_name":"davidfowl/TodoApp","owner":"davidfowl","description":"Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication ","archived":false,"fork":false,"pushed_at":"2025-01-11T23:44:14.000Z","size":1172,"stargazers_count":3033,"open_issues_count":4,"forks_count":449,"subscribers_count":74,"default_branch":"main","last_synced_at":"2025-07-14T06:38:54.416Z","etag":null,"topics":["aspnetcore","authentication","blazor","cookies","dotnet-core","jwt","opentelemetry","rest-api","webassembly"],"latest_commit_sha":null,"homepage":"","language":"C#","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/davidfowl.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":"2021-05-04T15:37:57.000Z","updated_at":"2025-07-13T06:42:26.000Z","dependencies_parsed_at":"2024-11-23T08:18:55.406Z","dependency_job_id":"f2b76c85-479d-4804-be12-5172094c0698","html_url":"https://github.com/davidfowl/TodoApp","commit_stats":{"total_commits":185,"total_committers":19,"mean_commits":9.736842105263158,"dds":0.1837837837837838,"last_synced_commit":"c209f6ae5c5f31f4808b0df85f358d4a572ea770"},"previous_names":["davidfowl/todoapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidfowl/TodoApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FTodoApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FTodoApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FTodoApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FTodoApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfowl","download_url":"https://codeload.github.com/davidfowl/TodoApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FTodoApp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265564807,"owners_count":23788920,"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":["aspnetcore","authentication","blazor","cookies","dotnet-core","jwt","opentelemetry","rest-api","webassembly"],"created_at":"2024-11-24T19:01:01.022Z","updated_at":"2025-07-17T04:30:47.705Z","avatar_url":"https://github.com/davidfowl.png","language":"C#","readme":"## Todo application with ASP.NET Core\n\n[![CI](https://github.com/davidfowl/TodoApp/actions/workflows/ci.yaml/badge.svg)](https://github.com/davidfowl/TodoApi/actions/workflows/ci.yaml)\n\nThis is a Todo application that features:\n- [**Todo.Web**](Todo.Web) - An ASP.NET Core hosted Blazor WASM front end application\n- [**Todo.Api**](Todo.Api) - An ASP.NET Core REST API backend using minimal APIs\n\n![image](https://user-images.githubusercontent.com/95136/204161352-bc54ccb7-32cf-49ba-a6f7-f46d0f2d204f.png)\n\nIt showcases:\n- Blazor WebAssembly\n- Minimal APIs\n- Using EntityFramework and SQLite for data access\n- OpenAPI\n- User management with ASP.NET Core Identity\n- Cookie authentication\n- Bearer authentication\n- Proxying requests from the front end application server using YARP's IHttpForwarder\n- Rate Limiting\n- Writing integration tests for your REST API\n\n## Prerequisites\n\n### .NET\n1. [Install .NET 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)\n\n### Database\n\nThe application uses SQLite and entity framework. .NET Aspire is used to bootstrap all dependencies.\n\n### Running the application\n\nTo run the application, run the [TodoApp.AppHost](TodoApp.AppHost) project. This uses .NET Aspire to run both the [Todo.Web/Server](Todo.Web/Server) and [Todo.Api](Todo.Api).\n\n## Optional\n\n### Using the API standalone\nThe Todo REST API can run standalone as well. You can run the [Todo.Api](Todo.Api) project and make requests to various endpoints using the Swagger UI (or a client of your choice):\n\n\u003cimg width=\"1200\" alt=\"image\" src=\"https://user-images.githubusercontent.com/95136/204315486-86d25a5f-1164-467a-9891-827343b9f0e8.png\"\u003e\n\nBefore executing any requests, you need to create a user and get an auth token.\n\n1. To create a new user, run the application and POST a JSON payload to `/users/register` endpoint:\n\n    ```json\n    {\n      \"email\": \"myuser@contoso.com\",\n      \"password\": \"\u003cput a password here\u003e\"\n    }\n    ```\n1. To get a token for the above user, hit the `/users/login` endpoint with the above user email and password. The response will look like this:\n\n    ```json\n    {\n      \"tokenType\": \"Bearer\",\n      \"accessToken\": \"string\",\n      \"expiresIn\": \u003cseconds\u003e,\n      \"refreshToken\": \"string\"\n    }\n    ```\n\n1. You should be able to use the accessToken to make authenticated requests to the todo endpoints.\n\n### Social authentication\n\nIn addition to username and password, social authentication providers can be configured to work with this todo application. By default \nit supports Github, Google, and Microsoft accounts.\n\nInstructions for setting up each of these providers can be found at:\n- [Github](https://docs.github.com/en/developers/apps/building-oauth-apps)\n- [Microsoft](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/microsoft-logins)\n- [Google](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins)\n\nOnce you obtain the client id and client secret, the configuration for these providers must be added with the following schema:\n\n```JSON\n{\n    \"Authentication\": {\n        \"Schemes\": {\n            \"\u003cscheme\u003e\": {\n                \"ClientId\": \"xxx\",\n                \"ClientSecret\": \"xxxx\"\n            }\n        }\n    }\n}\n```\n\nOr using environment variables:\n\n```\nAuthentication__Schemes__\u003cscheme\u003e__ClientId=xxx\nAuthentication__Schemes__\u003cscheme\u003e__ClientSecret=xxx\n```\n\nOr using user secrets:\n\n```\ndotnet user-secrets set Authentication:Schemes:\u003cscheme\u003e:ClientId xxx\ndotnet user-secrets set Authentication:Schemes:\u003cscheme\u003e:ClientSecret xxx\n```\n\nOther providers can be found [here](https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers#providers). \nThese must be added to [AuthenticationExtensions](Todo.Web/Server/Authentication/AuthenticationExtensions.cs) as well.\n\n**NOTE: Don't store client secrets in configuration!**\n\n#### Auth0\n\nThis sample has **Auth0** configured as an OIDC server. It can be configured with the following schema:\n\n```JSON\n{\n  \"Authentication\": {\n    \"Schemes\": {\n      \"Auth0\": {\n        \"Audience\": \"\u003caudience\u003e\",\n        \"Domain\": \"\u003cdomain\u003e\",\n        \"ClientId\": \"\u003cclient id\u003e\",\n        \"ClientSecret\": \"\u003cclient secret\u003e\"\n      }\n    }\n  }\n}\n```\n\nLearn more about the Auth0 .NET SDK [here](https://github.com/auth0/auth0-aspnetcore-authentication).\n\n### OpenTelemetry\n\nThis app uses OpenTelemetry to collect logs, metrics and spans. You can see this\nusing the [Aspire Dashboard](https://aspiredashboard.com/).\n","funding_links":[],"categories":["rest-api","C#","C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfowl%2FTodoApp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfowl%2FTodoApp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfowl%2FTodoApp/lists"}