{"id":19924390,"url":"https://github.com/kontent-ai/sample-app-net","last_synced_at":"2025-04-06T07:12:40.812Z","repository":{"id":42930956,"uuid":"69871445","full_name":"kontent-ai/sample-app-net","owner":"kontent-ai","description":"Sample .NET MVC web application using the Kontent.ai Delivery .NET SDK to retrieve content","archived":false,"fork":false,"pushed_at":"2024-12-18T13:45:43.000Z","size":3563,"stargazers_count":19,"open_issues_count":4,"forks_count":65,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-30T06:05:53.408Z","etag":null,"topics":["asp-net-mvc","aspnet-mvc","content-delivery","delivery-api","dot-net-5","dotnet-5","dotnet-core","dotnet5","hacktoberfest","headless-cms","kentico-kontent","kontent-ai-sample","net5","netcore","netcore31"],"latest_commit_sha":null,"homepage":"https://docs.kontent.ai/tutorials/develop-apps?tech=dotnet","language":"Less","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/kontent-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-03T13:08:14.000Z","updated_at":"2024-12-18T13:45:48.000Z","dependencies_parsed_at":"2024-12-18T14:43:28.643Z","dependency_job_id":"0b65f74f-1427-47ed-b696-4044594176ff","html_url":"https://github.com/kontent-ai/sample-app-net","commit_stats":{"total_commits":364,"total_committers":42,"mean_commits":8.666666666666666,"dds":0.6730769230769231,"last_synced_commit":"b78840293a6f48b2522607ad79f3057e2446e5ff"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fsample-app-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fsample-app-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fsample-app-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Fsample-app-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kontent-ai","download_url":"https://codeload.github.com/kontent-ai/sample-app-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"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":["asp-net-mvc","aspnet-mvc","content-delivery","delivery-api","dot-net-5","dotnet-5","dotnet-core","dotnet5","hacktoberfest","headless-cms","kentico-kontent","kontent-ai-sample","net5","netcore","netcore31"],"created_at":"2024-11-12T22:17:16.551Z","updated_at":"2025-04-06T07:12:40.790Z","avatar_url":"https://github.com/kontent-ai.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\r\n\u003e This sample app relies on the Dancing Goat project, which is no longer available for creation in Kontent.ai.\r\n\u003e\r\n\u003e If you still wish to use this project, you can import the Dancing Goat project using the [Data Ops](https://github.com/kontent-ai/data-ops) tool by following the instructions provided in our [Dancing Goat repository](https://github.com/kontent-ai-bot/dancing-goat).\r\n\r\n\r\n# Kontent.ai sample ASP.NET Core MVC web application\r\n\r\n[![Build \u0026 Test](https://github.com/kontent-ai/sample-app-net/actions/workflows/integrate.yml/badge.svg)](https://github.com/kontent-ai/sample-app-net/actions/workflows/integrate.yml)\r\n[![codecov](https://codecov.io/gh/kontent-ai/sample-app-net/branch/master/graph/badge.svg?token=X90Anf22sl)](https://codecov.io/gh/kontent-ai/sample-app-net)\r\n[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow\u0026logoColor=white)](https://stackoverflow.com/tags/kontent-ai)\r\n[![Discord](https://img.shields.io/discord/821885171984891914?label=Discord\u0026logo=Discord\u0026logoColor=white)](https://discord.gg/SKCxwPtevJ)\r\n\r\nThis is a sample ASP.NET Core MVC app that uses the [Kontent.ai Delivery .NET SDK](https://github.com/kontent-ai/delivery-sdk-net) to retrieve content from [Kontent.ai](https://kontent.ai).\r\n\r\n## Getting started\r\n\r\nTo run the app:\r\n\r\n1. Clone the app repository\r\n2. Run `npm install \u0026\u0026 npm run build` in the `DancingGoat` directory to build CSS files for the project ([node.js](https://nodejs.org/) must be installed before running this command)\r\n3. Open the `DancingGoat.sln` solution file and run the app\r\n4. Follow the setup wizard to setup your project or adjust the `\\DancingGoat\\appsettings.json` file:\r\n\r\n   ```jsonc\r\n   {\r\n     // ...\r\n     \"DeliveryOptions\": {\r\n       \"ProjectId\": \"YOUR_PROJECT_ID\"\r\n     }\r\n     // ...\r\n   }\r\n   ```\r\n\r\n\u003e Follow the [step-by-step tutorial](https://kontent.ai/learn/tutorials/develop-apps/get-started/run-sample-app?tech=dotnet) for even more details.\r\n\r\n## Features\r\n\r\n### Model generation\r\n\r\nWith the help of [Kontent.ai model generator](https://github.com/kontent-ai/model-generator-net) you can generate models from your project. This process will create classes that you can work with within your codebase. To run the generation, use the Powershell script [./DancingGoat/Tools/GenerateModels.ps1](https://github.com/kontent-ai/sample-app-net/blob/master/DancingGoat/Tools/GenerateModels.ps1) or Bash script [./DancingGoat/Tools/GenerateModels.sh](https://github.com/kontent-ai/sample-app-net/blob/master/DancingGoat/Tools/GenerateModels.sh).\r\n\r\n\r\n\u003e Be aware that by default, the scripts downloads the models from the default Dancing Goat project. If you want to download models from your custom project, change the project id inside the script file.\r\n\r\n### Edit mode \u0026 preview\r\n\r\nContent contributors sometimes need to fix errors or typos right when they see them on the website. The sample app allows users to navigate from a piece of content on the site straight to the corresponding content item or element in Kontent.ai.\r\n\r\nTo see Edit mode in action:\r\n\r\n1. In your Kontent.ai project navigate to Project Settings -\u003e API keys to get the Preview API key. \r\n2. Enable Delivery Preview API by adding the key to the `\\DancingGoat\\appsettings.json` file:\r\n\r\n   ```jsonc\r\n   {\r\n     // ...\r\n     \"DeliveryOptions\": {\r\n       \"UsePreviewApi\": true,\r\n       \"PreviewApiKey\": \"YOUR_DELIVERY_PREVIEW_API_KEY\"\r\n     }\r\n     // ...\r\n   }\r\n   ```\r\n\r\n   - **Delivery Preview API**: change the key named `PreviewApiKey` in the `DeliveryOptions` section, and use the Delivery Preview API key as its value. To enable calls over the Delivery Preview API, you also need to change the value to `true` of the key named `UsePreviewApi`.\r\n\r\n3. Run the app.\r\n4. Navigate to the **About us** section.\r\n5. Click the **Edit mode** switch in the bottom-left corner.\r\n\r\nEdit buttons will appear next to each piece of content on the page.\r\nTo explore how the functionality is implemented, navigate to the [`TagHelpers`](https://github.com/kontent-ai/sample-app-net/tree/master/DancingGoat/TagHelpers) folder.\r\n\r\n### Responsive images\r\n\r\nThe sample app contains a sample implementation of the `img-asset` tag helper from the [Kontent.Ai.AspNetCore](https://www.nuget.org/packages/Kontent.Ai.AspNetCore) NuGet package. Using the `img-asset` tag helper, you can easily create an `img` tag with `srcset` and `sizes` attributes. Read more about [image transformation API](https://kontent.ai/learn/reference/image-transformation).\r\nYou can adjust the behaviour in the `appsettings.json` file.\r\n\r\n```json\r\n\"ImageTransformationOptions\": {\r\n  \"ResponsiveWidths\": [ 200, 400, 600, 800, 1000, 1200, 1400, 1600, 2000, 4000 ]\r\n},\r\n```\r\n\r\n### Localized routing\r\n\r\nThe app demonstrates the usage of language prefixes (e.g. `/en-US/articles`) for localizing URLs for SEO purposes. Each language is identified by its codename, in case of this project, it is `en-US` and `es-ES`.\r\nThe used language is obtained from the URL via `/DancingGoat/Infrastructure/RouteRequestCultureProvider` and set as the culture of the app.\r\n## Get involved\r\n\r\nCheck out the [contributing](CONTRIBUTING.md) page to see the best places to file issues, start discussions, and begin contributing.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Fsample-app-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkontent-ai%2Fsample-app-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Fsample-app-net/lists"}