Skip to content

Local social media automation dashboard for TikTok, Instagram, and YouTube.

Add first-run setup health dashboard

Katzcad4f5b417acfd
diff --git a/README.md b/README.md
index 29b5e74..fde1a5b 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,8 @@ local control plane.
## Features
- Manage multiple brands/accounts with isolated queues and browser sessions.
+- Use the First-Run Setup page to verify local dependencies, login sessions,
+ and queue folders.
- Post queued videos to TikTok, Instagram, and YouTube.
- Persist Playwright login sessions under `.profiles/<account>/<platform>`.
- Schedule posts with cron expressions, daily times, or instant-post mode.
@@ -81,6 +83,9 @@ npm run dashboard
Open http://127.0.0.1:3000.
+Start with the `Setup` view. It checks local dependencies and shows the exact
+pending folders where videos should be dropped for each platform.
+
## Configuration
Copy `.env.example` to `.env` and review the values that matter for your
diff --git a/SETUP.md b/SETUP.md
index ff72c0b..5f126ca 100644
--- a/SETUP.md
+++ b/SETUP.md
@@ -73,8 +73,12 @@ npm run dashboard
Open http://127.0.0.1:3000.
+Start with the `Setup` view. It shows local dependency checks, saved platform
+sessions, and the exact pending folders for the active brand.
+
The dashboard controls:
+- First-run setup and health checks
- Account switching
- Platform login sessions
- TikTok, Instagram, and YouTube schedulers
diff --git a/src/dashboard-server.js b/src/dashboard-server.js
index 13c4ee5..2bc26df 100644
--- a/src/dashboard-server.js
+++ b/src/dashboard-server.js
@@ -11,6 +11,7 @@ const { ProfileDownloadController } = require("./profile-download-controller");
const { getDaemons, getAllStatus } = require("./daemon-registry");
const { migrateQueueIfNeeded } = require("./migrate-queue");
const { createDashboardRequestGuard } = require("./request-guard");
+const { buildSetupHealth, getAllowedSetupFolderPath } = require("./setup-health");
const {
startDashboardLoginSession: startTikTokLoginSession,
getLoginSessionStatus: getTikTokLoginSessionStatus,
@@ -506,6 +507,32 @@ async function createServer() {
}
});
+ // First-run setup and health endpoints
+
+ app.get("/api/setup/health", async (req, res) => {
+ try {
+ res.json(await buildSetupHealth());
+ } catch (error) {
+ res.status(500).json({ ok: false, error: error.message });
+ }
+ });
+
+ app.post("/api/setup/open-folder", async (req, res) => {
+ try {
+ const active = await getActiveAccount();
+ const folderPath = getAllowedSetupFolderPath(req.body?.key, active.id);
+ if (!folderPath) {
+ return res.status(400).json({ ok: false, error: "Unsupported setup folder key." });
+ }
+
+ await fs.mkdir(folderPath, { recursive: true });
+ await openFolder(folderPath);
+ res.json({ ok: true, path: folderPath });
+ } catch (error) {
+ res.status(400).json({ ok: false, error: error.message });
+ }
+ });
+
// Uniquifier endpoints
app.get("/api/uniquifier/status", async (req, res) => {
diff --git a/src/setup-health.js b/src/setup-health.js
new file mode 100644
index 0000000..2f33599
--- /dev/null
+++ b/src/setup-health.js
@@ -0,0 +1,322 @@
+const fs = require("fs");
+const path = require("path");
+const { spawnSync } = require("child_process");
+const { config } = require("./config");
+const {
+ getActiveAccount,
+ getAccountQueueDirs,
+ getPlatformProfileDir,
+ hasSavedPlatformSession,
+ PLATFORMS,
+} = require("./account-manager");
+
+const PLATFORM_LABELS = {
+ tiktok: "TikTok",
+ instagram: "Instagram",
+ youtube: "YouTube",
+};
+
+const VIDEO_EXTENSIONS = new Set([".mp4", ".mov", ".webm", ".avi", ".mkv"]);
+
+function commandWorks(command, args, cwd = config.projectRoot) {
+ const candidates =
+ process.platform === "win32" && !/\.(cmd|exe)$/i.test(command)
+ ? [command, `${command}.cmd`, `${command}.exe`]
+ : [command];
+
+ for (const candidate of candidates) {
+ const result = spawnSync(candidate, args, {
+ cwd,
+ encoding: "utf8",
+ windowsHide: true,
+ });
+
+ if (result.error && result.error.code === "ENOENT") {
+ continue;
+ }
+
+ return {
+ ok: result.status === 0,
+ output: (result.stdout || result.stderr || "").trim().split(/\r?\n/)[0] || "",
+ error: result.error,
+ };
+ }
+
+ return { ok: false, output: "", error: new Error(`${command} not found`) };
+}
+
+function safeStat(targetPath) {
+ try {
+ return fs.statSync(targetPath);
+ } catch {
+ return null;
+ }
+}
+
+function countPendingVideos(folderPath) {
+ try {
+ return fs
+ .readdirSync(folderPath, { withFileTypes: true })
+ .filter((entry) => entry.isFile() && VIDEO_EXTENSIONS.has(path.extname(entry.name).toLowerCase()))
+ .length;
+ } catch {
+ return 0;
+ }
+}
+
+function makeCheck(id, label, status, detail, action = "") {
+ return { id, label, status, detail, action };
+}
+
+function checkNpmAvailable() {
+ if (process.env.npm_execpath) {
+ return {
+ ok: true,
+ output: process.env.npm_config_user_agent || "npm available",
+ };
+ }
+
+ if (process.platform === "win32") {
+ return commandWorks("cmd.exe", ["/d", "/s", "/c", "npm --version"]);
+ }
+
+ return commandWorks("npm", ["--version"]);
+}
+
+function countStatuses(checks) {
+ return checks.reduce(
+ (acc, check) => {
+ acc[check.status] = (acc[check.status] || 0) + 1;
+ return acc;
+ },
+ { ok: 0, warn: 0, fail: 0 }
+ );
+}
+
+function getOverallStatus(counts) {
+ if (counts.fail > 0) return "fail";
+ if (counts.warn > 0) return "warn";
+ return "ok";
+}
+
+function getAllowedSetupFolderPath(key, accountId) {
+ const queueDirs = getAccountQueueDirs(accountId);
+ const folderMap = {
+ tiktokPending: queueDirs.tiktok.pending,
+ instagramPending: queueDirs.instagram.pending,
+ youtubePending: queueDirs.youtube.pending,
+ uniquifierInput: config.uniquifyInputDir,
+ uniquifierOutput: config.uniquifyOutputDir,
+ };
+
+ return folderMap[key] || null;
+}
+
+async function buildSetupHealth() {
+ const activeAccount = await getActiveAccount();
+ const checks = [];
+
+ const nodeMajor = Number(process.versions.node.split(".")[0]);
+ checks.push(
+ makeCheck(
+ "node",
+ "Node.js",
+ nodeMajor >= 18 ? "ok" : "fail",
+ `${process.versions.node} installed`,
+ "Install Node.js 18 or newer."
+ )
+ );
+
+ const npm = checkNpmAvailable();
+ checks.push(
+ makeCheck(
+ "npm",
+ "npm",
+ npm.ok ? "ok" : "fail",
+ npm.ok ? npm.output : "npm was not found",
+ "Install npm or use the Node.js installer."
+ )
+ );
+
+ const envPath = path.join(config.projectRoot, ".env");
+ checks.push(
+ makeCheck(
+ "env",
+ ".env file",
+ safeStat(envPath)?.isFile() ? "ok" : "warn",
+ safeStat(envPath)?.isFile() ? ".env exists" : ".env is missing",
+ "Copy .env.example to .env and review local settings."
+ )
+ );
+
+ const ffmpeg = commandWorks("ffmpeg", ["-version"]);
+ checks.push(
+ makeCheck(
+ "ffmpeg",
+ "FFmpeg",
+ ffmpeg.ok ? "ok" : "fail",
+ ffmpeg.ok ? ffmpeg.output : "ffmpeg was not found in PATH",
+ "Install FFmpeg and add it to PATH."
+ )
+ );
+
+ const ffprobe = commandWorks("ffprobe", ["-version"]);
+ checks.push(
+ makeCheck(
+ "ffprobe",
+ "ffprobe",
+ ffprobe.ok ? "ok" : "fail",
+ ffprobe.ok ? ffprobe.output : "ffprobe was not found in PATH",
+ "Install FFmpeg and add ffprobe to PATH."
+ )
+ );
+
+ try {
+ const { chromium } = require("playwright");
+ const executablePath = chromium.executablePath();
+ checks.push(
+ makeCheck(
+ "playwright",
+ "Playwright Chromium",
+ safeStat(executablePath)?.isFile() ? "ok" : "fail",
+ safeStat(executablePath)?.isFile() ? executablePath : "Chromium browser is missing",
+ "Run npx playwright install chromium."
+ )
+ );
+ } catch (error) {
+ checks.push(
+ makeCheck(
+ "playwright",
+ "Playwright Chromium",
+ "fail",
+ error.message,
+ "Run npm ci, then npx playwright install chromium."
+ )
+ );
+ }
+
+ const localYtDlp = path.join(config.projectRoot, "autodownload", "yt-dlp.exe");
+ const pathYtDlp = safeStat(localYtDlp)?.isFile() ? null : commandWorks("yt-dlp", ["--version"]);
+ checks.push(
+ makeCheck(
+ "yt-dlp",
+ "yt-dlp",
+ safeStat(localYtDlp)?.isFile() || pathYtDlp?.ok ? "ok" : "warn",
+ safeStat(localYtDlp)?.isFile()
+ ? localYtDlp
+ : pathYtDlp?.ok
+ ? `PATH version ${pathYtDlp.output}`
+ : "Optional downloader dependency is missing",
+ "Add autodownload/yt-dlp.exe if you want downloader features."
+ )
+ );
+
+ checks.push(
+ makeCheck(
+ "dashboard-bind",
+ "Dashboard bind",
+ config.dashboardAllowRemote || ["127.0.0.1", "localhost", "::1"].includes(config.dashboardHost)
+ ? "ok"
+ : "fail",
+ `Listening host is ${config.dashboardHost}`,
+ "Use DASHBOARD_HOST=127.0.0.1 unless you explicitly need remote access."
+ )
+ );
+
+ const queueDirs = getAccountQueueDirs(activeAccount.id);
+ const folders = [];
+ for (const platform of PLATFORMS) {
+ const pendingPath = queueDirs[platform].pending;
+ const pendingExists = safeStat(pendingPath)?.isDirectory();
+ const pendingCount = countPendingVideos(pendingPath);
+ folders.push({
+ key: `${platform}Pending`,
+ platform,
+ label: `${PLATFORM_LABELS[platform]} pending queue`,
+ path: pendingPath,
+ exists: Boolean(pendingExists),
+ pendingCount,
+ supported: Array.from(VIDEO_EXTENSIONS),
+ hint: `Drop videos here to queue them for ${PLATFORM_LABELS[platform]}.`,
+ });
+ checks.push(
+ makeCheck(
+ `${platform}-queue`,
+ `${PLATFORM_LABELS[platform]} queue folder`,
+ pendingExists ? "ok" : "fail",
+ pendingExists ? `${pendingCount} pending video(s)` : `${pendingPath} is missing`,
+ "Restart the dashboard or recreate the account folders."
+ )
+ );
+ }
+
+ folders.push(
+ {
+ key: "uniquifierInput",
+ platform: "uniquifier",
+ label: "Video Uniquifier input",
+ path: config.uniquifyInputDir,
+ exists: Boolean(safeStat(config.uniquifyInputDir)?.isDirectory()),
+ pendingCount: countPendingVideos(config.uniquifyInputDir),
+ supported: Array.from(VIDEO_EXTENSIONS),
+ hint: "Drop original videos here before running the uniquifier.",
+ },
+ {
+ key: "uniquifierOutput",
+ platform: "uniquifier",
+ label: "Video Uniquifier output",
+ path: config.uniquifyOutputDir,
+ exists: Boolean(safeStat(config.uniquifyOutputDir)?.isDirectory()),
+ pendingCount: countPendingVideos(config.uniquifyOutputDir),
+ supported: Array.from(VIDEO_EXTENSIONS),
+ hint: "Processed videos are written here.",
+ }
+ );
+
+ const sessions = [];
+ for (const platform of PLATFORMS) {
+ const profileDir = await getPlatformProfileDir(platform, activeAccount.id);
+ const saved = await hasSavedPlatformSession(platform, activeAccount.id);
+ sessions.push({
+ platform,
+ label: PLATFORM_LABELS[platform],
+ saved,
+ profileDir,
+ action: saved ? "Session found" : "Open Accounts and start a login session.",
+ });
+ checks.push(
+ makeCheck(
+ `${platform}-session`,
+ `${PLATFORM_LABELS[platform]} login session`,
+ saved ? "ok" : "warn",
+ saved ? "Saved browser session found" : "No saved session yet",
+ "Open Accounts and start a login session for this platform."
+ )
+ );
+ }
+
+ const counts = countStatuses(checks);
+ return {
+ generatedAt: new Date().toISOString(),
+ projectRoot: config.projectRoot,
+ activeAccount,
+ overall: getOverallStatus(counts),
+ counts,
+ checks,
+ folders,
+ sessions,
+ nextSteps: [
+ "Log in to each platform from Accounts.",
+ "Drop videos into the pending folder for the platform you want to post to.",
+ "Add an optional .description or .txt sidecar next to each video for captions.",
+ "Use Run Once for a safe first test before starting a scheduler.",
+ ],
+ };
+}
+
+module.exports = {
+ buildSetupHealth,
+ commandWorks,
+ countPendingVideos,
+ getAllowedSetupFolderPath,
+};
diff --git a/test/setup-health.test.js b/test/setup-health.test.js
new file mode 100644
index 0000000..e67f8fb
--- /dev/null
+++ b/test/setup-health.test.js
@@ -0,0 +1,37 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+const fs = require("fs");
+const os = require("os");
+const path = require("path");
+
+const {
+ countPendingVideos,
+ getAllowedSetupFolderPath,
+} = require("../src/setup-health");
+
+test("countPendingVideos only counts supported video files", () => {
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "autosocial-health-"));
+ try {
+ fs.writeFileSync(path.join(dir, "clip-a.mp4"), "");
+ fs.writeFileSync(path.join(dir, "clip-b.MOV"), "");
+ fs.writeFileSync(path.join(dir, "caption.txt"), "");
+ fs.mkdirSync(path.join(dir, "nested"));
+
+ assert.equal(countPendingVideos(dir), 2);
+ assert.equal(countPendingVideos(path.join(dir, "missing")), 0);
+ } finally {
+ fs.rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("setup folder resolver only exposes known onboarding folders", () => {
+ const tiktokPath = getAllowedSetupFolderPath("tiktokPending", "default");
+ const instagramPath = getAllowedSetupFolderPath("instagramPending", "default");
+ const youtubePath = getAllowedSetupFolderPath("youtubePending", "default");
+
+ assert.match(tiktokPath, /queue[\\/]default[\\/]tiktok[\\/]pending$/);
+ assert.match(instagramPath, /queue[\\/]default[\\/]instagram[\\/]pending$/);
+ assert.match(youtubePath, /queue[\\/]default[\\/]youtube[\\/]pending$/);
+ assert.equal(getAllowedSetupFolderPath("../.env", "default"), null);
+ assert.equal(getAllowedSetupFolderPath("C:\\Windows", "default"), null);
+});
diff --git a/web/app.js b/web/app.js
index 0355fa4..6a91ee2 100644
--- a/web/app.js
+++ b/web/app.js
@@ -45,6 +45,7 @@ const Router = {
document.querySelectorAll(".view-section").forEach((sec) => {
sec.classList.toggle("active", sec.id === `view-${viewName}`);
});
+ document.dispatchEvent(new CustomEvent("autosocial:viewchange", { detail: { viewName } }));
},
};
@@ -72,6 +73,15 @@ const UI = {
cancelBrandBtn: document.getElementById("cancelBrandBtn"),
activeBrandLabel: document.getElementById("activeBrandLabel"),
statusBadge: document.getElementById("statusBadge"),
+ setupRefreshBtn: document.getElementById("setupRefreshBtn"),
+ setupSummaryIcon: document.getElementById("setupSummaryIcon"),
+ setupSummaryTitle: document.getElementById("setupSummaryTitle"),
+ setupSummaryMeta: document.getElementById("setupSummaryMeta"),
+ setupMetrics: document.getElementById("setupMetrics"),
+ setupChecksList: document.getElementById("setupChecksList"),
+ setupSessionsList: document.getElementById("setupSessionsList"),
+ setupFoldersList: document.getElementById("setupFoldersList"),
+ setupNextSteps: document.getElementById("setupNextSteps"),
pendingCount: document.getElementById("pendingCount"),
successCount: document.getElementById("successCount"),
@@ -286,6 +296,19 @@ const UI = {
}
});
}
+ if (this.els.setupRefreshBtn) {
+ this.els.setupRefreshBtn.addEventListener("click", () => this.refreshSetupHealth());
+ }
+ if (this.els.setupFoldersList) {
+ this.els.setupFoldersList.addEventListener("click", (event) =>
+ this.handleSetupFolderClick(event)
+ );
+ }
+ document.addEventListener("autosocial:viewchange", (event) => {
+ if (event.detail?.viewName === "setup") {
+ this.refreshSetupHealth();
+ }
+ });
if (this.els.ttSoundQuerySaveBtn) {
this.els.ttSoundQuerySaveBtn.addEventListener("click", () =>
@@ -524,11 +547,174 @@ const UI = {
try {
await API.post("/api/accounts/select", { accountId });
await this.refresh();
+ if (this.isViewActive("setup")) {
+ await this.refreshSetupHealth();
+ }
} catch (err) {
alert(`Could not switch brand: ${err.message}`);
}
},
+ isViewActive(viewName) {
+ return document.getElementById(`view-${viewName}`)?.classList.contains("active");
+ },
+
+ statusMeta(status) {
+ const map = {
+ ok: { label: "Ready", icon: "ph-check-circle", className: "ok" },
+ warn: { label: "Needs attention", icon: "ph-warning-circle", className: "warn" },
+ fail: { label: "Blocked", icon: "ph-x-circle", className: "fail" },
+ };
+ return map[status] || map.warn;
+ },
+
+ async refreshSetupHealth() {
+ if (this.els.setupRefreshBtn) {
+ this.els.setupRefreshBtn.disabled = true;
+ this.els.setupRefreshBtn.innerHTML = '<i class="ph ph-circle-notch"></i> Checking';
+ }
+
+ try {
+ const health = await API.get("/api/setup/health");
+ this.renderSetupHealth(health);
+ } catch (err) {
+ if (this.els.setupSummaryTitle) this.els.setupSummaryTitle.textContent = "Setup check failed";
+ if (this.els.setupSummaryMeta) this.els.setupSummaryMeta.textContent = err.message;
+ if (this.els.setupChecksList) {
+ this.els.setupChecksList.innerHTML = `
+ <div class="setup-empty error">Could not load setup health: ${escapeHtml(err.message)}</div>
+ `;
+ }
+ } finally {
+ if (this.els.setupRefreshBtn) {
+ this.els.setupRefreshBtn.disabled = false;
+ this.els.setupRefreshBtn.innerHTML = '<i class="ph ph-arrows-clockwise"></i> Refresh';
+ }
+ }
+ },
+
+ renderSetupHealth(health) {
+ if (!health || typeof health !== "object") return;
+ const summary = this.statusMeta(health.overall);
+ const activeBrand = health.activeAccount?.name || "Default";
+ const updated = health.generatedAt ? new Date(health.generatedAt).toLocaleTimeString() : "just now";
+
+ if (this.els.setupSummaryIcon) {
+ this.els.setupSummaryIcon.className = `setup-summary-icon ${summary.className}`;
+ this.els.setupSummaryIcon.innerHTML = `<i class="ph ${summary.icon}"></i>`;
+ }
+ if (this.els.setupSummaryTitle) {
+ this.els.setupSummaryTitle.textContent =
+ health.overall === "ok" ? "This workstation is ready" : "Review setup items before posting";
+ }
+ if (this.els.setupSummaryMeta) {
+ this.els.setupSummaryMeta.textContent = `Active brand: ${activeBrand} - Last checked ${updated}`;
+ }
+ if (this.els.setupMetrics) {
+ const counts = health.counts || {};
+ this.els.setupMetrics.innerHTML = `
+ <div class="setup-metric">
+ <span class="setup-metric-value ok">${counts.ok ?? 0}</span>
+ <span class="setup-metric-label">Ready</span>
+ </div>
+ <div class="setup-metric">
+ <span class="setup-metric-value warn">${counts.warn ?? 0}</span>
+ <span class="setup-metric-label">Warnings</span>
+ </div>
+ <div class="setup-metric">
+ <span class="setup-metric-value fail">${counts.fail ?? 0}</span>
+ <span class="setup-metric-label">Blocking</span>
+ </div>
+ `;
+ }
+
+ if (this.els.setupChecksList) {
+ this.els.setupChecksList.innerHTML = (health.checks || [])
+ .map((check) => {
+ const meta = this.statusMeta(check.status);
+ return `
+ <div class="setup-check-item ${meta.className}">
+ <div class="setup-check-icon"><i class="ph ${meta.icon}"></i></div>
+ <div class="setup-check-body">
+ <div class="setup-check-title">${escapeHtml(check.label)}</div>
+ <div class="setup-check-detail">${escapeHtml(check.detail)}</div>
+ ${check.status === "ok" ? "" : `<div class="setup-check-action">${escapeHtml(check.action)}</div>`}
+ </div>
+ </div>
+ `;
+ })
+ .join("");
+ }
+
+ if (this.els.setupSessionsList) {
+ this.els.setupSessionsList.innerHTML = (health.sessions || [])
+ .map((session) => {
+ const meta = this.statusMeta(session.saved ? "ok" : "warn");
+ return `
+ <div class="setup-check-item ${meta.className}">
+ <div class="setup-check-icon"><i class="ph ${meta.icon}"></i></div>
+ <div class="setup-check-body">
+ <div class="setup-check-title">${escapeHtml(session.label)}</div>
+ <div class="setup-check-detail">${escapeHtml(session.saved ? "Saved session found" : "No saved session yet")}</div>
+ <div class="setup-path">${escapeHtml(session.profileDir)}</div>
+ </div>
+ </div>
+ `;
+ })
+ .join("");
+ }
+
+ if (this.els.setupFoldersList) {
+ this.els.setupFoldersList.innerHTML = (health.folders || [])
+ .map((folder) => {
+ const meta = this.statusMeta(folder.exists ? "ok" : "fail");
+ return `
+ <div class="setup-folder-item">
+ <div class="setup-folder-main">
+ <div class="setup-folder-title">
+ <span class="setup-check-icon ${meta.className}"><i class="ph ${meta.icon}"></i></span>
+ ${escapeHtml(folder.label)}
+ </div>
+ <div class="setup-check-detail">${escapeHtml(folder.hint)}</div>
+ <div class="setup-path">${escapeHtml(folder.path)}</div>
+ <div class="setup-folder-meta">${folder.pendingCount ?? 0} video file(s) - ${escapeHtml((folder.supported || []).join(", "))}</div>
+ </div>
+ <button class="control-btn-small" data-setup-folder="${escapeHtml(folder.key)}">
+ <i class="ph ph-folder-open"></i> Open
+ </button>
+ </div>
+ `;
+ })
+ .join("");
+ }
+
+ if (this.els.setupNextSteps) {
+ this.els.setupNextSteps.innerHTML = (health.nextSteps || [])
+ .map(
+ (step, index) => `
+ <div class="setup-step">
+ <span class="setup-step-number">${index + 1}</span>
+ <span>${escapeHtml(step)}</span>
+ </div>
+ `
+ )
+ .join("");
+ }
+ },
+
+ async handleSetupFolderClick(event) {
+ const button = event.target.closest("button[data-setup-folder]");
+ if (!button) return;
+ button.disabled = true;
+ try {
+ await API.post("/api/setup/open-folder", { key: button.dataset.setupFolder });
+ } catch (err) {
+ alert(`Could not open folder: ${err.message}`);
+ } finally {
+ button.disabled = false;
+ }
+ },
+
async handleAction(endpoint) {
try {
const result = await API.post(endpoint);
diff --git a/web/index.html b/web/index.html
index 613b6df..23d27f0 100644
--- a/web/index.html
+++ b/web/index.html
@@ -76,6 +76,10 @@
</button>
<div class="nav-label">Management</div>
+ <button class="nav-item" data-view="setup">
+ <i class="ph ph-list-checks"></i>
+ <span>Setup</span>
+ </button>
<button class="nav-item" data-view="accounts">
<i class="ph ph-users"></i>
<span>Accounts</span>
@@ -140,6 +144,76 @@
</section>
<!-- View: Accounts -->
+ <section id="view-setup" class="view-section">
+ <header class="view-header">
+ <div>
+ <h2>First-Run Setup</h2>
+ <span class="view-subtitle">Check your local machine, login sessions, and queue folders.</span>
+ </div>
+ <button id="setupRefreshBtn" class="control-btn-small">
+ <i class="ph ph-arrows-clockwise"></i> Refresh
+ </button>
+ </header>
+
+ <div class="setup-layout">
+ <div class="setup-summary-card">
+ <div class="setup-summary-icon" id="setupSummaryIcon">
+ <i class="ph ph-circle-notch"></i>
+ </div>
+ <div>
+ <div class="setup-summary-label">Setup status</div>
+ <div class="setup-summary-title" id="setupSummaryTitle">Checking local setup</div>
+ <div class="setup-summary-meta" id="setupSummaryMeta">This runs local checks only.</div>
+ </div>
+ </div>
+
+ <div class="setup-metrics" id="setupMetrics">
+ <div class="setup-metric">
+ <span class="setup-metric-value">-</span>
+ <span class="setup-metric-label">Ready</span>
+ </div>
+ <div class="setup-metric">
+ <span class="setup-metric-value">-</span>
+ <span class="setup-metric-label">Warnings</span>
+ </div>
+ <div class="setup-metric">
+ <span class="setup-metric-value">-</span>
+ <span class="setup-metric-label">Blocking</span>
+ </div>
+ </div>
+ </div>
+
+ <div class="setup-grid">
+ <div class="card setup-card">
+ <div class="card-title">Local Health</div>
+ <div id="setupChecksList" class="setup-check-list">
+ <div class="setup-empty">Loading setup checks...</div>
+ </div>
+ </div>
+
+ <div class="card setup-card">
+ <div class="card-title">Login Sessions</div>
+ <div id="setupSessionsList" class="setup-check-list">
+ <div class="setup-empty">Loading sessions...</div>
+ </div>
+ </div>
+
+ <div class="card setup-card full-width">
+ <div class="card-title">Where to Put Videos</div>
+ <div id="setupFoldersList" class="setup-folder-list">
+ <div class="setup-empty">Loading folders...</div>
+ </div>
+ </div>
+
+ <div class="card setup-card full-width">
+ <div class="card-title">Suggested First Run</div>
+ <div id="setupNextSteps" class="setup-steps">
+ <div class="setup-empty">Loading next steps...</div>
+ </div>
+ </div>
+ </div>
+ </section>
+
<section id="view-accounts" class="view-section">
<header class="view-header">
<h2>Account Management <span id="activeBrandLabel" style="color:var(--text-muted); font-size:14px;"></span>
diff --git a/web/style.css b/web/style.css
index adaab72..0680d21 100644
--- a/web/style.css
+++ b/web/style.css
@@ -256,6 +256,224 @@ select.brand-select {
margin: 0;
}
+.view-subtitle {
+ display: block;
+ color: var(--text-muted);
+ font-size: 13px;
+ margin-top: 6px;
+}
+
+/* First-run setup */
+.setup-layout {
+ display: grid;
+ grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
+ gap: 16px;
+ margin-bottom: 24px;
+}
+
+.setup-summary-card,
+.setup-metrics {
+ background: var(--bg-card);
+ border: 1px solid var(--border-color);
+ border-radius: 12px;
+}
+
+.setup-summary-card {
+ display: flex;
+ align-items: center;
+ gap: 16px;
+ padding: 20px;
+}
+
+.setup-summary-icon {
+ width: 46px;
+ height: 46px;
+ border-radius: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 24px;
+ background: var(--bg-card-hover);
+ color: var(--text-muted);
+ flex: 0 0 auto;
+}
+
+.setup-summary-icon.ok,
+.setup-check-icon.ok,
+.setup-metric-value.ok {
+ color: var(--status-good);
+}
+
+.setup-summary-icon.warn,
+.setup-check-icon.warn,
+.setup-metric-value.warn {
+ color: var(--status-warn);
+}
+
+.setup-summary-icon.fail,
+.setup-check-icon.fail,
+.setup-metric-value.fail {
+ color: var(--status-bad);
+}
+
+.setup-summary-label,
+.setup-metric-label {
+ color: var(--text-muted);
+ font-size: 12px;
+ font-weight: 700;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+}
+
+.setup-summary-title {
+ font-size: 20px;
+ font-weight: 700;
+ margin-top: 4px;
+}
+
+.setup-summary-meta {
+ color: var(--text-muted);
+ font-size: 13px;
+ margin-top: 4px;
+}
+
+.setup-metrics {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ overflow: hidden;
+}
+
+.setup-metric {
+ padding: 18px;
+ border-right: 1px solid var(--border-color);
+}
+
+.setup-metric:last-child {
+ border-right: none;
+}
+
+.setup-metric-value {
+ display: block;
+ font-size: 24px;
+ font-weight: 700;
+ margin-bottom: 4px;
+}
+
+.setup-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 24px;
+}
+
+.setup-card.full-width {
+ grid-column: 1 / -1;
+}
+
+.setup-check-list,
+.setup-folder-list,
+.setup-steps {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.setup-check-item,
+.setup-folder-item,
+.setup-step {
+ background: var(--bg-app);
+ border: 1px solid var(--border-color);
+ border-radius: 8px;
+}
+
+.setup-check-item {
+ display: grid;
+ grid-template-columns: 28px minmax(0, 1fr);
+ gap: 12px;
+ padding: 12px;
+}
+
+.setup-check-icon {
+ font-size: 18px;
+ line-height: 1;
+}
+
+.setup-check-title,
+.setup-folder-title {
+ font-size: 14px;
+ font-weight: 700;
+}
+
+.setup-check-detail,
+.setup-check-action,
+.setup-folder-meta {
+ color: var(--text-muted);
+ font-size: 12px;
+ line-height: 1.45;
+ margin-top: 4px;
+}
+
+.setup-check-action {
+ color: var(--status-warn);
+}
+
+.setup-path {
+ color: var(--text-main);
+ background: #050507;
+ border: 1px solid var(--border-color);
+ border-radius: 6px;
+ font-family: var(--font-mono);
+ font-size: 11px;
+ line-height: 1.5;
+ margin-top: 8px;
+ overflow-wrap: anywhere;
+ padding: 6px 8px;
+}
+
+.setup-folder-item {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ gap: 14px;
+ padding: 14px;
+}
+
+.setup-folder-title {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.setup-step {
+ align-items: center;
+ display: flex;
+ gap: 12px;
+ padding: 12px;
+}
+
+.setup-step-number {
+ align-items: center;
+ background: var(--bg-card-hover);
+ border: 1px solid var(--border-color);
+ border-radius: 999px;
+ color: var(--text-muted);
+ display: inline-flex;
+ flex: 0 0 auto;
+ font-family: var(--font-mono);
+ font-size: 12px;
+ height: 24px;
+ justify-content: center;
+ width: 24px;
+}
+
+.setup-empty {
+ color: var(--text-muted);
+ font-size: 13px;
+ padding: 8px 0;
+}
+
+.setup-empty.error {
+ color: var(--status-bad);
+}
+
/* Dashboard Grid & Cards */
.dashboard-grid {
display: grid;
@@ -669,6 +887,25 @@ textarea.control-input {
.main-content {
padding: 20px;
}
+
+ .setup-layout,
+ .setup-grid,
+ .setup-folder-item {
+ grid-template-columns: 1fr;
+ }
+
+ .setup-metrics {
+ grid-template-columns: 1fr;
+ }
+
+ .setup-metric {
+ border-right: none;
+ border-bottom: 1px solid var(--border-color);
+ }
+
+ .setup-metric:last-child {
+ border-bottom: none;
+ }
}
/* Form Group */