Skip to content
Orbix ASP.NET Core · Tailwind CSS v1.0.2

Starter kit

orbix-aspnet-starterkit/ is the same ASP.NET Core solution without the demo pages: start a new project from it and copy pages or partials from the full template when you need them.

What it includes

  • The application shell: sidebar, topbar, footer, page header, theme customizer, command palette, notifications and language menus.
  • The _Layout, _AuthLayout and _BlankLayout layouts.
  • The nine basic authentication pages (sign in, sign up, forgot and reset password, lock screen, two-step verification, email verification, signed out, success).
  • One empty start page at /.
  • The Tailwind CSS assets, the five languages with RTL, the theme runtime and the test suite.

What it leaves out: the demo pages (also the status pages), the partials and page scripts only they use, the demo data and the chart library. Menu links to removed pages point to # until you add your own.

Starter kit

Install

Exactly as the full template (see Installation):

cd orbix-aspnet-starterkit
dotnet run --project src/Orbix

and, to customize the assets, npm ci && npm run build in src/Orbix.

Bring a page from the full template

  1. Copy the Razor page from orbix-aspnet/src/Orbix/Pages/... to the same folder of the starter kit.
  2. Copy the partials it uses (<ox-partial name="apps/product-card"> → Pages/Shared/Partials/apps/product-card.cshtml).
  3. Add its URL to Infrastructure/Navigation/PageRoutes.cs and its menu entry to menu.json.
  4. Copy its translation keys if you removed them (the starter kit keeps the full dictionaries).
  5. If it has a page script (ViewData["Module"]), copy it from ClientApp/js/pages/. For charts, also copy ClientApp/js/core/charts.ts and run npm install echarts.
  6. Error pages: copy Pages/status/ and enable the two commented lines of Program.cs (UseExceptionHandler and UseStatusCodePagesWithReExecute).
  7. Run npm run build and dotnet test.

Connect authentication

The auth pages are views only, so you can plug in the authentication you prefer. With ASP.NET Core Identity:

  1. Add the packages (Microsoft.AspNetCore.Identity.EntityFrameworkCore and a database provider), your DbContext and builder.Services.AddIdentity...() / AddAuthentication() in Program.cs, then app.UseAuthentication() and app.UseAuthorization() after app.UseRouting().

  2. Give the sign-in page a page model and post the form to it:

    @page
    @model SignInModel
    public sealed class SignInModel(SignInManager<IdentityUser> signIn) : PageModel
    {
        [BindProperty] public string Email { get; set; } = "";
        [BindProperty] public string Password { get; set; } = "";
    
        public async Task<IActionResult> OnPostAsync()
        {
            var result = await signIn.PasswordSignInAsync(Email, Password, isPersistent: false, lockoutOnFailure: true);
            if (result.Succeeded) return LocalRedirect("~/");
            ModelState.AddModelError(string.Empty, "Invalid sign-in attempt.");
            return Page();
        }
    }
  3. In the form partial (Pages/Shared/Partials/auth/sign-in.cshtml) set method="post" and the name of the inputs (Email, Password); the form tag helper adds the antiforgery token. Remove the demo attributes data-auth-form and data-auth-next, which simulate the flow in the browser.

  4. Protect your pages with [Authorize] on their page models, or for whole folders with options.Conventions.AuthorizeFolder("/") and AllowAnonymousToFolder("/auth") in AddRazorPages().