Skip to content

kontent-ai/sample-app-net-mvc

Warning

This sample app is under active development. Details and documentation will evolve over time.

Contributors Forks Stargazers Issues MIT License

Kontent.ai ASP.NET MVC sample app

About The Project

This is a Kontent.ai sample ASP.NET Core MVC application running on .NET 8.

It is based on the Kontent.ai Ficto multisite project. Once finalized, it will supersede the existing, legacy .NET sample app.

Getting Started

Follow these steps to get the app running locally.

Prerequisites

  • .NET SDK 8.0 or newer
  • A Kontent.ai Ficto multisite sample with:
    • Environment ID
    • (Optional) Preview API key
    • (Optional) Secure Access API key

Installation

  1. Clone this repository:
git clone https://github.com/kontent-ai/sample-app-net-mvc.git
cd sample-app-net-mvc
  1. Restore .NET dependencies:
dotnet restore

Configuration & secrets

  1. Set your Kontent.ai environment ID in appsettings.json:

    • DeliveryOptions.EnvironmentId = your environment ID.
  2. Optionally set preview or secure access keys:

Caution

While for sample app purposes, storing keys directly in appsettings.json doesn't present any major risk, even if accidentally committed, consider using local secrets as described below.

dotnet user-secrets init
dotnet user-secrets set "DeliveryOptions:PreviewApiKey" "your-preview-api-key"
dotnet user-secrets set "DeliveryOptions:SecureAccessApiKey" "your-secure-access-api-key"

These values are kept in your local user profile and are not committed to the repository. They will become part of the corresponding DeliveryOptions section of appSettings.json during runtime.

Build and run

Build the application:

dotnet build

Run the application:

dotnet run

Styles (LESS) in development

To work on styles with automatic recompilation:

npm install
npm run dev

This watches Styles/site.less and recompiles to wwwroot/css/site.css whenever you save changes.

Usage

TBD

Contributing

For Contributing please see CONTRIBUTING.md for more information.

License

Distributed under the MIT License. See LICENSE.md for more information.

About

Sample application for Kontent.ai Ficto multisite project. Implemented in ASP.NET MVC.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published