Quick start and sample host
On this page
Run the complete sample
Get the source from the TAdmin repository and run these commands from its root.
Requires Windows, the .NET 10 SDK, Node.js 22.12+ and npm. The sample build invokes Windows PowerShell through powershell.exe.
dotnet run --project samples/TAdmin.Sample/TAdmin.Sample.csproj -f net10.0Open http://127.0.0.1:6200/. The local sample starts with admin / 111111. Its build installs and compiles the shared frontend and sample frontend when needed, then embeds the pages in the host assembly. The first build requires an available npm registry.
Confirm the integration in this order:
- The terminal prints a
TAdmin Sample:listener address, indicating the HTTP hosted service has started. - Open it to see the login page. The same port serves embedded pages and
/api. - Sign in with the sample account and load the current user, menus and administration pages.
- Reload to verify session restoration. After logout, protected navigation should return to the login flow.
Databases and logs are under DB and Logs in the host output directory. The bootstrap administrator is created during initialization only. Changing the bootstrap password setting does not overwrite an existing account.
To check the API independently, run this in PowerShell:
curl.exe -i http://127.0.0.1:6200/api/auth/GetLoginPasswordPublicKeyExpect a JSON result envelope. On success, code is 200 and data contains keyId, publicKey, nonce, algorithm and expiresAt. This issues a one-time challenge without signing in. See authentication for the complete password protocol.
Frontend development
Keep the backend running. In another terminal, from the same repository root, run:
npm --prefix samples/TAdmin.Sample/web run devOpen http://127.0.0.1:5174/. Vite proxies /api to the sample backend; set TADMIN_SAMPLE_API to change that target. Password encryption uses Web Crypto, so access the page through localhost, a loopback address or HTTPS.
Install in your application
dotnet add package TAdmin
dotnet add package TUtility.GeneratorRun these commands in the backend project. Build the Vue frontend from the repository’s web source and reference it through a local directory; see Vue source integration. Keep related package versions compatible. See hosting for startup generator registration and execution.
After installation, configure startup and HTTP services and Vue adapters. See the device module example to add an API, menu and page.
Sample source map
| File | Integration responsibility |
|---|---|
samples/TAdmin.Sample/Program.cs | JSON configuration, generated startup runner and generic host |
SampleStartup.cs | Shared container, controllers, filters and hosted service |
Hosting/SampleWebApiService.cs | HTTP lifetime, JSON, authentication plugins and static pages |
Permission/SampleMenuProvider.cs | Module identity, menu / button seeds and route validation |
web/src/main.ts | createTAdminPlugin and host adapters |
web/src/api/client.ts, web/src/api/session.ts | Session singleton, persistence, requests, password encryption and refresh |
web/src/router | Actual routes and trusted component registration |
Diagnose the first run
| Symptom | Next check |
|---|---|
| Build waits during frontend dependency installation | Check the npm registry and network; the first build installs shared and sample dependencies |
powershell.exe cannot be found | The complete sample build currently uses Windows PowerShell; run it in the environment described above |
| APIs respond but the home page is missing | Check frontend build and embedded resources; do not skip frontend building on the first run |
| Port 5174 opens but login requests fail | Inspect /api requests in browser Network, backend port 6200 and TADMIN_SAMPLE_API |
| Password encryption is unavailable | Use localhost, loopback or HTTPS, and check crypto.subtle |
| The sample password does not work | Confirm the current sample and database; bootstrap settings do not overwrite an existing account |
For 404, 401, 403 and menu loading failures in your host, continue with integration troubleshooting.