All Projects → Kentico → kontent-boilerplate-net

Kentico / kontent-boilerplate-net

Licence: MIT license
Kontent.ai Boilerplate for development of ASP.NET Core MVC applications.

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to kontent-boilerplate-net

Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+17555.17%)
Mutual labels:  visual-studio, aspnet-core, asp-net-core
Professionalcsharp7
Code samples for the book Professional C# 7 and .NET Core 2.0 (with updates for 2.1), Wrox Press
Stars: ✭ 403 (+1289.66%)
Mutual labels:  visual-studio, asp-net-core
AspNet-Core-REST-Service
VS2017/VS2019 project template for ASP.Net Core 3.1/5.0 to create fully functional production ready RESTful services
Stars: ✭ 57 (+96.55%)
Mutual labels:  visual-studio, asp-net-core
Opentouryo
”Open棟梁”は、長年の.NETアプリケーション開発実績にて蓄積したノウハウに基づき開発した.NET用アプリケーション フレームワークです。 (”OpenTouryo” , is an application framework for .NET which was developed using the accumulated know-how with a long track record in .NET application development.)
Stars: ✭ 233 (+703.45%)
Mutual labels:  visual-studio, mvc
jQuery-datatable-server-side-net-core
A simple Visual Studio solution using jQuery DataTable with Server-Side processing using .NET 5
Stars: ✭ 71 (+144.83%)
Mutual labels:  visual-studio, asp-net-core
CleanArchitectureDemo
This is a demo project built on .NET Core 3.1 Clean Architecture. Please refer the articles mentioned in the readme to learn more.
Stars: ✭ 33 (+13.79%)
Mutual labels:  visual-studio, asp-net-core
Angularwebpackvisualstudio
Template for ASP.NET Core, Angular with Webpack and Visual Studio
Stars: ✭ 497 (+1613.79%)
Mutual labels:  visual-studio, aspnet-core
WebAPI2CLI
Execute ASP.NET Core WebAPI from Command Line
Stars: ✭ 28 (-3.45%)
Mutual labels:  visual-studio, asp-net-core
SeoTags
SeoTags create all SEO tags you need such as meta, link, twitter card (twitter:), open graph (og:), and JSON-LD schema (structred data).
Stars: ✭ 113 (+289.66%)
Mutual labels:  aspnet-core, asp-net-core
aspnet-core-social-network
Social network based on ASP.NET Web API Core 2
Stars: ✭ 36 (+24.14%)
Mutual labels:  aspnet-core, asp-net-core
generic-for-core
🏗️ Generic Repository & UOW Pattern For ASP.NET Core
Stars: ✭ 55 (+89.66%)
Mutual labels:  mvc, asp-net-core
emplea do
Open source tech jobs portal. Made with .Net Core
Stars: ✭ 75 (+158.62%)
Mutual labels:  visual-studio, aspnet-core
ASPCore.Two-Factor-Authentication
Perform two factor authentication in an ASP.NET core application using Google Authenticator app
Stars: ✭ 29 (+0%)
Mutual labels:  visual-studio, asp-net-core
RDO.Net
Relational Data Objects for .Net
Stars: ✭ 23 (-20.69%)
Mutual labels:  visual-studio, asp-net-core
run-aspnetcore-basics retired
One Solution - One Project for web application development with Asp.Net Core & EF.Core. Only one web application project which used aspnetcore components; razor pages, middlewares, dependency injection, configuration, logging. To create websites with minimum implementation of asp.net core based on HTML5, CSS, and JavaScript. You can use this boi…
Stars: ✭ 15 (-48.28%)
Mutual labels:  visual-studio, aspnet-core
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+437.93%)
Mutual labels:  aspnet-core, asp-net-core
Serenity
Business Apps Made Simple with Asp.Net Core MVC / TypeScript
Stars: ✭ 2,168 (+7375.86%)
Mutual labels:  mvc, aspnet-core
Aspnetcorelocalization
Localization.SqlLocalizer & ASP.NET Core MVC Localization Examples
Stars: ✭ 183 (+531.03%)
Mutual labels:  mvc, asp-net-core
Dasblog Core
The original DasBlog reimagined with ASP.NET Core
Stars: ✭ 252 (+768.97%)
Mutual labels:  visual-studio, aspnet-core
ApiJwtWithTwoSts
Web API authorization, multi-IDP solutions in ASP.NET Core
Stars: ✭ 43 (+48.28%)
Mutual labels:  aspnet-core, net6

Kontent.ai Boilerplate for ASP.NET Core MVC

Build & Test codecov Stack Overflow Discord

Package Downloads Compatibility
NuGet NuGet net6.0

This boilerplate lets you easily scaffold a web project for development with Kontent.ai and give you a head start in a successful web project. It includes a set of pre-configured features and demonstrates best practices in order to kick off your website development with Kontent.ai smoothly.

What's included

Boilerplate screenshot

Getting started

Installation from NuGet

  1. Run dotnet new --install "Kontent.Ai.Boilerplate::*" to install the boilerplate to your machine
  2. Run dotnet new kontent-ai-mvc --name "MyWebsite" [-pid|project-id "<projectid>"] [-d|domain "<domain_name>"] [--output "<path>"] to init a website from the template
    • You can change the project ID later at any time in appsettings.json
  3. Open in the IDE of your choice and Run

Note: You can install the template from the sourcecode too.

How Tos

How to generate Strongly Typed Models for Content Types

By convention, all strongly-typed Content Type models are generated and stored within the Models/ContentTypes folder. All generated classes are marked as partial to enable further customization without losing the generated code.

The generating is facilitated by a .NET generator tool as pre-build event. If you wish to customize the process, adjust the Tools/GenerateModels.ps1 script.

For instance, to set a different namespace, set the -n command line parameter to [project namespace].Models. Or, to enable usage of Display Templates (MVC) for rich-text elements, set --structuredmodel true.

You can regenerate the models using the included PowerShell script that utilizes the model generator utility. The script is located at .

How to resolve links

Rich text elements in Kontent.ai can contain links to other content items. It's up to a developer to decide how the links should be represented on a live site. Resolution logic can be adjusted in the CustomContentLinkUrlResolver. See the documentation for detailed info.

How to set up webhook-enabled caching

All content retrieved from Kontent.ai is by default cached for 24 minutes. When content is stale (a newer version exists) it is cached for only 2 seconds. You can change the expiration times via the DeliveryCacheOptions in Startup.

If you want to invalidate cache items as soon as they're updated in Kontent, you need to create a webhook and point it to the /Webhooks/Webhooks relative path of your application. The URL of the app needs to be publicly accessible, e.g. https://myboilerplate.azurewebsites.net/Webhooks/Webhooks. Finally, copy the API secret and store it as WebhookOptions::Secret in your Configuration object, typically in the Secret Manager or Azure Key Vault

New webhook configuration

Note: During local development, you can use the ngrok service to route to your workstation. Simply start your application locally and run command .\ngrok.exe http [port] -host-header="localhost:[port]" (e.g. .\ngrok.exe http 59652 -host-header="localhost:59652") and set the webhook URL to the displayed HTTPS address.

Note: Speed of the Delivery/Preview API service is already tuned up because the service uses a geo-distributed CDN network for most of the types of requests. Therefore, the main advantage of caching in Kontent.ai applications is not speed but lowering the amount of requests needed (See pricing for details).

How to render responsive images

The boilerplate contains a sample implementation of the img-asset tag helper from the Kontent.Ai.AspNetCore NuGet package. Using the img-asset tag helper, you can easily create an img tag with srcset and sizes attributes.

How to adjust the sitemap.xml

The boilerplate contains a sample implementation of the SiteMapController. Make sure you specify desired content types in the Index() action method. Also, you can adjust the URL resolution logic in the GetPageUrl() method.

How to handle 404 errors or any other error

Error handling is setup by default. Any server exception or error response within 400-600 status code range is handled by ErrorController. By default, it's configured to display Not Found error page for 404 error and General Error for anything else.

How to adjust URL rewriting

The Boilerplate is configured to load all URL Rewriting rules from IISUrlRewrite.xml file. Add or modify existing rules to match your expected behavior. This is a good way to set up 301 Permanent redirects or www<->non-www redirects.

You can adjust the domain name in the default rewriting rules during the template instantiation by applying the -d|domain parameter.

Get involved

Check out the contributing page to see the best places to file issues, start discussions, and begin contributing.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].