Add a single-page multi-step setup wizard that guides new users through initial configuration: Step 1 - Admin Registration: Creates the first user (auto-admin) using the existing POST /api/auth/register endpoint, with real-time password validation and confirmation matching. Step 2 - Library Creation: Create one or more libraries (Ebooks, Audiobooks, Comics, Manga) using POST /api/libraries. Libraries list updates inline as they're added. Step 3 - Folder Configuration: Add filesystem folders to each library using the existing GET /api/libraries/browse endpoint for a visual directory browser. Folders are attached via POST /api/libraries/:id/folders. Step 4 - Initial Scan: Triggers a manual scan of all libraries via POST /api/libraries/scan with real-time progress polling using the existing scan status endpoint. On completion, the wizard calls PUT /api/setup/complete and sets the selectedLibrary cookie to the first library's UUID, ensuring the dashboard loads with populated content instead of an empty 'All Libraries' view. Handles the edge case where a stale JWT from a previous database instance triggers an 'already exists' error by auto-advancing to step 2. The wizard reuses all existing API calls, Alpine.js utilities, and form validation functions — no backend logic was duplicated.
44 lines
921 B
TypeScript
44 lines
921 B
TypeScript
import "./alpine";
|
|
import { Alpine } from "./alpine";
|
|
|
|
import "./admin";
|
|
import "./analytics";
|
|
import "./api";
|
|
import "./api-explorer";
|
|
import "./api-explorer-docs";
|
|
import "./bookPicker";
|
|
import "./bookshelf";
|
|
import "./book-detail";
|
|
import "./collection-rules";
|
|
import "./collections";
|
|
import "./conflicts";
|
|
import "./custom-section-builder";
|
|
import "./dashboard";
|
|
import "./device-management";
|
|
import "./docs";
|
|
import "./dom";
|
|
import "./events";
|
|
import "./header";
|
|
import "./index";
|
|
import "./library";
|
|
import "./library-switcher";
|
|
import "./linking";
|
|
import "./login";
|
|
import "./password_validation";
|
|
import "./profile";
|
|
import "./profile-modal";
|
|
import "./queue";
|
|
import "./register";
|
|
import "./search";
|
|
import "./series";
|
|
import "./setup";
|
|
import "./storage";
|
|
import "./theme";
|
|
import "./toast";
|
|
import "./toast-error";
|
|
import "./unlinked_books";
|
|
import "./websocket";
|
|
import "./woodPanelingInit";
|
|
|
|
Alpine.start();
|