Skip to content

Introduce Admin UI: SQLite config, REST API, and Nuxt frontend - #38

Draft
andreaslampe with Copilot wants to merge 7 commits into
mainfrom
copilot/introduce-admin-ui-mail-agent
Draft

Introduce Admin UI: SQLite config, REST API, and Nuxt frontend#38
andreaslampe with Copilot wants to merge 7 commits into
mainfrom
copilot/introduce-admin-ui-mail-agent

Conversation

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor
  • Phase 1: Backend changes
    • Update MailAgent.csproj
    • Create Data/Entities.cs, Data/AppDbContext.cs, Data/DatabaseConfigurationProvider.cs
    • Create Endpoints/SettingsEndpoints.cs, Endpoints/AuthEndpoints.cs
    • Update Program.cs
    • Generate initial EF Core migration
    • Incorporate package version bumps from main
    • Remove O365ClientId from DB entity, REST endpoint, and config provider (build-time only)
    • Add RemoveO365ClientId EF Core migration to drop the column
  • Phase 2: Admin UI (Nuxt) — all pages created
    • Remove O365 Client ID field from settings/general.vue
  • Phase 3: Update .gitignore
  • Merge conflicts resolved
Original prompt

This section details on the original issue you should resolve

<issue_title>Introduce an admin UI</issue_title>
<issue_description>For TetraControl2Connect we've introduced an Admin UI. See https://github.com/feuersoftware/tetracontrol-to-connect
To improve the UX when using the mail agent I want you to do the same for it. Move the configuration to SQLite, introduce EF Core, add a REST API, add a Nuxt UI application and adapt the OAuth flow for O365, so that it uses the new UI.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits March 18, 2026 17:59
- Change SDK from Microsoft.NET.Sdk.Worker to Microsoft.NET.Sdk.Web
- Add EF Core SQLite, Swashbuckle, AspNetCore.OpenApi, SpaProxy packages
- Add SPA build/publish MSBuild targets for AdminUI
- Add Data layer: Entities, AppDbContext, DatabaseConfigurationProvider
  - Custom IConfigurationProvider reads settings from SQLite DB
  - ImportFromConfiguration migrates existing appsettings.json on first boot
  - SeedDefaults seeds fresh installations
- Add REST API endpoints (SettingsEndpoints, AuthEndpoints)
  - CRUD for general settings, mailboxes, and pattern settings
  - POST /api/settings/import to migrate from appsettings.json
  - POST /api/auth/o365/{id} to trigger O365 interactive auth from UI
- Rewrite Program.cs: HostBuilder -> WebApplicationBuilder
  - Kestrel on port 5050
  - Swagger/OpenAPI at /swagger
  - CORS restricted to localhost origins
  - EF migrations + seed/import on startup
  - Browser auto-open on start
  - Windows Service support via builder.Host.UseWindowsService()
- Add EF Core InitialCreate migration
- Add settings.db to .gitignore

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add AdminUI project with Nuxt 3 + @nuxt/ui v3 + Tailwind CSS
- Responsive sidebar layout with mobile drawer (default.vue)
- Dashboard page with section status cards and first-run setup banner
- General settings page (polling, process/email mode, PGP, heartbeat, O365)
- Email accounts page with full CRUD and O365 OAuth2 auth trigger
- Pattern page with regex editor, inline tester, and additional properties
- useSettings composable for API calls with toast notifications
- devProxy configured to forward /api to .NET backend on :5050
- Replace browser confirm() with UModal for delete confirmation
- Extract PatternField type alias for readability
- Update root .gitignore with Nuxt build artifacts and *.db wildcard

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… auth

Co-authored-by: andreaslampe <68891717+andreaslampe@users.noreply.github.com>
Copilot AI changed the title [WIP] [TetraControl2Connect] Introduce admin UI for mail agent Introduce Admin UI: SQLite config, REST API, and Nuxt frontend Mar 18, 2026
Copilot AI requested a review from andreaslampe March 18, 2026 18:19
@andreaslampe

Copy link
Copy Markdown
Member

@copilot please resolve the conflicts

entity.IgnoreCertificateErrors = dto.IgnoreCertificateErrors;
entity.HeartbeatInterval = dto.HeartbeatInterval;
entity.HeartbeatUrl = dto.HeartbeatUrl;
entity.O365ClientId = dto.O365ClientId;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Setting the O365ClientId is part of the release process and should not be configurable by the end user. Setting it in the config is only for developer testing purposes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 08a4b26. O365ClientId has been removed from the DB entity, the PUT /api/settings/general endpoint, the config provider, and the frontend general settings page. The build-time value from BuildSecrets.FallbackClientId (set via /p:O365ClientId during release) will always be used.

Co-authored-by: andreaslampe <68891717+andreaslampe@users.noreply.github.com>

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please resolve the conflicts

Resolved in 2c4c7bc. The conflict was in MailAgent.csproj — the main branch bumped Microsoft.Extensions.Hosting, Microsoft.Extensions.Hosting.WindowsServices, and System.ServiceProcess.ServiceController to 10.0.0 while our PR still had 9.0.10. Those version bumps are now incorporated.

andreaslampe and others added 2 commits March 18, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce an admin UI

2 participants