Skip to main content

Getting Started

The first thing you need to do is to create a .NET application where you will install Flux into. Or, install it into an existing application.

You install it by adding the Commerce Mind GitHub NuGet package repository to your NuGet config, including an access token that you get from Commerce Mind.

You use your Github username as username and the Personal Access Token as password. Read more about the Github NuGet feed here: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry

Once you've added the NuGet repository you install the following packages:

commercemind.flux.core
commercemind.flux.api
commercemind.flux.processing
commercemind.flux.ui
commercemind.flux.sqlite

The package commercemind.flux.sqlite is great to get started quickly and for local development but not something you use in production. So you should also install the package for the database you want to run in production.

You don't have to install all packages in the same application. If you want you can have a separate application for the admin UI and the API as well as a separate application for the background processing in commercemind.flux.processing.

Prerequisites

You will need:

You can deploy Flux anywhere you can deploy .NET. It can run on Linux, Windows, etc and doesn't have any special requirements.

Using the NuGet packages

In your Program.cs the minimal setup you need is this:

var builder = WebApplication.CreateBuilder(args);

builder.Services
.AddFlux()
.AddProcessing()
.AddApi()
.AddUI()
.AddDatabaseEventBroker() // Needed if you have more than one server
.AddSqlite()
.Build()
;

await app.Services.GetRequiredService<IMigrationRunner>().RunMigrations(CancellationToken.None);

app.UseNexusAdminUI();
app.UseFlux();
app.MapControllers();

app.Run();

If you're wondering what app.UseNexusAdminUI() it's that Flux uses Nexus for background processing so you probably want to include the UI to keep track of the built-in jobs and queues in Flux.

After including this you should be able to start the application and access the admin UI at the url /flux.

Next steps