106 Commits

Author SHA1 Message Date
Vantz Stockwell
57efc6a5d2 fix: Sidebar overlapping main content — use fixed + pl-64 offset
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
The md:static approach wasn't reliably removing fixed positioning,
causing the sidebar to overlay the main content. Changed to keep
sidebar fixed (better for dashboards — no scroll) and offset main
content with md:pl-64 instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 23:03:15 -05:00
Vantz Stockwell
854f56a178 fix: Register VueFinderPlugin — prevents Object.keys crash on null store
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
VueFinder requires app.use(VueFinderPlugin) to provide its internal
context (i18n, features, config stores). Without plugin registration,
the store returned null during setup, causing Object.keys to throw
TypeError on undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:20:00 -05:00
Vantz Stockwell
2df5c80928 feat: Add file manager view using VueFinder
All checks were successful
Build Companion Agent / build (push) Successful in 32s
Test Asgard Runner / test (push) Successful in 3s
Installs VueFinder and wires it to the backend /api/files endpoint with
JWT Bearer auth. Adds /files route, File Manager nav item (files.view
permission-gated, FolderOpen icon), and imports VueFinder CSS globally.
Driver token is computed reactively so it tracks token refreshes automatically.
Uses midnight theme to match the dark admin panel aesthetic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:13:10 -05:00
Vantz Stockwell
2b45413c20 feat: Wire uMod browse proxy and custom plugin upload
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Backend:
- GET /plugins/browse proxies uMod search.json filtered to Rust category,
  with 5-minute in-memory Map cache to avoid hammering the upstream API
- POST /plugins/upload accepts .cs files up to 5 MB via multipart, persists
  to plugin_registry, and dispatches plugin_upload action over NATS so the
  companion agent can write the file to the game server
- Legacy GET /plugins/search stub preserved (now directs callers to /browse)
- FileInterceptor + @UploadedFile follow the existing maps upload pattern

Frontend:
- useApi composable gains upload() method for multipart/form-data requests
  (omits Content-Type so the browser sets the correct multipart boundary)
- plugins store adds browseUmod() calling GET /plugins/browse and
  uploadPlugin() calling POST /plugins/upload with FormData;
  UmodPlugin and UmodBrowseResult TypeScript interfaces exported
- PluginsView Browse tab now calls browseUmod() through the backend proxy
  (no cross-origin requests to uMod directly); results show title,
  downloads_shortened, and latest_release_version_formatted from the
  real uMod payload
- New Upload Custom tab: drag-and-drop or click file input for .cs files,
  client-side extension/size validation, spinner during upload, success
  toast + auto-switch to Installed tab on completion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:09:19 -05:00
Vantz Stockwell
38e6d28248 fix: Wire automation toggles, browse uMod, and error feedback across admin views
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
- ServerView: automation toggles (crash recovery, auto-update, force wipe eligible)
  now call updateConfig() on click with toast success/error; all catch blocks get
  toast feedback instead of silent swallow
- PluginsView: Browse uMod tab wired to /plugins/search backend endpoint with
  debounced search, results table, and Install button that calls installPlugin();
  shows install state and marks already-installed plugins
- WipesView: dry-run results now displayed in a collapsible panel (would_delete /
  would_preserve lists + estimated duration); schedule enable/disable toggle wired
  to PUT /wipes/schedules/:id with loading state and toast feedback
- AnalyticsView: catch blocks now show toast errors instead of console.log;
  Player Retention placeholder replaced with intentional placeholder cards
- TeamView, ChatLogView, PlayersView, NotificationsView, MapsView: all empty
  catch blocks and '// API not wired yet' comments replaced with toast.error()
  calls; Notifications save now shows success toast

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:04:34 -05:00
Vantz Stockwell
1b12664d22 fix: Clean up Quick Setup — remove NATS_TOKEN, auto-populate license key
All checks were successful
Build Companion Agent / build (push) Successful in 26s
Test Asgard Runner / test (push) Successful in 2s
NATS has no auth configured, so NATS_TOKEN was a placeholder that
confused users. Made it optional in the Go agent (default empty) and
removed it from Quick Setup commands. Also removed GAME_SERVER_PATH
since one-click deploy handles server installation. License key already
auto-populates from auth store after previous commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:41:47 -05:00
Vantz Stockwell
8253680fbd fix: License key format, login populates license, case-insensitive email
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- admin.service.ts: createLicense() now uses CORR-XXXX-XXXX-XXXX format
  instead of raw hex hash
- admin.service.ts: getLicenses() flattens owner_email in response to
  match frontend expected shape
- auth.service.ts: Login/register responses now include full license
  object so frontend can populate auth store
- auth.service.ts: Email lookups are case-insensitive (LOWER()) to
  prevent duplicate accounts from case variations
- LoginView/RegisterView: Call setLicense() after setAuth()
- AdminLicenses: Handle null expires_at (was showing Dec 31, 1969),
  fix nullable types, fix query param name (per_page → limit)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:32:35 -05:00
Vantz Stockwell
5bb1ac9c35 fix: Move OS tab switcher below Quick Setup header for visibility
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:57:52 -05:00
Vantz Stockwell
358adde496 feat: Add companion agent one-click deployment + fix frontend TS errors
All checks were successful
Build Companion Agent / build (push) Successful in 30s
Test Asgard Runner / test (push) Successful in 3s
Go deployment orchestrator with platform-specific SteamCMD install,
Rust server download, server.cfg generation, and service registration.
Wire deploy command subscription in daemon, make GameServerPath optional,
add InstallDir config with OS-aware defaults. Fix unused imports and
WebSocket subscribe API in ServerView.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:49:48 -05:00
Vantz Stockwell
b94717d51b feat: Add frontend support for one-click Rust server deployment
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Adds DeploymentConfig/DeploymentStatus types, deployment state management
in the server store, tabbed Linux/Windows quick setup commands, and a
Deploy Rust Server card with progress tracker and configuration form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:48:05 -05:00
Vantz Stockwell
0fdbad0d07 fix: Resolve TypeScript build errors blocking Docker nginx build
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- DashboardView: Add non-null assertion on upcoming[0] (guarded by length check)
- EarlyAccessView: Add missing `computed` import from Vue

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:21:58 -05:00
Vantz Stockwell
93d536a13e feat: Upload companion agent to SeaweedFS CDN + update download links
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
CI pipeline now uploads binaries to cdn.corrosionmgmt.com:
- /companion/latest/ (always current, overwritten each release)
- /companion/v1.x.x/ (versioned archive)

Frontend download links updated from Gitea releases to CDN.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:11:06 -05:00
Vantz Stockwell
e0f9438dfa feat: Companion agent download in ServerView + Gitea CI pipeline fix
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Frontend:
- Add Companion Agent card to ServerView (status, download links, setup instructions)
- Shows agent connection status, last heartbeat, license key for copy
- Download buttons for Linux/Windows amd64 from Gitea releases

CI/CD:
- Fix build-companion.yml: replace actions/github-script with Gitea API curl
- Inject version from git tag via ldflags (-X main.version)
- Add VERSION variable to Makefile with ldflags injection
- Change main.go version from const to var for ldflags compatibility

Deployment:
- Add systemd service file (deployment/corrosion-companion.service)
- Add .gitignore for bin/ (binaries should come from CI, not repo)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:47:09 -05:00
Vantz Stockwell
d2e7a42536 chore: Wave 5 — marketing copy fix + operation log
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- Fix LandingView tech stack: "Rust / Axum" → "NestJS / TypeScript"
- Add complete operation log (corrosion-final-push.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:36:44 -05:00
Vantz Stockwell
8bb6cc0890 feat: Waves 3+4 — frontend wiring, NATS integration, stores (19 files)
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Frontend:
- Wire Dashboard quick actions (start/stop/trigger wipe) + next wipe schedule
- Wire Console WebSocket streaming for real-time output
- Implement TOTP 2FA challenge flow in LoginView
- Wire Plugin load/unload toggle + uninstall buttons with confirmations
- Wire WipesView profile selector, disable trigger when no profiles
- Build full WipeProfiles create/edit modal with all config fields
- Wire MapsView file upload with multipart FormData
- Fix SettingsView empty catch blocks → toast error messages
- Fix stale localStorage token reads in CSV exports → auth store
- Fix auth store hardcoded permissions → JWT-decoded role permissions
- Fix wipe store onMounted lifecycle bug → explicit subscribe action
- Update EarlyAccessView from countdown to "Now Live" state

Backend:
- Wire wipe trigger to publish NATS cmd (corrosion.{id}.cmd.wipe)
- Wire plugin reload/uninstall to publish NATS cmd
- Expand NatsBridgeService: add files, wipe status, server status subs
- Add PATCH schedules/:id/toggle endpoint for task toggling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:34:09 -05:00
Vantz Stockwell
208622000c fix: Wave 1 — critical bug fixes across 9 files
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- Fix double-prefix URL bugs in 4 analytics/revenue views (/api/api → /api)
- Fix AdminDashboard quick-links routing (/platform-admin/* → /admin/*)
- Fix MigrationView import missing Authorization header
- Remove dead ConsoleModule from app.module (conflicts with NatsBridgeGateway on /ws)
- Fix store.service.ts raw Error throws → NotFoundException/ForbiddenException
- Fix payment-order entity FK (webstore_subscription_id → WebstoreSubscription)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:24:24 -05:00
Vantz Stockwell
3cb714a792 fix: Resolve 500/404 cascade — JWT tenant context, wipe routes, changelog stub
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Root cause: super_admin JWT returned early with no license_id, causing
@CurrentTenant() to pass undefined to every tenant-scoped service query.

- jwt.strategy: Move license lookup before super_admin early return so
  admins who own licenses get their license_id in the JWT payload
- CurrentTenant decorator: Throw 401 with clear message when license_id
  is undefined instead of letting undefined cascade into TypeORM queries
- Wipe store: Fix 6 wrong routes (/profiles → /wipes/profiles, etc.)
  and remove redundant manual license_id guards
- Changelog module: Add stub controller/service returning empty array
  to eliminate 404 on /api/changelog
- ChangelogView: Handle both array and {entries} response shapes
- AGENTS.md: Streamlined 3-tier roster (Opus/Sonnet/Haiku)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:11:41 -05:00
Vantz Stockwell
05315cc88a fix: Replace unsafe date formatting in SchedulesView with safeDate()
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Replace `new Date(x).toLocaleString()` pattern with `safeDate()` utility to prevent crashes on null/undefined timestamps in scheduled task next_run field.

Part of ongoing safe formatter migration across all Vue views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:57:07 -05:00
Vantz Stockwell
26e717ac96 fix: Replace unsafe .toFixed() calls with safeFixed() in analytics views
- AnalyticsView: avg_players, uptime_percentage
- WipeAnalyticsView: success_rate, population curve, durations, CSV export
- PlayerRetentionView: retention percentages, session duration, tooltip
- MapAnalyticsView: rotation effectiveness, performance metrics, table

All analytics views now use safe formatter utilities with optional chaining
to prevent null/undefined runtime errors when displaying numeric data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:56:04 -05:00
Vantz Stockwell
daa9c3035f fix: Guard against undefined stats in AdminDashboard formatValue
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
API returns partial/empty stats object — individual fields can be undefined
even when the object exists. Added null guard to prevent toLocaleString crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:49:20 -05:00
Vantz Stockwell
e849d7803c fix: JWT tokens expire instantly + double /api prefix in analytics
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- Auth service used flat env var names (JWT_SECRET, JWT_ACCESS_EXPIRY_SECONDS)
  but @nestjs/config nests them under jwt.* — configService.get() returned
  undefined, so expiresIn was 0 and tokens expired on issue (iat === exp)
- JWT strategy had same bug for secretOrKey
- AnalyticsView passed /api/analytics/... to useApi which already prepends /api,
  resulting in /api/api/analytics/... (404)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:40:32 -05:00
Vantz Stockwell
50848fd0e8 fix: Handle undefined File from input element in MigrationView
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:33:23 -05:00
Vantz Stockwell
4c648783a2 feat: Frontend gap closure — Schedules, Alerts, Migration, Changelog views
Implements missing frontend views and API integrations:

New Views:
- SchedulesView: CRUD for scheduled tasks (restart/announcement/command/plugin_reload)
- MigrationView: Export/import interface with file upload and history tracking
- ChangelogView: Paginated changelog feed with category badges
- ForgotPasswordView: Password reset flow with email submission
- AlertsView: Alert config dashboard with threshold settings and history

Component Updates:
- ErrorBoundary: Global error handler with retry functionality
- DashboardLayout: Mobile responsive sidebar, permission-based nav, new menu items
- ServerInfoView: Complete rewrite for public server info display

Infrastructure:
- useApi: Token refresh interceptor with 401 retry and infinite loop prevention
- plugins store: Implemented all stubbed methods with real API calls
- auth store: Added hasPermission() helper for RBAC UI visibility
- Router: Added new routes with catch-all fallback

Purpose: Closes frontend implementation gaps. Hardens auth flow, improves mobile UX,
enables server automation scheduling, alert configuration, and data migration tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:20:40 -05:00
Vantz Stockwell
109476d5e3 fix: Remove unused TypeScript imports and variables
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
- Remove unused ExternalLink import from ModuleStoreView
- Remove unused Tag import from StoreItemsView
- Prefix unused cmd variable with underscore in v-for loop

Fixes production build TypeScript errors.
2026-02-15 17:05:52 -05:00
Vantz Stockwell
a8b7f536b5 feat: Add Phase 5 store item management UI
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
2026-02-15 15:00:00 -05:00
Vantz Stockwell
381d447dd8 feat: Add Phase 5 revenue dashboard UI
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Revenue analytics dashboard for webstore owners:
- Summary cards: Total Revenue, Transactions, Pending Deliveries, Refunds
- Revenue chart: ECharts line graph showing daily revenue (last 30 days)
- Transaction table: Date, Player, Item, Amount, Status, Delivered
- Status filter dropdown (all/delivered/paid/pending/failed/refunded)
- CSV export with full transaction details
- Color-coded status badges for quick scanning
- Manual refresh button (no auto-polling)
- Route: /admin/webstore/revenue
- API: GET /api/webstore/transactions
- TypeScript: StoreTransaction interface

Phase 5 Progress: 3/4 frontend components complete (75%)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:59:23 -05:00
Vantz Stockwell
79f5071b77 feat: Add Phase 5 customer store frontend
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Build public-facing e-commerce interface for server owners' item stores.

Components:
- StoreView.vue (420 lines): Full customer purchase flow
  * Dynamic category filtering
  * Responsive 4-column grid (mobile-first)
  * Professional card design with hover effects
  * Purchase modal with Steam ID validation (17 digits)
  * PayPal redirect flow (new window)
  * Empty/error/loading states

Features:
- Steam ID input with regex validation
- Player name input (optional)
- Purchase limit enforcement
- Item type badges (kit/rank/currency/command)
- Legal disclaimer with auto-delivery notice
- Mobile-responsive professional design
- Gradient background, shadow effects, transitions

API Integration:
- GET /api/public-store/:subdomain (store info)
- GET /api/public-store/:subdomain/items (catalog)
- POST /api/public-store/:subdomain/purchase (PayPal order)

Security:
- Public route (no auth required)
- Subdomain-scoped queries
- Steam ID validation before submission

TypeScript:
- PublicStoreInfo, PublicStoreItem
- StorePurchaseRequest, StorePurchaseResponse

Items auto-deliver via NATS webhook after payment completion.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:58:50 -05:00
Vantz Stockwell
dfd63ba1c7 feat: Add Phase 5 store configuration UI
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
- Built StoreConfigView.vue for webstore setup
- Form fields: store name, description, currency (USD/EUR/GBP)
- PayPal credentials (client ID/secret) with encryption support
- Sandbox/production mode toggle with warning states
- Store enable/disable with validation
- Empty state for unconfigured stores
- TypeScript StoreConfig interface
- Route: /admin/webstore/config (auth required)
- API integration: GET/PUT /api/webstore/config
- Responsive Tailwind design

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:57:30 -05:00
Vantz Stockwell
ba00291c18 feat: Complete Phase 4 Module Store frontend marketplace
Customer-facing module marketplace with full browse/preview/purchase flow:

Frontend Implementation:
- Complete ModuleStoreView.vue with dual-tab interface (Catalog + My Modules)
- Module grid with preview images, category badges, pricing display
- Search functionality across name/description fields
- Category filtering (8 categories: Loot, Events, Economy, Kits, Admin, PVP, PVE, Building)
- Detail modal with screenshots gallery, full features list, version info
- Purchase confirmation modal with license binding display
- Installation status tracking (Not Purchased → Purchased → Installed)
- Professional marketplace UI with hover animations and responsive grid

TypeScript Types:
- Module interface with full metadata (id, slug, name, description, price, category, images, features, version, purchase/install status)
- PurchaseRequest interface for API integration

API Integration Points (backend implementation separate):
- GET /api/modules/catalog — Browse all available modules
- GET /api/modules/my-modules — Fetch purchased modules for license
- POST /api/modules/purchase — Initiate purchase (returns payment URL or instant confirmation)
- POST /api/modules/install — Trigger deployment to game server

Design Features:
- Color-coded category badges with 8-color palette
- Preview image with scale-on-hover effect
- "Purchased" badge overlay for owned modules
- Three-button state progression (Purchase → Install → Installed)
- Empty states for zero results and zero purchases
- Mobile-responsive grid (1/2/3 columns)
- Payment flow with external redirect support (Stripe/PayPal)
- Error handling with inline error display in purchase modal

Purpose: Server admins can browse, preview, purchase, and install premium gameplay modules directly from dashboard. This is where customers pay real money — UI polish critical for conversion.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:47:12 -05:00
Vantz Stockwell
8790072609 feat: Implement Phase 2 wipe performance analytics dashboard
Complete implementation of wipe analytics system providing operational
insights and data-driven wipe timing optimization.

Backend:
- Added comprehensive analytics query layer to db/wipes.rs:
  - Success rate calculation over time ranges
  - Average wipe duration tracking
  - Post-wipe population curve analysis (Day 1/2/3)
  - Optimal wipe timing recommendations based on player peaks
  - Individual wipe entry tracking with peak population correlation
- Implemented GET /api/analytics/wipes/performance endpoint with
  flexible range parameters (6d/12d/90d/all)
- All queries leverage hourly aggregate tables for 90-day retention

Frontend:
- Built WipeAnalyticsView.vue with 3 ECharts visualizations:
  - Success rate timeline (scatter: green success, red failures)
  - Population curve comparing Day 1/2/3 post-wipe averages
  - Wipe duration trend showing execution time evolution
- Insight cards displaying success rate, avg duration, peak day, optimal timing
- Actionable recommendations banner with data-driven suggestions:
  - Optimal wipe scheduling based on historical player peaks
  - Wipe frequency recommendations (weekly vs bi-weekly)
  - Duration optimization alerts
  - Rollback protection warnings
- Time range selector and CSV export functionality
- Added /wipes/analytics route

TypeScript interfaces added: WipePerformanceMetrics, WipeAnalyticsEntry,
PopulationCurve

Answers critical operational questions: "How long do wipes take? When do
players peak post-wipe? What's my success rate? When should I wipe for
maximum population?"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:25:19 -05:00
Vantz Stockwell
dfa605f44f feat: Add public status page with 10-second polling
Implement status.corrosionmgmt.com public status page showcasing all
Corrosion servers that opt-in. Drives platform visibility and attracts
new customers.

Backend:
- Migration 007: status_page_description TEXT column
- models/public.rs: PublicServerStatus, PlatformHealth, StatusPageResponse
- db/public.rs: get_public_servers() with uptime calculations (24h/7d/30d)
- api/public.rs: GET /api/public/status (no auth)
- api/settings.rs: public site config endpoints (auth required)

Frontend:
- StatusPageView.vue: Server grid with live stats, uptime badges, wipe schedules
- Platform health header: total servers, online count, total players
- Auto-refresh every 10 seconds via polling
- Mobile-responsive design
- SettingsView.vue: Public Status tab with opt-in toggle

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:24:32 -05:00
Vantz Stockwell
f29524e633 feat: Implement Player Retention Analytics System (Phase 2.2)
Backend:
- Add player_sessions table (migration 004) for session tracking
- Implement retention calculation queries (24h/48h/72h post-wipe)
- Add /api/plugin/player-event endpoint for join/leave tracking
- Add /api/analytics/retention endpoint with CSV export
- Track unique players, session duration, new vs returning ratio

Frontend:
- Create PlayerRetentionView with ECharts retention curves
- Add multi-wipe comparison (last 3/6/10/20 wipes)
- Display summary metrics and detailed wipe table
- Add /retention route to router

Plugin:
- Update CorrosionCompanion.cs to send player events to new endpoint
- Track player join/leave with license_key authentication

Enables data-driven wipe timing optimization by answering:
"What percentage of players return 24h/48h/72h after a wipe?"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:23:21 -05:00
Vantz Stockwell
cef89ade18 feat: Implement map analytics system with effectiveness tracking
Add complete map analytics pipeline to answer: "Which maps drive the most
players? Is my rotation working?"

Backend Changes:
- Migration 005: Add map_id FK to server_stats and wipe_history tables
- Stats consumer now captures current_map_id when persisting stats
- Map analytics queries: get_map_analytics() returns performance metrics,
  effectiveness scores, and rotation health
- API endpoint: GET /api/analytics/maps?range=90d returns summary with
  best performing map and rotation effectiveness percentage

Frontend Changes:
- MapAnalyticsView.vue: Complete dashboard with performance charts,
  sortable metrics table, actionable insights, and CSV export
- ECharts bar chart comparing avg vs peak players per map
- Color-coded effectiveness scoring (green ≥80%, yellow ≥60%, red <60%)
- Time range selector: 30d/90d/all

Purpose: Enables data-driven map selection for wipe day based on player
engagement metrics. Rotation effectiveness algorithm scores maps by
(avg_players / peak_players) * 100.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:22:55 -05:00
Vantz Stockwell
574e3311bc chore: Add echarts dependency for analytics dashboard
Installed echarts@5.x for Phase 2 analytics charts.

Frontend build verified: 0 errors
Backend build verified: 0 errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:56:17 -05:00
Vantz Stockwell
75d08aeee4 feat: Phase 2 data aggregation pipeline (Strike 4A)
Backend:
- Stats ingestion consumer subscribing to corrosion.*.stats NATS subject
- Hourly aggregation scheduler (runs :05 past every hour)
- Daily cleanup job (03:00 UTC) with 7-day raw / 90-day hourly retention
- Analytics API (summary, timeseries, CSV export)
- Complete stats DB queries with aggregation and cleanup

Frontend:
- Analytics dashboard with ECharts integration
- Player count and server performance charts
- Time range selector (24h/7d/30d)
- CSV export functionality
- Real-time data loading

Infrastructure:
- Exposed NatsBridge.jetstream for consumer access
- Background service initialization in main.rs

Data flow: Plugin → NATS → Consumer → DB → Aggregation → API → Charts

Unblocks Strike 4B (dashboards) and 4C (alerting).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:53:25 -05:00
Vantz Stockwell
c5d057146a feat: Complete Phase 1 frontend — WebSocket + Wipe feature end-to-end
Implements full-stack vertical slice for wipe management with real-time updates.

WebSocket Integration:
- useWebSocket composable with auto-reconnect (exponential backoff up to 30s)
- JWT authentication via query parameter
- Automatic connection on auth state change
- Bi-directional messaging support
- Message handler subscription pattern
- Vite dev proxy configured for WebSocket (ws: true)

Toast Notification System:
- Pinia store with convenience methods (success/error/warning/info)
- Vue component with Lucide icons and Tailwind styling
- Auto-dismiss with configurable duration (5s default, 8s for errors)
- Manual dismiss with X button
- Smooth slide-in transitions from bottom-right
- Stack multiple toasts with proper spacing

Wipe Store Implementation:
- All API methods: fetchProfiles, fetchSchedules, fetchHistory
- Trigger wipe with optimistic UI update
- Dry-run simulation endpoint
- Profile CRUD operations (create, update, delete)
- WebSocket event listeners for real-time status updates
- Toast notifications on wipe_started, wipe_completed, wipe_failed
- Automatic history refresh on completion events
- Error handling with user-facing messages

Real-time Event Flow:
1. User triggers wipe → POST /api/wipes/trigger
2. Backend publishes NATS event: corrosion.{license_id}.wipe_started
3. WebSocket forwards event to frontend
4. Wipe store updates history array
5. Toast notification shows "Wipe started"
6. Progress events update status in real-time
7. Completion event triggers success toast + history refresh

Files Created:
- frontend/src/composables/useWebSocket.ts (208 LOC)
- frontend/src/stores/toast.ts (63 LOC)
- frontend/src/components/ToastNotification.vue (47 LOC)

Files Modified:
- frontend/src/stores/wipe.ts (273 LOC, was 42 LOC — 5 TODO methods → fully implemented)
- frontend/src/App.vue (added ToastNotification component)
- frontend/vite.config.ts (enabled WebSocket proxy)

TypeScript: Strict mode, zero build errors
Frontend builds:  929ms, 45.86 kB gzip

Phase 1 Status: ~80% complete
-  WebSocket/NATS real-time layer
-  Wipe feature production-ready
- ⏸️ Remaining stores (plugins, chat, players) still stubbed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:17:31 -05:00
Vantz Stockwell
8bea889145 fix: Add VITE_PANEL_URL for production builds
Vite bakes env vars at build time, not runtime. Without .env.production
in the frontend directory, the Docker build had no VITE_PANEL_URL and
Sign In / Get Started links resolved to empty hrefs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:39:02 -05:00
Vantz Stockwell
77155d30be feat: Domain-based routing — marketing site at bare domain, panel at subdomain
corrosionmgmt.com now serves LandingView as the default page with marketing
routes at root level. panel.corrosionmgmt.com continues serving the admin
panel unchanged. /site/* backward compat via redirects on marketing domain.

- nginx: Add bare domain server block (only proxies /api/early-access/)
- router: Detect hostname at module load, generate domain-specific routes
- MarketingLayout: Named routes for nav, external <a> tags for auth links
- LandingView: CTAs point to panel domain via VITE_PANEL_URL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:21:11 -05:00
Vantz Stockwell
1c3aece4de fix: Guard against undefined members/roles in TeamView
API returns unexpected shape when backend isn't wired — data.members
is undefined, assigned to ref, then .length in template throws
TypeError. Nullish coalescing to empty array prevents the crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:25:00 -05:00
Vantz Stockwell
072fa26544 fix: Admin Home nav highlight stuck when visiting child routes
/admin/servers.startsWith('/admin') was true, so both Admin Home
and Server Fleet highlighted simultaneously. Now /admin uses
exact match like / does.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:17:33 -05:00
Vantz Stockwell
88b50a30b4 feat: Phase 1c — Platform Admin Dashboard
Full super-admin dashboard for SaaS platform management:

Backend (10 files):
- Migration 003: Add is_super_admin column to users table
- JWT Claims: Carry is_super_admin through access tokens
- SuperAdmin extractor: Axum FromRequestParts that rejects non-admins (403)
- Admin API module: 10 endpoints behind /api/admin/*
  - GET /stats (KPIs: licenses, users, MRR, servers, signups)
  - GET/POST /licenses (paginated, filterable, manual generation)
  - GET/PATCH /licenses/:id (detail view, revoke/activate)
  - GET /subscriptions (module sub list with MRR breakdown)
  - GET/PATCH /users (paginated, toggle admin, disable accounts)
  - GET /servers (fleet overview across all licenses)
  - GET /health (DB pool, NATS status, table row counts)
- Bootstrap updated: first user gets is_super_admin = true

Frontend (8 files):
- 5 admin views in src/views/platform-admin/
- DashboardLayout: "Platform" nav section (gated on isSuperAdmin)
- Router: /admin/* routes with superAdmin meta guard
- Auth store: isSuperAdmin computed property
- Types: is_super_admin on User interface

Build: 80 chunks, zero TS errors, clean production build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:07:38 -05:00
Vantz Stockwell
0ac1738c85 feat: Add 5 Platform Admin views for super-admin dashboard
- AdminDashboard: KPI cards (licenses, users, MRR, servers, signups) + quick links
- AdminLicenses: Searchable paginated table with detail panel, CSV export, license generation
- AdminSubscriptions: MRR summary cards, per-module breakdown, subscriber table
- AdminUsers: Paginated user table with super admin toggle and account disable actions
- AdminServers: Filterable server table with connection type badges, status dots, relative heartbeat times

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:04:31 -05:00
Vantz Stockwell
d91ceb5b24 feat: Build Early Access page with backend email capture
Combined page: countdown timer (Feb 28), email capture with server
count segmentation (wired to POST /api/early-access), Founding Admin
Program (25 slots), demo dashboard preview placeholders, roadmap
voting, and launch timeline. Backend: Axum handler, migration for
early_access_signups table with email + server_count + created_at.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:51:55 -05:00
Vantz Stockwell
597f2ec379 feat: Build 5 marketing pages with layout and routing
Landing page (hero, problem, shift, capabilities, wipe orchestration,
infrastructure, public sites, CTA), Pricing (3-tier cards), How It Works
(4-step walkthrough + architecture diagram), FAQ (10-item accordion),
Roadmap (6-phase timeline). All under /site/* with MarketingLayout
(sticky nav, 4-column footer). Routes wired, build clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:45:34 -05:00
Vantz Stockwell
a160ba2df4 feat: Build final 9 admin views + swap final hero graphic
Views: Plugins, Wipes, WipeProfiles, WipeCalendar, WipeHistory,
Maps, Analytics, StoreManage, ModuleStore. All 20/20 admin views
now implemented. Updated hero graphic to final version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:20:01 -05:00
Vantz Stockwell
c45567670e feat: Implement 6 views + updated hero — Server, Chat, Team, Notifications, Settings, Setup Wizard
Server: Connection status, start/stop/restart controls, config editor
with edit mode, automation toggles (crash recovery, force wipe, auto-update).

Chat Log: Message feed with channel filter (global/team/server), search,
flag/unflag per message, timestamped entries with channel badges.

Team: Member table with role badges, invite form with role select,
pending/active status, remove action.

Notifications: Discord webhook, Pushbullet, email toggle cards.
6 event triggers (wipe start/complete/fail, crash, offline, purchase).

Settings: 3-tab layout (Account, License, Domain). Account editing,
license info display, subdomain + custom domain config with CNAME hint.

Setup Wizard: 3-step flow (Configure → Install Agent → Done).
Connection type radio cards, RCON/game port config, companion agent
install instructions with license key pre-filled.

Also swaps hero graphic to corrected version (two-column Control vs
Infrastructure layout per brand brief).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:12:24 -05:00
Vantz Stockwell
b767cce6ec feat: Implement Console and Players views — two core admin screens
Console: Terminal-style RCON interface with timestamped output,
color-coded log types, command input, clear button, and connection
status indicator. Uses server.sendCommand() from the store.

Players: Full management table with search, online/offline/all
filter tabs, Steam ID display, session time, ping, playtime,
admin badges, and kick/ban action buttons. Sorted online-first.

Both views use Oxide Orange brand colors per guidelines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:01:46 -05:00
Vantz Stockwell
e237333861 fix: Resolve all TypeScript build errors — path aliases + unused params
Adds baseUrl and @/* path mapping to tsconfig.app.json so vue-tsc can
resolve @/types, @/stores, and @/composables. Prefixes unused stub
parameters with _ to satisfy noUnusedParameters. Full build now passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:00:26 -05:00
Vantz Stockwell
da571b5b86 feat: Swap login/register hero to new marketing graphic
Replaces the plain trefoil mark with the full product hero —
cracked trefoil, tagline, and feature bullets from the architecture spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 22:55:06 -05:00
Vantz Stockwell
993db90e1f feat: Align UI to brand guidelines — Oxide Orange #F26622 replaces red accent
Defines oxide color scale (50-950) via Tailwind v4 @theme directive.
Swaps all accent red-* classes to oxide-* across layouts, auth views,
and footer. Semantic reds (error banners, offline status, stop button)
intentionally preserved.

Brand spec: Corrosion_Management_Brand_Guidelines.pdf

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 22:48:35 -05:00