Setup Using NuGet Package
You finish with an Endatix API on https://localhost:5001 that Hub can call at http://localhost:3000. The template writes the project, the development settings, and the first user. It does not start a database or Docker.
Endatix.Templates is published with the Endatix API release: nuget.org for a stable release, GitHub Packages for a canary. Until that package is on the feed you use, create the host with dotnet new web and dotnet add package Endatix.Hosting, then follow Already have a project?.
Meet the System Requirements first: the .NET 10 SDK, and either SQL Server or PostgreSQL (pg_trgm on PostgreSQL).
Create the API
- Install the template and create the project. SQL Server is the default.
dotnet new install Endatix.Templates
dotnet new endatix -n My.Endatix.ApiHost
cd My.Endatix.ApiHost
- Point
ConnectionStrings:DefaultConnectioninappsettings.Development.jsonat a server you can reach. The generated password is a placeholder.
SQL Server default:
Server=localhost;Database=endatix;User Id=sa;Password=yourStrong(!)Password;TrustServerCertificate=True;
- Run the API.
dotnet runuses thehttpsprofile (it is first inlaunchSettings.json):https://localhost:5001andhttp://localhost:5000, which is what Hub'sENDATIX_BASE_URLexpects.dotnet run --launch-profile httpis HTTP only.
dotnet run
- Open
https://localhost:5001/health/uiandhttps://localhost:5001/api-docs. Sign in asadmin@localhost/P@ssw0rd, then change that password. The first run applies migrations and seeds sample data and sample forms (EnableAutoMigrations,SeedSampleData,SeedSampleForms).
PostgreSQL
Pass --database postgresql in step 1. The connection string becomes:
Host=localhost;Port=5432;Database=endatix;Username=postgres;Password=postgres
DefaultConnection_DbProvider is postgresql. Create the pg_trgm extension before the first run. See System Requirements.
What the template already sets
These values are in appsettings.Development.json only. Replace both signing keys before you commit the file or share the machine.
Base URL the API uses for links to Hub.
Signs Hub access tokens. Replace this value.
Issuer for resource authorization tokens. Leave this unless you change Hub to match.
Signs submission resume links. Replace this value.
Created on first run.
Created on first run. Change it after you sign in.
Browser origin allowed to call the API. Hub's dev server is this origin.
(Optional) Pin the NuGet version: dotnet new endatix -n My.Endatix.ApiHost --EndatixVersion 0.7.8. The default is the Endatix version shipped with the template.
(Optional) --saasManagement adds the commercial Endatix.SaaS.Management package and registers the module. Use it with --database postgresql. Leave it off for the open-source API.
Already have a project?
dotnet add package Endatix.Hosting
using Endatix.Hosting;
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureEndatix();
var app = builder.Build();
app.UseEndatix();
await app.RunAsync();
Copy ConnectionStrings and Endatix from an app created with dotnet new endatix, or follow Configuring Endatix.
Not in this template
dotnet new endatix does not start containers or an SMTP server. For API, Hub, and SQL Server in Docker, use Self-Hosting using Docker. For mail, use Email settings.