Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Add onboarding wizard and developer mode features

Juan Denisa706829a50f7
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 00000000..fd074f19
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,114 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Project Overview
+
+ServerKit is a server control panel for managing web applications, databases, Docker containers, and security on VPS/dedicated servers. Flask backend (Python 3.11+), React frontend (Vite + LESS), SQLite/PostgreSQL database, real-time updates via Socket.IO.
+
+## Development Commands
+
+```bash
+# Backend (port 5000, hot-reload)
+cd backend && python -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
+pip install -r requirements.txt
+python run.py
+
+# Frontend (port 5173, Vite HMR)
+cd frontend && npm install && npm run dev
+
+# Both at once (Linux/WSL)
+./scripts/dev/start.sh
+
+# Frontend lint
+cd frontend && npm run lint
+
+# Frontend production build
+cd frontend && npm run build
+
+# Backend tests
+cd backend && pytest
+cd backend && pytest --cov=app
+
+# Docker
+docker compose -f docker-compose.dev.yml up --build
+```
+
+Default dev credentials: `admin` / `admin`
+
+## Architecture
+
+### Backend (`backend/`)
+
+Flask app factory in `app/__init__.py` using `create_app()`. Three-layer architecture:
+
+- **`app/api/`** — Flask Blueprints, one file per feature (36 files). All routes prefixed `/api/v1/`. JWT-protected via `@jwt_required()`.
+- **`app/services/`** — Business logic (48 files). Services are stateless modules called by API routes. Heavy lifting (shell commands, Docker API, file operations) happens here.
+- **`app/models/`** — SQLAlchemy ORM models (15 files). Tables auto-created on startup via `db.create_all()`.
+
+Other backend components:
+- `app/sockets.py` — Socket.IO event handlers for real-time metrics, logs, terminal
+- `app/agent_gateway.py` — Multi-server agent communication
+- `app/middleware/security.py` — Security headers middleware
+- `config.py` — Environment-based config (development/production/testing)
+- `run.py` — Entry point
+
+### Frontend (`frontend/src/`)
+
+React 18 SPA with client-side routing:
+
+- **`pages/`** — Route-level components (~29 files). Each maps to a route in `App.jsx`.
+- **`components/`** — Reusable UI components shared across pages.
+- **`contexts/`** — React Context providers: `AuthContext` (JWT auth + token refresh), `ThemeContext`, `ToastContext`, `ResourceTierContext` (feature gating).
+- **`services/api.js`** — Centralized `ApiService` class handling all HTTP requests, token management, and auto-refresh.
+- **`hooks/`** — Custom React hooks for reusable logic.
+- **`styles/`** — LESS stylesheets with design system variables. Main entry is `main.less`. Page-specific styles in `styles/pages/`.
+- **`layouts/`** — `DashboardLayout` wraps authenticated pages (sidebar + header).
+
+Route guards: `PrivateRoute` (auth check), `PublicRoute` (redirect if logged in), `SetupRoute` (redirect to `/setup` if not configured).
+
+### Request Flow
+
+Browser → Nginx (`:80`/`:443`) → proxy_pass to Docker containers (`:8001-8999`) for managed apps, or to Flask (`:5000`) for the panel API. The 404 handler in Flask serves `index.html` for SPA client-side routing; API routes return JSON errors.
+
+### Production Build
+
+The Dockerfile is multi-stage: Node 20 builds frontend, Python 3.11 serves everything via Gunicorn with GeventWebSocket workers. Built frontend is served from Flask's static folder.
+
+## Code Style
+
+### Python
+- PEP 8, type hints where helpful
+- Service functions are standalone (no classes unless stateful)
+- Consistent JSON error responses: `{'error': 'message'}, status_code`
+
+### React/JavaScript
+- Functional components with hooks only
+- PascalCase for components (`Sidebar.jsx`), camelCase for everything else
+- LESS for styling — use existing design system variables (`@card-bg`, `@primary-color`, `@spacing-md`, etc.) and BEM-like naming (`.block__element--modifier`)
+- Context API for global state; props drilling is fine for 2-3 levels
+- No inline styles; no Tailwind/CSS-in-JS
+
+### Diffs & Commits
+- One logical change per commit
+- Minimal, focused diffs — don't silently refactor surrounding code
+- Branch naming: `feature/`, `fix/`, `docs/`, `refactor/` prefixes
+
+## Adding a New Feature (Full Stack)
+
+1. **Model**: Add SQLAlchemy model in `backend/app/models/`
+2. **Service**: Add business logic in `backend/app/services/`
+3. **API**: Create Blueprint in `backend/app/api/`, register it in `app/__init__.py` with `url_prefix='/api/v1/<feature>'`
+4. **Frontend API**: Add methods to `ApiService` in `frontend/src/services/api.js`
+5. **Page**: Create page component in `frontend/src/pages/`, add route in `App.jsx`
+6. **Styles**: Add LESS file in `frontend/src/styles/pages/`, import in `main.less`
+
+## Key Environment Variables
+
+| Variable | Purpose |
+|----------|---------|
+| `SECRET_KEY` | Flask session signing |
+| `JWT_SECRET_KEY` | JWT token signing |
+| `DATABASE_URL` | DB connection string (`sqlite:///...` or PostgreSQL) |
+| `CORS_ORIGINS` | Comma-separated allowed origins |
+| `FLASK_ENV` | `development` or `production` |
diff --git a/backend/app/api/auth.py b/backend/app/api/auth.py
index e3df6f48..707c6b43 100644
--- a/backend/app/api/auth.py
+++ b/backend/app/api/auth.py
@@ -8,7 +8,7 @@ from flask_jwt_extended import (
get_jwt
)
from app import db, limiter
-from app.models import User, AuditLog
+from app.models import User, AuditLog, SystemSettings
from app.services.settings_service import SettingsService
from app.services.audit_service import AuditService
@@ -66,10 +66,6 @@ def register():
db.session.add(user)
db.session.commit()
- # Mark setup as complete if this is the first user
- if is_first_user:
- SettingsService.complete_setup(user_id=user.id)
-
# Log the user creation
AuditService.log_user_action(
action=AuditLog.ACTION_USER_CREATE,
@@ -91,6 +87,39 @@ def register():
}), 201
+ALLOWED_USE_CASES = {'wordpress', 'web-apps', 'self-hosted', 'devops'}
+
+
+@auth_bp.route('/complete-onboarding', methods=['POST'])
+@jwt_required()
+def complete_onboarding():
+ """Complete the onboarding wizard and mark setup as done."""
+ current_user_id = get_jwt_identity()
+ user = User.query.get(current_user_id)
+
+ if not user or user.role != User.ROLE_ADMIN:
+ return jsonify({'error': 'Admin access required'}), 403
+
+ data = request.get_json() or {}
+ use_cases = data.get('use_cases', [])
+
+ # Validate use_cases
+ if not isinstance(use_cases, list):
+ return jsonify({'error': 'use_cases must be a list'}), 400
+
+ invalid = set(use_cases) - ALLOWED_USE_CASES
+ if invalid:
+ return jsonify({'error': f'Invalid use cases: {", ".join(invalid)}'}), 400
+
+ # Save onboarding use cases
+ SettingsService.set('onboarding_use_cases', use_cases, user_id=user.id)
+
+ # Mark setup as complete
+ SettingsService.complete_setup(user_id=user.id)
+
+ return jsonify({'message': 'Onboarding completed successfully'}), 200
+
+
@auth_bp.route('/login', methods=['POST'])
@limiter.limit("5 per minute")
def login():
diff --git a/backend/app/services/settings_service.py b/backend/app/services/settings_service.py
index fdfb82b7..7810d783 100644
--- a/backend/app/services/settings_service.py
+++ b/backend/app/services/settings_service.py
@@ -27,6 +27,16 @@ class SettingsService:
'value': 90,
'type': 'integer',
'description': 'Number of days to retain audit logs'
+ },
+ 'onboarding_use_cases': {
+ 'value': [],
+ 'type': 'json',
+ 'description': 'Use cases selected during onboarding wizard'
+ },
+ 'dev_mode': {
+ 'value': False,
+ 'type': 'boolean',
+ 'description': 'Enable developer mode for debugging tools and icon reference'
}
}
diff --git a/frontend/src/components/setup/SetupStepAccount.jsx b/frontend/src/components/setup/SetupStepAccount.jsx
new file mode 100644
index 00000000..e580376b
--- /dev/null
+++ b/frontend/src/components/setup/SetupStepAccount.jsx
@@ -0,0 +1,123 @@
+import React, { useState } from 'react';
+import { useAuth } from '../../contexts/AuthContext';
+import { Info } from 'lucide-react';
+
+const SetupStepAccount = ({ onComplete }) => {
+ const [email, setEmail] = useState('');
+ const [username, setUsername] = useState('');
+ const [password, setPassword] = useState('');
+ const [confirmPassword, setConfirmPassword] = useState('');
+ const [error, setError] = useState('');
+ const [loading, setLoading] = useState(false);
+ const { register } = useAuth();
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setError('');
+
+ if (password !== confirmPassword) {
+ setError('Passwords do not match');
+ return;
+ }
+
+ if (password.length < 8) {
+ setError('Password must be at least 8 characters');
+ return;
+ }
+
+ setLoading(true);
+
+ try {
+ await register(email, username, password);
+ onComplete({ email, username });
+ } catch (err) {
+ setError(err.message || 'Failed to create admin account');
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <div className="wizard-step">
+ <h2 className="wizard-step-title">Create Admin Account</h2>
+ <p className="wizard-step-description">
+ Set up the administrator account for your server.
+ </p>
+
+ <div className="wizard-info-banner">
+ <div className="wizard-info-icon">
+ <Info size={20} />
+ </div>
+ <p>
+ This is your first time using ServerKit. Create an administrator
+ account to get started. This account will have full access to
+ manage your server.
+ </p>
+ </div>
+
+ {error && <div className="error-message">{error}</div>}
+
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <label htmlFor="email">Admin Email</label>
+ <input
+ type="email"
+ id="email"
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ placeholder="[email protected]"
+ required
+ autoFocus
+ />
+ </div>
+
+ <div className="form-group">
+ <label htmlFor="username">Username</label>
+ <input
+ type="text"
+ id="username"
+ value={username}
+ onChange={(e) => setUsername(e.target.value)}
+ placeholder="Choose a username"
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <label htmlFor="password">Password</label>
+ <input
+ type="password"
+ id="password"
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ placeholder="At least 8 characters"
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <label htmlFor="confirmPassword">Confirm Password</label>
+ <input
+ type="password"
+ id="confirmPassword"
+ value={confirmPassword}
+ onChange={(e) => setConfirmPassword(e.target.value)}
+ placeholder="Confirm your password"
+ required
+ />
+ </div>
+
+ <button
+ type="submit"
+ className="btn-wizard-next"
+ disabled={loading}
+ style={{ width: '100%', justifyContent: 'center' }}
+ >
+ {loading ? 'Creating account...' : 'Continue'}
+ </button>
+ </form>
+ </div>
+ );
+};
+
+export default SetupStepAccount;
diff --git a/frontend/src/components/setup/SetupStepIntent.jsx b/frontend/src/components/setup/SetupStepIntent.jsx
new file mode 100644
index 00000000..8533730c
--- /dev/null
+++ b/frontend/src/components/setup/SetupStepIntent.jsx
@@ -0,0 +1,89 @@
+import React, { useState } from 'react';
+import { Globe, Code, Server, GitBranch, Check } from 'lucide-react';
+
+const USE_CASE_OPTIONS = [
+ {
+ id: 'wordpress',
+ label: 'WordPress Sites',
+ description: 'Blogs, stores, content sites with managed MySQL & PHP',
+ icon: Globe,
+ },
+ {
+ id: 'web-apps',
+ label: 'Web Applications',
+ description: 'Node.js, Python, PHP, or Docker-based apps',
+ icon: Code,
+ },
+ {
+ id: 'self-hosted',
+ label: 'Self-Hosted Services',
+ description: 'Nextcloud, Vaultwarden, Wiki.js, media servers',
+ icon: Server,
+ },
+ {
+ id: 'devops',
+ label: 'DevOps & Monitoring',
+ description: 'CI/CD, Grafana, Prometheus, log aggregation',
+ icon: GitBranch,
+ },
+];
+
+const SetupStepIntent = ({ selections, onComplete }) => {
+ const [selectedSet, setSelectedSet] = useState(new Set(selections || []));
+
+ function toggleSelection(id) {
+ setSelectedSet((prev) => {
+ const next = new Set(prev);
+ if (next.has(id)) {
+ next.delete(id);
+ } else {
+ next.add(id);
+ }
+ return next;
+ });
+ }
+
+ function handleContinue() {
+ onComplete(Array.from(selectedSet));
+ }
+
+ return (
+ <div className="wizard-step">
+ <h2 className="wizard-step-title">What will you use this server for?</h2>
+ <p className="wizard-step-description">
+ Select all that apply. This helps us tailor recommendations for you.
+ </p>
+
+ <div className="option-grid">
+ {USE_CASE_OPTIONS.map((option) => {
+ const Icon = option.icon;
+ const isSelected = selectedSet.has(option.id);
+ return (
+ <div
+ key={option.id}
+ className={`option-card${isSelected ? ' selected' : ''}`}
+ onClick={() => toggleSelection(option.id)}
+ >
+ <div className="option-card-check">
+ <Check size={14} />
+ </div>
+ <div className="option-card-icon">
+ <Icon size={20} />
+ </div>
+ <div className="option-card-label">{option.label}</div>
+ <div className="option-card-desc">{option.description}</div>
+ </div>
+ );
+ })}
+ </div>
+
+ <div className="wizard-nav" style={{ borderTop: 'none', marginTop: 0, paddingTop: 0 }}>
+ <button className="btn-wizard-next" onClick={handleContinue}>
+ Continue
+ </button>
+ </div>
+ </div>
+ );
+};
+
+export default SetupStepIntent;
diff --git a/frontend/src/components/setup/SetupStepSummary.jsx b/frontend/src/components/setup/SetupStepSummary.jsx
new file mode 100644
index 00000000..5b94b033
--- /dev/null
+++ b/frontend/src/components/setup/SetupStepSummary.jsx
@@ -0,0 +1,129 @@
+import React from 'react';
+import { useResourceTier } from '../../contexts/ResourceTierContext';
+import { Sparkles } from 'lucide-react';
+
+const USE_CASE_LABELS = {
+ wordpress: 'WordPress Sites',
+ 'web-apps': 'Web Applications',
+ 'self-hosted': 'Self-Hosted Services',
+ devops: 'DevOps & Monitoring',
+};
+
+const RECOMMENDATIONS = {
+ wordpress: ['WordPress', 'Nginx Proxy Manager', 'phpMyAdmin'],
+ 'web-apps': ['Node.js App', 'Python App', 'Portainer'],
+ 'self-hosted': ['Nextcloud', 'Vaultwarden', 'Wiki.js'],
+ devops: ['Grafana', 'Prometheus', 'Portainer'],
+};
+
+const DEFAULT_RECOMMENDATIONS = ['Portainer', 'Uptime Kuma', 'Nginx Proxy Manager'];
+
+function getRecommendations(useCases) {
+ if (!useCases || useCases.length === 0) return DEFAULT_RECOMMENDATIONS;
+
+ const seen = new Set();
+ const result = [];
+ for (const uc of useCases) {
+ const items = RECOMMENDATIONS[uc] || [];
+ for (const item of items) {
+ if (!seen.has(item)) {
+ seen.add(item);
+ result.push(item);
+ }
+ }
+ }
+ return result.length > 0 ? result.slice(0, 4) : DEFAULT_RECOMMENDATIONS;
+}
+
+const SetupStepSummary = ({ accountInfo, useCases, onFinish }) => {
+ const { tier, specs, loading } = useResourceTier();
+ const recommendations = getRecommendations(useCases);
+
+ function formatSpecs() {
+ if (!specs) return 'Detecting...';
+ const parts = [];
+ if (specs.cpu_cores) parts.push(`${specs.cpu_cores} core${specs.cpu_cores > 1 ? 's' : ''}`);
+ if (specs.total_memory_gb) parts.push(`${specs.total_memory_gb} GB RAM`);
+ return parts.join(', ');
+ }
+
+ function tierLabel() {
+ if (loading) return 'Detecting...';
+ if (!tier) return 'Unknown';
+ return tier.charAt(0).toUpperCase() + tier.slice(1);
+ }
+
+ return (
+ <div className="wizard-step">
+ <h2 className="wizard-step-title">You're all set</h2>
+ <p className="wizard-step-description">
+ Here's a summary of your setup. You can change these later in Settings.
+ </p>
+
+ <div className="summary-panel">
+ <div className="summary-section">
+ <div className="summary-section-title">Account</div>
+ <div className="summary-row">
+ <span className="summary-label">Username</span>
+ <span className="summary-value">{accountInfo?.username || '-'}</span>
+ </div>
+ <div className="summary-row">
+ <span className="summary-label">Email</span>
+ <span className="summary-value">{accountInfo?.email || '-'}</span>
+ </div>
+ </div>
+
+ <div className="summary-section">
+ <div className="summary-section-title">Use Cases</div>
+ {useCases && useCases.length > 0 ? (
+ <div className="summary-tags">
+ {useCases.map((uc) => (
+ <span key={uc} className="summary-tag">
+ {USE_CASE_LABELS[uc] || uc}
+ </span>
+ ))}
+ </div>
+ ) : (
+ <div className="summary-row">
+ <span className="summary-label">None selected</span>
+ </div>
+ )}
+ </div>
+
+ <div className="summary-section">
+ <div className="summary-section-title">Server</div>
+ <div className="summary-row">
+ <span className="summary-label">Tier</span>
+ <span className="summary-value">{tierLabel()}</span>
+ </div>
+ <div className="summary-row">
+ <span className="summary-label">Specs</span>
+ <span className="summary-value">{formatSpecs()}</span>
+ </div>
+ </div>
+
+ <div className="summary-section">
+ <div className="summary-section-title">
+ <Sparkles size={14} style={{ display: 'inline', verticalAlign: 'middle', marginRight: 6 }} />
+ Recommended for you
+ </div>
+ <div className="recommendation-chips">
+ {recommendations.map((name) => (
+ <span key={name} className="recommendation-chip">
+ {name}
+ </span>
+ ))}
+ </div>
+ </div>
+ </div>
+
+ <div className="wizard-nav" style={{ borderTop: 'none', marginTop: 0, paddingTop: 0 }}>
+ <button className="btn-wizard-next" onClick={onFinish}>
+ Go to Dashboard
+ </button>
+ </div>
+ </div>
+ );
+};
+
+export default SetupStepSummary;
diff --git a/frontend/src/components/setup/SetupStepTier.jsx b/frontend/src/components/setup/SetupStepTier.jsx
new file mode 100644
index 00000000..bdb62748
--- /dev/null
+++ b/frontend/src/components/setup/SetupStepTier.jsx
@@ -0,0 +1,130 @@
+import React from 'react';
+import { useResourceTier } from '../../contexts/ResourceTierContext';
+import { Check, X, AlertTriangle, Loader } from 'lucide-react';
+
+const TIERS = [
+ {
+ id: 'lite',
+ name: 'Lite',
+ specs: '1 core or <2 GB RAM',
+ features: [
+ { label: 'Docker containers', available: true },
+ { label: 'Database management', available: true },
+ { label: 'App deployment', available: true },
+ { label: 'Manage WordPress', available: true },
+ { label: 'Create WordPress sites', available: false },
+ ],
+ },
+ {
+ id: 'standard',
+ name: 'Standard',
+ specs: '2-3 cores, 2-4 GB RAM',
+ features: [
+ { label: 'Docker containers', available: true },
+ { label: 'Database management', available: true },
+ { label: 'App deployment', available: true },
+ { label: 'Manage WordPress', available: true },
+ { label: 'Create WordPress sites', available: true },
+ ],
+ },
+ {
+ id: 'performance',
+ name: 'Performance',
+ specs: '4+ cores, >4 GB RAM',
+ features: [
+ { label: 'Docker containers', available: true },
+ { label: 'Database management', available: true },
+ { label: 'App deployment', available: true },
+ { label: 'Manage WordPress', available: true },
+ { label: 'Create WordPress sites', available: true },
+ ],
+ },
+];
+
+const SetupStepTier = ({ useCases, onComplete }) => {
+ const { tier, specs, loading } = useResourceTier();
+ const showWarning = useCases.includes('wordpress') && tier === 'lite';
+
+ if (loading) {
+ return (
+ <div className="wizard-step">
+ <div className="wizard-loading">
+ <Loader size={24} className="spin" />
+ </div>
+ </div>
+ );
+ }
+
+ function formatSpecs() {
+ if (!specs) return null;
+ const parts = [];
+ if (specs.cpu_cores) parts.push(`${specs.cpu_cores} core${specs.cpu_cores > 1 ? 's' : ''}`);
+ if (specs.total_memory_gb) parts.push(`${specs.total_memory_gb} GB RAM`);
+ return parts.join(', ');
+ }
+
+ return (
+ <div className="wizard-step">
+ <h2 className="wizard-step-title">Server Resources</h2>
+ <p className="wizard-step-description">
+ We detected your server's hardware. Here's what each tier unlocks.
+ </p>
+
+ {showWarning && (
+ <div className="tier-warning">
+ <div className="tier-warning-icon">
+ <AlertTriangle size={20} />
+ </div>
+ <div className="tier-warning-text">
+ Your server is in the <strong>Lite</strong> tier. WordPress site
+ creation requires at least the Standard tier (2+ cores, 2+ GB RAM).
+ You can still manage existing WordPress sites.
+ </div>
+ </div>
+ )}
+
+ <div className="tier-grid">
+ {TIERS.map((t) => {
+ const isDetected = tier === t.id;
+ return (
+ <div
+ key={t.id}
+ className={`tier-card${isDetected ? ' detected' : ''}`}
+ >
+ <div className="tier-card-header">
+ <span className="tier-card-name">{t.name}</span>
+ {isDetected && (
+ <span className="tier-card-badge">Your Server</span>
+ )}
+ </div>
+ <div className="tier-card-specs">
+ {isDetected && specs ? formatSpecs() : t.specs}
+ </div>
+ <div className="tier-features">
+ {t.features.map((f) => (
+ <div
+ key={f.label}
+ className={`tier-feature ${f.available ? 'available' : 'unavailable'}`}
+ >
+ <span className="feature-icon">
+ {f.available ? <Check size={16} /> : <X size={16} />}
+ </span>
+ {f.label}
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+
+ <div className="wizard-nav" style={{ borderTop: 'none', marginTop: 0, paddingTop: 0 }}>
+ <button className="btn-wizard-next" onClick={onComplete}>
+ Continue
+ </button>
+ </div>
+ </div>
+ );
+};
+
+export default SetupStepTier;
diff --git a/frontend/src/contexts/AuthContext.jsx b/frontend/src/contexts/AuthContext.jsx
index 0a86c26e..6394d283 100644
--- a/frontend/src/contexts/AuthContext.jsx
+++ b/frontend/src/contexts/AuthContext.jsx
@@ -25,12 +25,8 @@ export function AuthProvider({ children }) {
checked: true
});
- // If setup is complete, check authentication
- if (!status.needs_setup) {
- await checkAuth();
- } else {
- setLoading(false);
- }
+ // Always check auth — user may be mid-onboarding wizard with valid session
+ await checkAuth();
} catch (error) {
console.error('Setup status check failed:', error);
// Fallback to checking auth directly
@@ -74,13 +70,16 @@ export function AuthProvider({ children }) {
async function register(email, username, password) {
const data = await api.register(email, username, password);
setUser(data.user);
- // After first registration, setup is complete - update status
+ return data;
+ }
+
+ async function completeOnboarding(useCases) {
+ await api.completeOnboarding(useCases);
setSetupStatus({
needsSetup: false,
registrationEnabled: false,
checked: true
});
- return data;
}
function logout() {
@@ -106,6 +105,7 @@ export function AuthProvider({ children }) {
loading,
login,
register,
+ completeOnboarding,
logout,
updateUser,
refreshUser,
diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx
index 8db6aaf1..8bfe553e 100644
--- a/frontend/src/pages/Settings.jsx
+++ b/frontend/src/pages/Settings.jsx
@@ -4,12 +4,32 @@ import { useTheme } from '../contexts/ThemeContext';
import api from '../services/api';
import UsersTab from '../components/settings/UsersTab';
import AuditLogTab from '../components/settings/AuditLogTab';
-import { Github, FileText, HelpCircle, MessageSquare, Bug, Check, Download, CheckCircle, RefreshCw, ExternalLink, Star, X } from 'lucide-react';
+import {
+ Github, FileText, HelpCircle, MessageSquare, Bug, Check, Download, CheckCircle,
+ RefreshCw, ExternalLink, Star, X, Code, Search, Container, Globe, BarChart3,
+ Database, Shield, Cloud, Video, Music, Image, Home, Server, GitBranch, Workflow,
+ HardDrive, Lock, Users, Settings as SettingsIcon, Layers, ChevronDown, Copy, Tag,
+ Cpu, AlertTriangle, Info, Activity, Terminal, Play, Square, Trash2, Plus, Package,
+ ArrowRight, ArrowLeft, Eye, Save, Clock, Calendar, Edit3, Link, Unlink, Archive,
+ Radio, Zap, MemoryStick, Monitor, Sun, Moon, ChevronRight, ChevronUp, LogOut,
+ Loader, RotateCcw, FolderOpen, Layout, Palette, Camera, Newspaper, TrendingUp,
+ Sparkles, ArrowUpCircle, AlertCircle, XCircle, GitCompare, GitCommit, Rocket,
+ Minus, Unlock, ArrowDownLeft, ArrowUpRight
+} from 'lucide-react';
import ServerKitLogo from '../assets/ServerKitLogo.svg';
const Settings = () => {
const [activeTab, setActiveTab] = useState('profile');
const { isAdmin } = useAuth();
+ const [devMode, setDevMode] = useState(false);
+
+ useEffect(() => {
+ if (isAdmin) {
+ api.getSystemSettings().then(data => {
+ setDevMode(data.dev_mode || false);
+ }).catch(() => {});
+ }
+ }, [isAdmin]);
return (
<div className="page settings-page">
@@ -120,6 +140,18 @@ const Settings = () => {
</button>
</>
)}
+ {devMode && isAdmin && (
+ <>
+ <div className="settings-nav-divider">Developer</div>
+ <button
+ className={`settings-nav-item ${activeTab === 'developer' ? 'active' : ''}`}
+ onClick={() => setActiveTab('developer')}
+ >
+ <Code size={18} />
+ Icon Reference
+ </button>
+ </>
+ )}
<button
className={`settings-nav-item ${activeTab === 'about' ? 'active' : ''}`}
onClick={() => setActiveTab('about')}
@@ -141,7 +173,8 @@ const Settings = () => {
{activeTab === 'system' && <SystemInfo />}
{activeTab === 'users' && isAdmin && <UsersTab />}
{activeTab === 'audit' && isAdmin && <AuditLogTab />}
- {activeTab === 'site' && isAdmin && <SiteSettings />}
+ {activeTab === 'site' && isAdmin && <SiteSettings onDevModeChange={setDevMode} />}
+ {activeTab === 'developer' && devMode && isAdmin && <IconReference />}
{activeTab === 'about' && <AboutSection />}
</div>
</div>
@@ -1914,9 +1947,10 @@ const AboutSection = () => {
);
};
-const SiteSettings = () => {
+const SiteSettings = ({ onDevModeChange }) => {
const [settings, setSettings] = useState({
- registration_enabled: false
+ registration_enabled: false,
+ dev_mode: false
});
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
@@ -1930,7 +1964,8 @@ const SiteSettings = () => {
try {
const data = await api.getSystemSettings();
setSettings({
- registration_enabled: data.registration_enabled || false
+ registration_enabled: data.registration_enabled || false,
+ dev_mode: data.dev_mode || false
});
} catch (err) {
console.error('Failed to load settings:', err);
@@ -1939,15 +1974,18 @@ const SiteSettings = () => {
}
}
- async function handleToggleRegistration() {
+ async function handleToggleSetting(key, label) {
setSaving(true);
setMessage(null);
try {
- const newValue = !settings.registration_enabled;
- await api.updateSystemSetting('registration_enabled', newValue);
- setSettings({ ...settings, registration_enabled: newValue });
- setMessage({ type: 'success', text: `User registration ${newValue ? 'enabled' : 'disabled'}` });
+ const newValue = !settings[key];
+ await api.updateSystemSetting(key, newValue);
+ setSettings({ ...settings, [key]: newValue });
+ setMessage({ type: 'success', text: `${label} ${newValue ? 'enabled' : 'disabled'}` });
+ if (key === 'dev_mode' && onDevModeChange) {
+ onDevModeChange(newValue);
+ }
} catch (err) {
setMessage({ type: 'error', text: err.message || 'Failed to update setting' });
} finally {
@@ -1979,7 +2017,7 @@ const SiteSettings = () => {
<input
type="checkbox"
checked={settings.registration_enabled}
- onChange={handleToggleRegistration}
+ onChange={() => handleToggleSetting('registration_enabled', 'User registration')}
disabled={saving}
/>
<span className="toggle-slider"></span>
@@ -1990,6 +2028,146 @@ const SiteSettings = () => {
</span>
</div>
</div>
+
+ <div className="settings-card">
+ <h3>Developer Mode</h3>
+ <p>Enable developer tools and diagnostics.</p>
+
+ <div className="form-group">
+ <label className="toggle-switch-label">
+ <span>Enable developer mode</span>
+ <label className="toggle-switch">
+ <input
+ type="checkbox"
+ checked={settings.dev_mode}
+ onChange={() => handleToggleSetting('dev_mode', 'Developer mode')}
+ disabled={saving}
+ />
+ <span className="toggle-slider"></span>
+ </label>
+ </label>
+ <span className="form-help">
+ Enables the Developer tab with icon reference and diagnostic tools.
+ </span>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+const ICON_CATALOG = {
+ 'General': {
+ Search, X, Check, Copy, Plus, Trash2, Edit3, Save, Eye, Info,
+ HelpCircle, AlertTriangle, AlertCircle, ExternalLink, Link, Unlink,
+ ChevronDown, ChevronRight, ChevronUp, ArrowRight, ArrowLeft,
+ ArrowUpRight, ArrowDownLeft, ArrowUpCircle
+ },
+ 'Status': {
+ CheckCircle, XCircle, Loader, RefreshCw, RotateCcw, Activity,
+ Zap, Sparkles
+ },
+ 'Files & Data': {
+ FileText, FolderOpen, Archive, Download, Package, Database,
+ HardDrive, Layers, Tag
+ },
+ 'Media': {
+ Image, Video, Music, Camera
+ },
+ 'Development': {
+ Code, Terminal, GitBranch, GitCommit, GitCompare, Rocket,
+ Bug, Container, Workflow, Layout
+ },
+ 'Infrastructure': {
+ Server, Globe, Cloud, Shield, Lock, Unlock, Cpu, MemoryStick,
+ Radio, Monitor
+ },
+ 'Communication': {
+ MessageSquare, Users
+ },
+ 'Navigation & UI': {
+ Home, Star, Sun, Moon, Palette, Play, Square, Calendar, Clock,
+ LogOut, SettingsIcon, Newspaper, TrendingUp, BarChart3, Minus
+ },
+ 'Brands': {
+ Github
+ }
+};
+
+const IconReference = () => {
+ const [searchQuery, setSearchQuery] = useState('');
+ const [copiedIcon, setCopiedIcon] = useState(null);
+
+ function handleCopyImport(name) {
+ navigator.clipboard.writeText(name);
+ setCopiedIcon(name);
+ setTimeout(() => setCopiedIcon(null), 1500);
+ }
+
+ const filteredCatalog = Object.entries(ICON_CATALOG).reduce((acc, [group, icons]) => {
+ if (!searchQuery) {
+ acc[group] = icons;
+ return acc;
+ }
+ const filtered = Object.entries(icons).filter(([name]) =>
+ name.toLowerCase().includes(searchQuery.toLowerCase())
+ );
+ if (filtered.length > 0) {
+ acc[group] = Object.fromEntries(filtered);
+ }
+ return acc;
+ }, {});
+
+ const totalIcons = Object.values(ICON_CATALOG).reduce((sum, icons) => sum + Object.keys(icons).length, 0);
+
+ return (
+ <div className="settings-section">
+ <h2>Icon Reference</h2>
+ <p className="section-description">
+ Lucide React icons available in the project ({totalIcons} icons). Click an icon name to copy it.
+ </p>
+
+ <div className="settings-card">
+ <div className="form-group">
+ <div className="search-input-wrapper" style={{ position: 'relative' }}>
+ <Search size={16} style={{ position: 'absolute', left: 12, top: '50%', transform: 'translateY(-50%)', opacity: 0.5 }} />
+ <input
+ type="text"
+ placeholder="Search icons..."
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ className="form-input"
+ style={{ paddingLeft: 36 }}
+ />
+ </div>
+ </div>
+ </div>
+
+ {Object.entries(filteredCatalog).map(([group, icons]) => (
+ <div key={group} className="settings-card">
+ <h3>{group}</h3>
+ <div className="icon-reference-grid">
+ {Object.entries(icons).map(([name, IconComp]) => (
+ <button
+ key={name}
+ className={`icon-reference-item ${copiedIcon === name ? 'copied' : ''}`}
+ onClick={() => handleCopyImport(name)}
+ title={`Click to copy "${name}"`}
+ >
+ <IconComp size={20} />
+ <span className="icon-reference-name">
+ {copiedIcon === name ? 'Copied!' : name}
+ </span>
+ </button>
+ ))}
+ </div>
+ </div>
+ ))}
+
+ {Object.keys(filteredCatalog).length === 0 && (
+ <div className="settings-card">
+ <p style={{ textAlign: 'center', opacity: 0.5 }}>No icons match "{searchQuery}"</p>
+ </div>
+ )}
</div>
);
};
diff --git a/frontend/src/pages/Setup.jsx b/frontend/src/pages/Setup.jsx
index 6a59b8c9..1be6ae40 100644
--- a/frontend/src/pages/Setup.jsx
+++ b/frontend/src/pages/Setup.jsx
@@ -1,131 +1,146 @@
-import React, { useState } from 'react';
+import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { useAuth } from '../contexts/AuthContext';
+import { Check, ArrowLeft } from 'lucide-react';
+import ServerKitLogo from '../assets/ServerKitLogo.svg';
+import SetupStepAccount from '../components/setup/SetupStepAccount';
+import SetupStepIntent from '../components/setup/SetupStepIntent';
+import SetupStepTier from '../components/setup/SetupStepTier';
+import SetupStepSummary from '../components/setup/SetupStepSummary';
+
+const TOTAL_STEPS = 4;
+
+const STEP_TITLES = [
+ 'Account',
+ 'Use Cases',
+ 'Resources',
+ 'Summary',
+];
const Setup = () => {
- const [email, setEmail] = useState('');
- const [username, setUsername] = useState('');
- const [password, setPassword] = useState('');
- const [confirmPassword, setConfirmPassword] = useState('');
- const [error, setError] = useState('');
- const [loading, setLoading] = useState(false);
- const { register } = useAuth();
+ const { isAuthenticated, completeOnboarding } = useAuth();
const navigate = useNavigate();
- async function handleSubmit(e) {
- e.preventDefault();
- setError('');
+ const [currentStep, setCurrentStep] = useState(1);
+ const [accountInfo, setAccountInfo] = useState(null);
+ const [useCases, setUseCases] = useState([]);
- if (password !== confirmPassword) {
- setError('Passwords do not match');
- return;
+ // If user is already authenticated (e.g. page refresh mid-wizard), skip to step 2
+ useEffect(() => {
+ if (isAuthenticated && currentStep === 1) {
+ setCurrentStep(2);
}
+ }, [isAuthenticated]);
- if (password.length < 8) {
- setError('Password must be at least 8 characters');
- return;
+ function handleAccountComplete(info) {
+ setAccountInfo(info);
+ setCurrentStep(2);
+ }
+
+ function handleIntentComplete(selections) {
+ setUseCases(selections);
+ setCurrentStep(3);
+ }
+
+ function handleTierComplete() {
+ setCurrentStep(4);
+ }
+
+ async function handleFinish() {
+ await completeOnboarding(useCases);
+ navigate('/');
+ }
+
+ function handleBack() {
+ if (currentStep > 2) {
+ setCurrentStep(currentStep - 1);
}
+ }
- setLoading(true);
+ function renderProgressBar() {
+ const items = [];
+ for (let i = 1; i <= TOTAL_STEPS; i++) {
+ if (i > 1) {
+ items.push(
+ <div
+ key={`line-${i}`}
+ className={`wizard-progress-line${i <= currentStep ? ' active' : ''}`}
+ />
+ );
+ }
+ let stepClass = 'wizard-progress-step';
+ if (i < currentStep) stepClass += ' completed';
+ else if (i === currentStep) stepClass += ' active';
+
+ items.push(
+ <div key={`step-${i}`} className={stepClass} title={STEP_TITLES[i - 1]}>
+ {i < currentStep ? <Check size={16} /> : i}
+ </div>
+ );
+ }
+ return <div className="wizard-progress">{items}</div>;
+ }
- try {
- await register(email, username, password);
- // User is now logged in, redirect to home
- navigate('/');
- } catch (err) {
- setError(err.message || 'Failed to create admin account');
- } finally {
- setLoading(false);
+ function renderStep() {
+ switch (currentStep) {
+ case 1:
+ return <SetupStepAccount onComplete={handleAccountComplete} />;
+ case 2:
+ return (
+ <SetupStepIntent
+ selections={useCases}
+ onComplete={handleIntentComplete}
+ />
+ );
+ case 3:
+ return (
+ <SetupStepTier
+ useCases={useCases}
+ onComplete={handleTierComplete}
+ />
+ );
+ case 4:
+ return (
+ <SetupStepSummary
+ accountInfo={accountInfo}
+ useCases={useCases}
+ onFinish={handleFinish}
+ />
+ );
+ default:
+ return null;
}
}
return (
- <div className="auth-container">
- <div className="auth-card setup-card">
- <div className="auth-header">
- <div className="brand-logo">
- <svg viewBox="0 0 24 24" width="32" height="32" stroke="currentColor" fill="none" strokeWidth="2">
- <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
- </svg>
- </div>
+ <div className="setup-wizard">
+ <div className="wizard-card">
+ <div className="wizard-header">
+ <img
+ className="wizard-logo"
+ src={ServerKitLogo}
+ alt="ServerKit"
+ width="48"
+ height="48"
+ />
<h1>Welcome to ServerKit</h1>
- <p>Let's set up your admin account</p>
+ <p>Let's get your server ready</p>
</div>
- <div className="setup-info">
- <div className="setup-info-icon">
- <svg viewBox="0 0 24 24" width="20" height="20" stroke="currentColor" fill="none" strokeWidth="2">
- <circle cx="12" cy="12" r="10"/>
- <line x1="12" y1="16" x2="12" y2="12"/>
- <line x1="12" y1="8" x2="12.01" y2="8"/>
- </svg>
- </div>
- <p>This is your first time using ServerKit. Create an administrator account to get started. This account will have full access to manage your server.</p>
- </div>
+ {renderProgressBar()}
- {error && <div className="error-message">{error}</div>}
-
- <form onSubmit={handleSubmit}>
- <div className="form-group">
- <label htmlFor="email">Admin Email</label>
- <input
- type="email"
- id="email"
- value={email}
- onChange={(e) => setEmail(e.target.value)}
- placeholder="[email protected]"
- required
- autoFocus
- />
- </div>
-
- <div className="form-group">
- <label htmlFor="username">Username</label>
- <input
- type="text"
- id="username"
- value={username}
- onChange={(e) => setUsername(e.target.value)}
- placeholder="Choose a username"
- required
- />
- </div>
-
- <div className="form-group">
- <label htmlFor="password">Password</label>
- <input
- type="password"
- id="password"
- value={password}
- onChange={(e) => setPassword(e.target.value)}
- placeholder="At least 8 characters"
- required
- />
- </div>
-
- <div className="form-group">
- <label htmlFor="confirmPassword">Confirm Password</label>
- <input
- type="password"
- id="confirmPassword"
- value={confirmPassword}
- onChange={(e) => setConfirmPassword(e.target.value)}
- placeholder="Confirm your password"
- required
- />
- </div>
-
- <button type="submit" className="btn btn-primary btn-full" disabled={loading}>
- {loading ? 'Creating account...' : 'Create Admin Account'}
+ {currentStep > 2 && (
+ <button
+ className="btn-wizard-prev"
+ onClick={handleBack}
+ style={{ marginBottom: 16 }}
+ >
+ <ArrowLeft size={16} />
+ Back
</button>
- </form>
+ )}
- <div className="setup-footer">
- <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" fill="none" strokeWidth="2">
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
- </svg>
- <span>Your data is stored securely on this server</span>
- </div>
+ {renderStep()}
</div>
</div>
);
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 339bb35f..ee2b3409 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -4,7 +4,8 @@ import {
Search, X, Star, ExternalLink, BookOpen, Container, Globe, BarChart3,
Database, Shield, Cloud, MessageSquare, Video, Music, Image, Home,
Code, Server, GitBranch, Workflow, HardDrive, Lock, Users, FileText,
- Settings, Layers, ChevronDown, Copy, Check, Tag, Cpu, HardDriveIcon
+ Settings, Layers, ChevronDown, Copy, Check, Tag, Cpu, HardDriveIcon,
+ Newspaper, TrendingUp
} from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
@@ -219,29 +220,30 @@ const Templates = () => {
function getCategoryIcon(category) {
const icons = {
- monitoring: '📊',
- devops: '⚙️',
- docker: '🐳',
- cms: '📝',
- blog: '✍️',
- storage: '💾',
- collaboration: '👥',
- git: '🔀',
- development: '💻',
- networking: '🌐',
- proxy: '🔄',
- ssl: '🔒',
- productivity: '📋',
- management: '📁',
- publishing: '📰',
- media: '🎬',
- security: '🛡️',
- database: '🗄️',
- 'home-automation': '🏠',
- analytics: '📈',
- iot: '📡'
+ monitoring: BarChart3,
+ devops: Settings,
+ docker: Container,
+ cms: FileText,
+ blog: BookOpen,
+ storage: HardDrive,
+ collaboration: Users,
+ git: GitBranch,
+ development: Code,
+ networking: Globe,
+ proxy: Workflow,
+ ssl: Lock,
+ productivity: Layers,
+ management: Server,
+ publishing: Newspaper,
+ media: Video,
+ security: Shield,
+ database: Database,
+ 'home-automation': Home,
+ analytics: TrendingUp,
+ iot: Cpu
};
- return icons[category] || '📦';
+ const Icon = icons[category] || Container;
+ return <Icon size={14} />;
}
async function handleViewTemplate(template) {
diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js
index 6257d36c..1d0bd7c7 100644
--- a/frontend/src/services/api.js
+++ b/frontend/src/services/api.js
@@ -115,6 +115,13 @@ class ApiService {
return data;
}
+ async completeOnboarding(useCases) {
+ return this.request('/auth/complete-onboarding', {
+ method: 'POST',
+ body: { use_cases: useCases },
+ });
+ }
+
async logout() {
this.clearTokens();
}
@@ -183,7 +190,14 @@ class ApiService {
// Admin - System Settings endpoints
// ========================================
async getSystemSettings() {
- return this.request('/admin/settings');
+ const data = await this.request('/admin/settings');
+ const result = {};
+ if (data.settings && Array.isArray(data.settings)) {
+ for (const setting of data.settings) {
+ result[setting.key] = setting.value;
+ }
+ }
+ return result;
}
async updateSystemSettings(settings) {
diff --git a/frontend/src/styles/main.less b/frontend/src/styles/main.less
index d32bc796..9ba196cc 100644
--- a/frontend/src/styles/main.less
+++ b/frontend/src/styles/main.less
@@ -78,3 +78,4 @@
@import 'pages/_wordpress';
@import 'pages/_wordpress-pipeline';
@import 'pages/_ssl';
+@import 'pages/_setup-wizard';
diff --git a/frontend/src/styles/pages/_settings.less b/frontend/src/styles/pages/_settings.less
index 1417fae5..47d9d863 100644
--- a/frontend/src/styles/pages/_settings.less
+++ b/frontend/src/styles/pages/_settings.less
@@ -922,3 +922,55 @@
color: @text-tertiary;
font-style: italic;
}
+
+// ============================================
+// ICON REFERENCE (Developer Mode)
+// ============================================
+
+.icon-reference-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
+ gap: @space-2;
+ margin-top: @space-3;
+}
+
+.icon-reference-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: @space-1;
+ padding: @space-3 @space-2;
+ border: 1px solid @border-default;
+ border-radius: @radius-md;
+ background: @bg-card;
+ cursor: pointer;
+ transition: all 0.15s ease;
+
+ &:hover {
+ border-color: @accent-primary;
+ background: @bg-hover;
+ }
+
+ &.copied {
+ border-color: @success;
+ background: @success-bg;
+ }
+
+ svg {
+ color: @text-primary;
+ opacity: 0.8;
+ }
+
+ .icon-reference-name {
+ font-size: @font-size-xs;
+ color: @text-secondary;
+ text-align: center;
+ word-break: break-word;
+ line-height: 1.2;
+ }
+
+ &.copied .icon-reference-name {
+ color: @success;
+ font-weight: @font-weight-medium;
+ }
+}
diff --git a/frontend/src/styles/pages/_setup-wizard.less b/frontend/src/styles/pages/_setup-wizard.less
new file mode 100644
index 00000000..a8e10a93
--- /dev/null
+++ b/frontend/src/styles/pages/_setup-wizard.less
@@ -0,0 +1,459 @@
+// ============================================
+// SETUP WIZARD (Onboarding)
+// ============================================
+
+.setup-wizard {
+ min-height: 100vh;
+ .flex-center();
+ padding: @space-5;
+ background: @bg-body;
+}
+
+.wizard-card {
+ width: 100%;
+ max-width: 700px;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
+ border-radius: @radius-2xl;
+ padding: @space-10;
+}
+
+// --------------------------------------------
+// Header (logo + title)
+// --------------------------------------------
+.wizard-header {
+ text-align: center;
+ margin-bottom: @space-8;
+
+ .wizard-logo {
+ width: 48px;
+ height: 48px;
+ margin: 0 auto @space-4;
+ }
+
+ h1 {
+ font-size: @font-size-2xl;
+ font-weight: @font-weight-bold;
+ margin-bottom: @space-2;
+ }
+
+ p {
+ color: @text-secondary;
+ }
+}
+
+// --------------------------------------------
+// Progress bar
+// --------------------------------------------
+.wizard-progress {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: @space-3;
+ margin-bottom: @space-8;
+}
+
+.wizard-progress-step {
+ .flex-center();
+ width: 32px;
+ height: 32px;
+ border-radius: @radius-full;
+ font-size: @font-size-sm;
+ font-weight: @font-weight-semibold;
+ border: 2px solid @border-default;
+ color: @text-tertiary;
+ background: transparent;
+ .transition();
+
+ &.active {
+ border-color: @accent-primary;
+ background: @accent-primary;
+ color: #fff;
+ }
+
+ &.completed {
+ border-color: @accent-primary;
+ background: fade(@accent-primary, 15%);
+ color: @accent-primary;
+ }
+}
+
+.wizard-progress-line {
+ width: 40px;
+ height: 2px;
+ background: @border-default;
+ .transition(background);
+
+ &.active {
+ background: @accent-primary;
+ }
+}
+
+// --------------------------------------------
+// Step content
+// --------------------------------------------
+.wizard-step {
+ animation: wizardFadeIn 0.3s ease;
+}
+
+@keyframes wizardFadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(8px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.wizard-step-title {
+ font-size: @font-size-lg;
+ font-weight: @font-weight-semibold;
+ margin-bottom: @space-2;
+}
+
+.wizard-step-description {
+ color: @text-secondary;
+ font-size: @font-size-base;
+ margin-bottom: @space-6;
+}
+
+// --------------------------------------------
+// Option grid (Step 2 — use cases)
+// --------------------------------------------
+.option-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: @space-4;
+ margin-bottom: @space-6;
+
+ @media (max-width: @breakpoint-sm) {
+ grid-template-columns: 1fr;
+ }
+}
+
+.option-card {
+ display: flex;
+ flex-direction: column;
+ gap: @space-3;
+ padding: @space-5;
+ background: @bg-elevated;
+ border: 2px solid @border-default;
+ border-radius: @radius-xl;
+ cursor: pointer;
+ .transition();
+ position: relative;
+
+ &:hover {
+ border-color: @border-active;
+ }
+
+ &.selected {
+ border-color: @accent-primary;
+ background: fade(@accent-primary, 8%);
+ }
+
+ .option-card-icon {
+ .icon-box(40px);
+ background: @bg-secondary;
+ color: @text-secondary;
+ border-radius: @radius-lg;
+ }
+
+ .option-card-label {
+ font-weight: @font-weight-semibold;
+ font-size: @font-size-base;
+ }
+
+ .option-card-desc {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ line-height: @line-height-normal;
+ }
+
+ .option-card-check {
+ position: absolute;
+ top: @space-3;
+ right: @space-3;
+ width: 22px;
+ height: 22px;
+ border-radius: @radius-full;
+ .flex-center();
+ background: @accent-primary;
+ color: #fff;
+ opacity: 0;
+ transform: scale(0.5);
+ .transition();
+ }
+
+ &.selected .option-card-check {
+ opacity: 1;
+ transform: scale(1);
+ }
+}
+
+// --------------------------------------------
+// Tier grid (Step 3)
+// --------------------------------------------
+.tier-grid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: @space-4;
+ margin-bottom: @space-6;
+
+ @media (max-width: @breakpoint-md) {
+ grid-template-columns: 1fr;
+ }
+}
+
+.tier-card {
+ display: flex;
+ flex-direction: column;
+ padding: @space-5;
+ background: @bg-elevated;
+ border: 2px solid @border-default;
+ border-radius: @radius-xl;
+ .transition();
+
+ &.detected {
+ border-color: @accent-primary;
+ background: fade(@accent-primary, 8%);
+ }
+
+ .tier-card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: @space-4;
+ }
+
+ .tier-card-name {
+ font-weight: @font-weight-bold;
+ font-size: @font-size-md;
+ }
+
+ .tier-card-badge {
+ font-size: @font-size-xs;
+ padding: 2px 8px;
+ background: @accent-primary;
+ color: #fff;
+ border-radius: @radius-full;
+ font-weight: @font-weight-medium;
+ }
+
+ .tier-card-specs {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ margin-bottom: @space-4;
+ padding-bottom: @space-4;
+ border-bottom: 1px solid @border-default;
+ }
+
+ .tier-features {
+ display: flex;
+ flex-direction: column;
+ gap: @space-2;
+ flex: 1;
+ }
+
+ .tier-feature {
+ display: flex;
+ align-items: center;
+ gap: @space-2;
+ font-size: @font-size-sm;
+
+ .feature-icon {
+ flex-shrink: 0;
+ width: 16px;
+ height: 16px;
+ }
+
+ &.available .feature-icon {
+ color: @success;
+ }
+
+ &.unavailable {
+ color: @text-tertiary;
+
+ .feature-icon {
+ color: @text-tertiary;
+ }
+ }
+ }
+}
+
+.tier-warning {
+ display: flex;
+ align-items: flex-start;
+ gap: @space-3;
+ padding: @space-4;
+ background: @warning-bg;
+ border: 1px solid @warning-border;
+ border-radius: @radius-lg;
+ margin-bottom: @space-6;
+
+ .tier-warning-icon {
+ flex-shrink: 0;
+ color: @warning;
+ }
+
+ .tier-warning-text {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ line-height: @line-height-normal;
+ }
+}
+
+// --------------------------------------------
+// Summary panel (Step 4)
+// --------------------------------------------
+.summary-panel {
+ background: @bg-elevated;
+ border: 1px solid @border-default;
+ border-radius: @radius-xl;
+ padding: @space-6;
+ margin-bottom: @space-6;
+}
+
+.summary-section {
+ &:not(:last-child) {
+ margin-bottom: @space-5;
+ padding-bottom: @space-5;
+ border-bottom: 1px solid @border-default;
+ }
+}
+
+.summary-section-title {
+ font-size: @font-size-sm;
+ font-weight: @font-weight-semibold;
+ color: @text-tertiary;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: @space-3;
+}
+
+.summary-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-2 0;
+
+ .summary-label {
+ color: @text-secondary;
+ font-size: @font-size-sm;
+ }
+
+ .summary-value {
+ font-weight: @font-weight-medium;
+ font-size: @font-size-sm;
+ }
+}
+
+.summary-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: @space-2;
+}
+
+.summary-tag {
+ display: inline-flex;
+ align-items: center;
+ padding: @space-1 @space-3;
+ background: fade(@accent-primary, 12%);
+ color: @accent-primary;
+ border-radius: @radius-full;
+ font-size: @font-size-sm;
+ font-weight: @font-weight-medium;
+}
+
+.recommendation-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: @space-2;
+}
+
+.recommendation-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: @space-2;
+ padding: @space-2 @space-4;
+ background: @bg-secondary;
+ border: 1px solid @border-default;
+ border-radius: @radius-lg;
+ font-size: @font-size-sm;
+ color: @text-primary;
+}
+
+// --------------------------------------------
+// Navigation buttons
+// --------------------------------------------
+.wizard-nav {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: @space-8;
+ padding-top: @space-6;
+ border-top: 1px solid @border-default;
+}
+
+.btn-wizard-prev {
+ .button-base();
+ color: @text-secondary;
+ border-color: @border-default;
+ background: transparent;
+
+ &:hover {
+ background: @bg-hover;
+ color: @text-primary;
+ }
+}
+
+.btn-wizard-next {
+ .button-base();
+ background: @accent-primary;
+ color: #fff;
+ margin-left: auto;
+
+ &:hover {
+ background: @accent-hover;
+ }
+
+ &:disabled {
+ opacity: 0.6;
+ cursor: not-allowed;
+ }
+}
+
+// --------------------------------------------
+// Setup info banner (reused in step 1)
+// --------------------------------------------
+.wizard-info-banner {
+ display: flex;
+ gap: @space-4;
+ padding: @space-4;
+ background: fade(@accent-primary, 10%);
+ border-radius: @radius-md;
+ margin-bottom: @space-6;
+
+ .wizard-info-icon {
+ flex-shrink: 0;
+ color: @accent-primary;
+ }
+
+ p {
+ margin: 0;
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ line-height: @line-height-normal;
+ }
+}
+
+// --------------------------------------------
+// Loading state
+// --------------------------------------------
+.wizard-loading {
+ .flex-center();
+ padding: @space-10;
+ color: @text-secondary;
+}