09d185d94e
SvelteKit project with Svelte 5, TypeScript, Tailwind CSS v4. Dashboard with project cards, project detail with stage/instance management, deploy history, instance controls. Shared API client and reusable components (StatusBadge, InstanceCard, ProjectCard, ConfirmDialog). Add Phase 14 (Volumes & Environment) to plan.
5.4 KiB
5.4 KiB
Phase 9: SvelteKit Dashboard & Project Views
Status: ✅ Complete Parent plan: PLAN.md Domain: frontend
Objective
Build the SvelteKit frontend with the dashboard overview and project detail views — project list, instance status, controls, and deploy history.
Tasks
- Task 1: Initialize SvelteKit project in
web/directory with TypeScript, static adapter - Task 2: Set up Tailwind CSS v4 with @tailwindcss/vite plugin
- Task 3: Create shared API client (
lib/api.ts) — typed fetch wrapper for all backend endpoints - Task 4: Define TypeScript types (
lib/types.ts) — Project, Stage, Instance, Deploy, Registry, Settings - Task 5: Create layout with navigation — sidebar with Dashboard, Projects, Deploy, Settings links
- Task 6: Dashboard page (
routes/+page.svelte) — project overview cards with instance counts, status indicators - Task 7: Projects list page (
routes/projects/+page.svelte) — all projects with quick stats, "Add Project" button - Task 8: Project detail page (
routes/projects/[id]/+page.svelte) — stages, instances per stage, controls - Task 9: Instance controls — Stop, Start, Restart, Remove buttons with confirmation dialogs
- Task 10: Deploy history section in project detail — recent deploys with status, timestamp, tag
- Task 11: "Deploy new version" dropdown — list available tags from registry, trigger deploy
- Task 12: Create reusable components: StatusBadge, InstanceCard, ProjectCard, ConfirmDialog
Files to Modify/Create
web/package.json— SvelteKit project configweb/svelte.config.js— SvelteKit config with static adapterweb/vite.config.ts— Vite config with API proxy for devweb/src/app.html— base HTMLweb/src/lib/api.ts— API clientweb/src/lib/types.ts— shared TypeScript typesweb/src/routes/+layout.svelte— app layout with navigationweb/src/routes/+page.svelte— dashboardweb/src/routes/projects/+page.svelte— project listweb/src/routes/projects/[id]/+page.svelte— project detailweb/src/lib/components/StatusBadge.svelte— status indicatorweb/src/lib/components/InstanceCard.svelte— instance displayweb/src/lib/components/ProjectCard.svelte— project summary cardweb/src/lib/components/ConfirmDialog.svelte— confirmation modal
Acceptance Criteria
- SvelteKit project builds to static output
- Dashboard shows all projects with live status
- Project detail shows stages, instances, and controls
- Instance controls trigger correct API calls
- Deploy dropdown fetches and displays available tags
- UI is responsive and clean
Notes
- SvelteKit static adapter for embedding in Go binary
- API proxy in vite.config.ts for dev: proxy
/apitohttp://localhost:8080 - Use SvelteKit's
fetchfor SSR-compatible data loading - Status colors: green=running, yellow=starting, red=failed, gray=stopped
- Keep components small and reusable
Review Checklist
- All tasks completed
- TypeScript types match backend API response format
- API client handles errors gracefully with user feedback
- No hardcoded API URLs (use relative paths)
- Components are reusable and well-structured
Handoff to Next Phase
Phase 9 is complete. All 14 files have been created in the web/ directory:
Configuration files:
web/package.json— Svelte 5, SvelteKit 2, Tailwind CSS v4, static adapter, TypeScriptweb/svelte.config.js— Static adapter with SPA fallback (index.html)web/vite.config.ts— Tailwind v4 vite plugin +/apiproxy tolocalhost:8080web/tsconfig.json— Strict TypeScript, bundler module resolutionweb/src/app.html— Base HTML shellweb/src/app.css— Tailwind v4 importweb/src/routes/+layout.ts— Disables SSR, enables prerender for static adapter
Core library:
web/src/lib/types.ts— All TypeScript types matching Go backend models exactly (Project, Stage, Instance, Deploy, DeployLog, Registry, Settings, ApiEnvelope)web/src/lib/api.ts— Full typed API client covering all endpoints (projects, instances, deploys, registries, settings). Unwraps envelope, throwsApiErroron failure.
Components (Svelte 5 runes):
StatusBadge.svelte— Color-coded status pill (green/yellow/red/gray/blue)ConfirmDialog.svelte— Modal with danger/primary variantsInstanceCard.svelte— Instance display with stop/start/restart/remove controlsProjectCard.svelte— Project summary card for dashboard grid
Pages:
+layout.svelte— Sidebar navigation (Dashboard, Projects, Deploy, Settings)routes/+page.svelte— Dashboard with stats cards and project gridroutes/projects/+page.svelte— Project table with inline add-project formroutes/projects/[id]/+page.svelte— Full project detail: stages, instances, deploy form, deploy history
Key decisions:
- Used Svelte 5 runes (
$state,$derived,$effect,$props) throughout - Tailwind CSS v4 with
@tailwindcss/viteplugin (no PostCSS config needed) - Client-side only rendering (SSR disabled) for static adapter compatibility
- API client uses relative
/api/paths — works in both dev (vite proxy) and prod (embedded) - All API calls include loading spinners and error states with retry buttons
Ready for Phase 10: Settings pages, Quick Deploy page, and remaining UI routes. The API client already includes all endpoint wrappers needed.