Pages, Navigation & UX
Detailed mapping of all 11 UI pages, AppShell chrome, navigation sidebar, and modals.
02 - Frontend Pages, Navigation & UX Workflows
1. Overview & Navigation System
mailwart adopts the Operate design aesthetic: dense, information-rich, and engineered for high-throughput technical operators. The application is organized under Next.js App Router route groups:
(auth): Public authentication screens (/login).(dashboard): Authenticated administrative console (/dashboard/*).- Root (
/): Public landing page with product capabilities and operator sign-in.
2. AppShell Chrome (src/components/layout/app-shell.tsx)
Every route under /dashboard/* is wrapped by AppShell, providing persistent layout chrome:
Diagram
Components in AppShell:
- Collapsible Sidebar (
Sidebar):- Collapsible between full drawer and icon-only rail.
- Highlights active route with exact matching for
/dashboardand prefix matching for sub-resources. - User identity indicator with role badge (
adminoruser).
- Header Breadcrumbs (
HeaderBreadcrumbs):- Automatically tracks routing segments (e.g.,
Dashboard › Mailboxes › [email protected]). - Identifiers (domain names, email addresses) render in monospace styling (
font-mono).
- Automatically tracks routing segments (e.g.,
- Health Status Pills (
HealthPill):- JMAP Health Pill: Displays Stalwart connection status (
ok,latency: 42ms, orfail) with green/yellow/red pulse indicators. - Webmail Health Pill: Verifies Roundcube reachability and SSO readiness.
- JMAP Health Pill: Displays Stalwart connection status (
- Theme Toggle (
ThemeToggle):- Toggles light, dark, and system themes via
next-themes(src/app/globals.css).
- Toggles light, dark, and system themes via
- Copilot Toggle (
CopilotToggleButton):- Slides open the integrated AI Copilot panel on the right desktop rail or a mobile sheet.
- Impersonation Bar (
ExitImpersonationButton):- When an administrator impersonates a regular user, a prominent amber top banner warns that an impersonation session is active, with a one-click "Exit Impersonation" action.
3. Detailed Page Directory
3.1 Public Landing (/)
- File:
src/app/page.tsx→src/components/landing/landing-page.tsx - Purpose: Informational landing page for the mailwart instance.
- Sections:
- Split Hero: Brand headline, live instance status summary, primary call-to-action button: Secure Admin Login.
- Capabilities Bento (6 cells): Visual cards highlighting Stalwart JMAP directory management, Roundcube zero-password SSO, Cloudflare DNS automation, Sieve filters & catch-alls, chunked bulk CSV provisioning, and AI Copilot.
- Step Stack: Visual diagram explaining the 3-step provisioning workflow.
- Zone Sheet: Real-time preview of zone file generation (MX, SPF, DKIM, DMARC).
- Access Panel: Direct operator entry point leading to
/login.
3.2 Authentication (/login)
- File:
src/app/(auth)/login/page.tsx→src/components/auth/login-form.tsx - Purpose: Operator authentication into the console.
- Key Features:
- Credentials Form: Validates username and password via
loginAction. - Redirect Protection: If already authenticated, automatically redirects to
/dashboard(or the?from=parameter). - Forgot Password Modal: Triggers a 3-step OTP recovery flow:
- Enter account email.
- Receive 6-digit OTP code (sent via outbound system SMTP).
- Enter OTP code and set new password.
- Rate Limiting: Protects against brute-force attacks via sliding-window IP/username limits.
- Credentials Form: Validates username and password via
3.3 Dashboard Overview (/dashboard)
- File:
src/app/(dashboard)/dashboard/page.tsx - Purpose: High-level operational overview of Stalwart health and directory metrics.
- Components & Metrics:
- Metric Strips:
- Domains: Total configured domains and count of active domains.
- Mailboxes: Total active accounts and count of mailboxes with quotas.
- Catch-alls: Number of domains with catch-all routing enabled.
- Storage Used: Total disk usage vs. allocated storage quota formatted in human-readable bytes (e.g.
1.24 GB / 10 GB).
- Storage Meter (
StorageMeter): Visual progress bar showing directory storage utilization. Mailboxes with unmetered infinite capacity dynamically scale their contribution in 0.25 GB tiers (starting at 0.25 GB if $\le 0.25\text{ GB}$ used, expanding to 0.5 GB, 0.75 GB, 1.0 GB, etc.), providing a smooth, realistic utilization gauge without artificial ceilings. - System Health Panel (
SystemHealthPanel): Reports JMAP latency, webmail reachability, and memory metrics. - Recent Domains List: Quick table of top domains with status badges and mailbox counts.
- Quick Action Buttons: Direct shortcuts to Create Mailbox, Add Domain, Bulk Import, and Stalwart Admin.
- Metric Strips:
3.4 Domains Directory (/dashboard/domains)
- File:
src/app/(dashboard)/dashboard/domains/page.tsx&src/components/mail/domains-table-client.tsx - Purpose: List, search, filter, and create Stalwart domains.
- Features:
- Search & Filter: Instant client-side search across domain names and descriptions.
- Status Indicators: Enabled/disabled toggle and DNS health pill (
pass,warn,fail,propagating). - Create Domain Dialog (
CreateDomainDialog):- Modal form accepting domain name (e.g.,
example.com) and optional description. - Optional Cloudflare DNS auto-provision checkbox to immediately create DNS records.
- Commits via
createDomainAction.
- Modal form accepting domain name (e.g.,
3.5 Domain Detail (/dashboard/domains/[id])
- File:
src/app/(dashboard)/dashboard/domains/[id]/page.tsx&src/components/mail/domain-detail-client.tsx - Purpose: Comprehensive domain settings, catch-all policy, DNS records, and deletion.
- Sections:
- General Settings:
- Toggle domain enabled/disabled (
isEnabled). - Edit domain description and sub-addressing delimiter (e.g.,
+).
- Toggle domain enabled/disabled (
- Catch-All Routing:
- Select how unknown recipients are handled: Forward to existing mailbox, Reject (Bounce), or Drop (Blackhole).
- Dedicated helper creates a
catch@domainmailbox if none exists.
- Mail Exchanger Posture (
MailExchangerMode):- Local Exchanger (
allowRelaying: false), Backup Exchanger (allowRelaying: true), or Remote Exchanger.
- Local Exchanger (
- DNS Health & Record Generator (
DnsHealthPanel&DnsRecordGenerator):- Live DNS query checking MX, SPF, DKIM, and DMARC against public recursive resolvers.
- 1-click copy for required DNS records (Type, Name, Value, Priority).
- 1-click Provision to Cloudflare button if Cloudflare is linked.
- Danger Zone (
ConfirmDestroyDialog):- Domain deletion requires typing the exact domain name.
- Blocks deletion if active mailboxes remain unless explicit override is provided.
- General Settings:
3.6 Mailboxes Directory (/dashboard/mailboxes)
- File:
src/app/(dashboard)/dashboard/mailboxes/page.tsx&src/components/mail/mailbox-table.tsx - Purpose: Directory of all email accounts across all or selected domains.
- Features:
- Domain Filter Dropdown: Filter accounts by domain (e.g.
?domain=dom_123). - Datatable: Columns for full email address, domain badge, storage quota progress bar, status (active/suspended), and action dropdown.
- Bulk Selection & Actions:
- Select multiple mailboxes via checkboxes.
- Bulk Suspend / Activate.
- Bulk Reset Passwords (generates secure passwords with CSV export).
- Bulk Delete with confirmation dialog.
- Create Mailbox Dialog (
CreateMailboxDialog):- Domain dropdown, local-part input, password generator with strength meter, optional quota in MB/GB, and name/description.
- Commits via
createMailboxAction.
- Domain Filter Dropdown: Filter accounts by domain (e.g.
3.7 Mailbox Detail (/dashboard/mailboxes/[id])
- File:
src/app/(dashboard)/dashboard/mailboxes/[id]/page.tsx&src/components/mail/mailbox-detail-client.tsx - Purpose: Manage an individual email account's credentials, quotas, and security.
- Features:
- One-Click Webmail Launch (
RoundcubeButton): Mints a short-lived HMAC SSO token and opens Roundcube directly into the mailbox. - Password Reset Card: Generate or enter a new password. Copies to clipboard with one click. Plaintext is never stored.
- Quota Manager (
StorageCapacitySelect): Set storage quotas using standard presets (64 MB to 10 GB), unmetered infinite capacity, or custom values with MB/GB/KB unit selection. - Account Suspension: Suspend or reactivate login and message delivery.
- Email Aliases Panel (
AliasesPanel): Add/remove alternate local-parts that route into this mailbox (e.g.billing@domain→admin@domain). - App Passwords Panel (
AppPasswordPanel): Generate and revoke dedicated application passwords for IMAP/SMTP clients (Thunderbird, Apple Mail, Outlook). - Two-Factor Authentication Status (
TwoFactorStatus): Displays Stalwart TOTP status and instructions for configuring 2FA in Roundcube. - Forwarding Rules Display: Displays active email forwarders sending mail out of this mailbox.
- One-Click Webmail Launch (
3.8 Routing & Forwarding (/dashboard/routing)
- File:
src/app/(dashboard)/dashboard/routing/page.tsx&src/components/mail/routing-client.tsx - Purpose: Centralized management of email forwarders, aliases, and catch-alls.
- Sections:
- Catch-All Summary Table: Overview of all domains and their configured fallback destinations.
- Mailbox Aliases Table: Cross-domain view of all registered aliases and destination mailboxes.
- Forwarding Rules Manager:
- Create user-level forwarders (
source@domain→[email protected], [email protected]). - Create domain-level forwarders (
*@domain→target-domain.com). - Keep Local Copy: Toggle whether the original mailbox retains a copy of forwarded messages.
- Target address validation preventing mail loops.
- Create user-level forwarders (
3.9 Filters & Sieve Rules (/dashboard/filters)
- File:
src/app/(dashboard)/dashboard/filters/page.tsx&src/components/mail/filters-client.tsx - Purpose: Vacation autoresponders, server-side Sieve filtering, and spam thresholds.
- Sections:
- Vacation Autoresponders: Configure out-of-office replies per mailbox with optional start and end date ranges, custom subject, and message body.
- Sieve Filter Rules: Define server-side incoming message sorting rules based on headers (From, Subject, Size) with actions: Move to Folder, Mark as Read, or Discard.
- Spam Posture: Inspect and adjust spam filtering sensitivity (Spam score threshold, discard vs. Junk folder placement).
3.10 Bulk CSV Import (/dashboard/import)
- File:
src/app/(dashboard)/dashboard/import/page.tsx&src/components/mail/bulk-import-wizard.tsx - Purpose: Provision hundreds of mailboxes or forwarders via CSV uploads.
- Wizard Steps:
- Template & Upload: Download standardized CSV templates for mailboxes or forwarders. Drag-and-drop CSV file.
- Validation & Preview: Client-side and server-side validation against schema rules. Flags duplicate rows, missing domains, or invalid quotas.
- Chunked Execution: Runs import in batches of 25 rows per Server Action request to prevent reverse proxy timeouts.
- Job Controls: Pause, resume, or abort running jobs with live progress bar and downloadable outcome report.
3.11 System & Delivery Logs (/dashboard/logs)
- File:
src/app/(dashboard)/dashboard/logs/page.tsx&src/components/mail/logs-client.tsx - Purpose: Monitor live email delivery and audit administrative changes.
- Tabs:
- SMTP Delivery Traces: Real-time log of outbound and inbound message delivery attempts, recipient status (
delivered,bounced,queued), latency, and queue IDs. - Console Audit Trail: Immutable log of all changes made in mailwart (actor, action, target, timestamp, and metadata payload).
- SMTP Delivery Traces: Real-time log of outbound and inbound message delivery attempts, recipient status (
3.12 Settings Console (/dashboard/settings)
- File:
src/app/(dashboard)/dashboard/settings/page.tsx&src/components/mail/settings-client.tsx - Purpose: Centralized administrative settings split across 6 tabs.
- Tabs:
- Deliverability Suite: Run full 10-point deliverability checks, review blacklist results, inspect port connectivity, and view overall score.
- DNS Automation: Manage linked Cloudflare API tokens, review discovered zones, run DNS conflict audits, and propagate records.
- AI Copilot: Select active LLM provider (OpenAI, Anthropic, Google, Groq, Ollama, etc.), configure model IDs, and set API keys.
- Users & Access: Create and manage console user accounts, assign domain ownership, reset passwords, and trigger admin impersonation.
- System & Endpoints: View service URLs (Stalwart Admin, JMAP host, Roundcube), configure outbound SMTP for system notifications, and view Danger Zone.
- Account Profile: View current operator identity, role, and execute OTP-secured password updates.