Skip to content

feat(web): wire frontend to backend - #16

Merged
ajianaz merged 1 commit into
developfrom
feat/wire-frontend-backend
Jul 22, 2026
Merged

feat(web): wire frontend to backend#16
ajianaz merged 1 commit into
developfrom
feat/wire-frontend-backend

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Wire the SvelteKit admin dashboard to the actual Titen API backend.

Changes

  • Vite dev proxy/apilocalhost:7845, /healthlocalhost:7845 (no prefix rewriting needed — backend routes already match)
  • adapter-node — switched from adapter-auto for Docker deployment alongside Rust API
  • types.ts — rewritten to match actual Rust models (not the DESIGN.md ERD which diverged)
  • api.ts — fixed 8 route mismatches, added env-based base URL, auto-unwraps { data: ... } wrapper from all backend responses
  • All 8 admin pages fixed:
    • accounts: token_expires_atexpires_at
    • schedules: flat fields (no post_data wrapper), removed cancel/complete (backend update is delete+recreate)
    • analytics: added missing trend/trendMax state, disabled per-post trend (endpoint is per-post, not per-account)
    • comments: rewritten to load comments per-post (no list-all endpoint exists)
    • posts, dashboard, settings, media: minor field name fixes
  • StatusBadge: added ok/valid/unknown mappings, fixed typo maptVariantmapToVariant

Verification

  • bun run check — 0 errors, 15 warnings (all pre-existing)
  • bun run build — passes

Follow-up

  • Proxy config for production (Traefik routing)
  • Re-enable trend chart once per-account analytics endpoint exists
  • Add cancel/complete schedule operations once backend supports partial updates

Comment thread web/src/routes/admin/accounts/+page.svelte Dismissed
Comment thread web/src/routes/admin/accounts/+page.svelte Dismissed
Comment thread web/src/routes/admin/accounts/+page.svelte Dismissed
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

Blocked — critical issues found.

🔴 Error (3)

  • web/src/routes/admin/accounts/+page.svelte:191 — Insecure HTTP URL detected (not https). Use HTTPS for all external connections.
  • web/src/routes/admin/accounts/+page.svelte:21 — Static security scanner detected: Hardcoded password or secret in variable in web/src/routes/admin/accounts/+page.svelte:21
  • web/src/routes/admin/accounts/+page.svelte:103 — Static security scanner detected: Hardcoded password or secret in variable in web/src/routes/admin/accounts/+page.svelte:103

Review powered by cora-cli · BYOK · MIT

- Rewrite api.ts: correct routes matching Axum backend, env-based config,
  auto-unwrap { data: ... } wrapper from all responses
- Rewrite types.ts: match actual Rust model field names (not ERD)
- Fix vite.config.ts: remove invalid polyfillNode, proxy /api and /health
  to localhost:7845 (backend has /api prefix, no rewrite needed)
- Fix api.ts getApiKey: read from localStorage at call-time (not module load)
  with VITE_API_KEY env fallback for dev
- Fix all pages: remove res.data unwrapping, update field names
  (expires_at, error, caption flat), remove unused cancel/complete buttons
- Fix StatusBadge: rename maptVariant -> mapToVariant, add status mappings
- Comments page: rewrite to use per-post comment routes
- adapter-node replaces adapter-auto

Verified: bun run check 0 errors, bun run build clean, all 7 pages
load without JS errors against running backend via Vite proxy.
@ajianaz
ajianaz force-pushed the feat/wire-frontend-backend branch from a8430aa to 9895e76 Compare July 22, 2026 15:20
@ajianaz
ajianaz merged commit 2386f51 into develop Jul 22, 2026
9 checks passed
@ajianaz
ajianaz deleted the feat/wire-frontend-backend branch July 22, 2026 15:27
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.

2 participants