@knowcode/doc-builder 1.7.6 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.claude/settings.local.json +6 -1
  2. package/CHANGELOG.md +29 -0
  3. package/assets/css/notion-style.css +9 -1
  4. package/assets/js/main.js +10 -6
  5. package/html/README.html +44 -20
  6. package/html/auth.js +62 -13
  7. package/html/css/notion-style.css +9 -1
  8. package/html/documentation-index.html +44 -20
  9. package/html/guides/authentication-default-change.html +44 -20
  10. package/html/guides/authentication-guide.html +228 -263
  11. package/html/guides/claude-workflow-guide.html +44 -20
  12. package/html/guides/documentation-standards.html +44 -20
  13. package/html/guides/phosphor-icons-guide.html +44 -20
  14. package/html/guides/private-directory-authentication.html +472 -0
  15. package/html/guides/public-site-deployment.html +50 -25
  16. package/html/guides/search-engine-verification-guide.html +44 -20
  17. package/html/guides/seo-guide.html +44 -20
  18. package/html/guides/seo-optimization-guide.html +44 -20
  19. package/html/guides/troubleshooting-guide.html +44 -20
  20. package/html/guides/windows-setup-guide.html +44 -20
  21. package/html/index.html +44 -20
  22. package/html/js/auth.js +118 -39
  23. package/html/js/main.js +10 -6
  24. package/html/login.html +4 -4
  25. package/html/logout.html +2 -2
  26. package/html/private/cache-control-anti-pattern.html +408 -0
  27. package/html/private/launch/README.html +350 -0
  28. package/html/private/launch/auth-cleanup-summary.html +340 -0
  29. package/html/private/launch/bubble-plugin-specification.html +986 -0
  30. package/html/private/launch/go-to-market-strategy.html +716 -0
  31. package/html/private/launch/launch-announcements.html +646 -0
  32. package/html/private/launch/vercel-deployment-auth-setup.html +390 -0
  33. package/html/private/next-steps-walkthrough.html +685 -0
  34. package/html/private/supabase-auth-implementation-completed.html +433 -0
  35. package/html/private/supabase-auth-implementation-plan.html +590 -0
  36. package/html/private/supabase-auth-integration-plan.html +718 -0
  37. package/html/private/supabase-auth-setup-guide.html +545 -0
  38. package/html/private/test-private-doc.html +281 -0
  39. package/html/robots.txt +4 -0
  40. package/html/sitemap.xml +113 -29
  41. package/html/vercel-cli-setup-guide.html +44 -20
  42. package/html/vercel-first-time-setup-guide.html +44 -20
  43. package/lib/config.js +21 -3
  44. package/lib/core-builder.js +49 -7
  45. package/lib/supabase-auth.js +80 -25
  46. package/package.json +1 -1
  47. package/user-management/README.md +306 -0
  48. package/user-management/add-users.sh +730 -0
  49. package/user-management/create-user.js +65 -0
  50. package/user-management/users.txt +15 -0
@@ -0,0 +1,685 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="description" content="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment. This guide provides detailed,...">
7
+ <title>Next Steps: Testing and Deployment Walkthrough</title>
8
+
9
+ <meta name="author" content="Lindsay Smith">
10
+ <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, test, step">
11
+ <meta name="robots" content="index, follow">
12
+ <link rel="canonical" href="https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html">
13
+
14
+ <!-- Open Graph / Facebook -->
15
+ <meta property="og:type" content="article">
16
+ <meta property="og:url" content="https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html">
17
+ <meta property="og:title" content="Next Steps: Testing and Deployment Walkthrough">
18
+ <meta property="og:description" content="Now that we&#39;ve implemented Supabase authentication, let&#39;s walk through testing the implementation and preparing for deployment. This guide provides detailed,...">
19
+ <meta property="og:image" content="https://doc-builder-delta.vercel.app/og-default.png">
20
+ <meta property="og:site_name" content="@knowcode/doc-builder">
21
+ <meta property="og:locale" content="en_US">
22
+
23
+ <!-- Twitter Card -->
24
+ <meta name="twitter:card" content="summary_large_image">
25
+ <meta name="twitter:site" content="@planbbackups">
26
+ <meta name="twitter:creator" content="@planbbackups">
27
+ <meta name="twitter:title" content="Next Steps: Testing and Deployment Walkthrough">
28
+ <meta name="twitter:description" content="Now that we&#39;ve implemented Supabase authentication, let&#39;s walk through testing the implementation and preparing for deployment. This guide provides detailed,...">
29
+ <meta name="twitter:image" content="https://doc-builder-delta.vercel.app/og-default.png">
30
+
31
+ <!-- Custom Meta Tags -->
32
+ <meta name="google-site-verification" content="FtzcDTf5BQ9K5EfnGazQkgU2U4FiN3ITzM7gHwqUAqQ">
33
+ <meta name="msvalidate.01" content="B2D8C4C12C530D47AA962B24CAA09630">
34
+
35
+ <!-- Fonts -->
36
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
37
+
38
+ <!-- Icons -->
39
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
40
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/regular/style.css">
41
+
42
+ <!-- Mermaid -->
43
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
44
+
45
+ <!-- Styles -->
46
+ <link rel="stylesheet" href="/css/notion-style.css">
47
+
48
+
49
+ <!-- Hide content until auth check -->
50
+ <style>
51
+ body {
52
+ visibility: hidden;
53
+ opacity: 0;
54
+ transition: opacity 0.3s ease;
55
+ }
56
+ body.authenticated {
57
+ visibility: visible;
58
+ opacity: 1;
59
+ }
60
+ /* Show login/logout pages immediately */
61
+ body.auth-page {
62
+ visibility: visible;
63
+ opacity: 1;
64
+ }
65
+ /* Style auth button consistently */
66
+ .auth-btn {
67
+ background: none;
68
+ border: none;
69
+ color: var(--text-secondary);
70
+ cursor: pointer;
71
+ padding: 0.5rem;
72
+ border-radius: 0.5rem;
73
+ transition: all 0.2s;
74
+ font-size: 1.1rem;
75
+ }
76
+ .auth-btn:hover {
77
+ background: var(--bg-secondary);
78
+ color: var(--text-primary);
79
+ }
80
+ </style>
81
+
82
+
83
+ <!-- Favicon -->
84
+ <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>✨</text></svg>">
85
+
86
+ <script type="application/ld+json">
87
+ {
88
+ "@context": "https://schema.org",
89
+ "@type": "TechArticle",
90
+ "headline": "Next Steps: Testing and Deployment Walkthrough",
91
+ "description": "Now that we've implemented Supabase authentication, let's walk through testing the implementation and preparing for deployment. This guide provides detailed,...",
92
+ "author": {
93
+ "@type": "Person",
94
+ "name": "Lindsay Smith"
95
+ },
96
+ "publisher": {
97
+ "@type": "Organization",
98
+ "name": "Knowcode Ltd",
99
+ "url": "https://knowcode.tech"
100
+ },
101
+ "datePublished": "2025-07-26T10:20:52.434Z",
102
+ "dateModified": "2025-07-26T10:20:52.434Z",
103
+ "mainEntityOfPage": {
104
+ "@type": "WebPage",
105
+ "@id": "https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html"
106
+ },
107
+ "breadcrumb": {
108
+ "@type": "BreadcrumbList",
109
+ "itemListElement": [
110
+ {
111
+ "@type": "ListItem",
112
+ "position": 1,
113
+ "name": "@knowcode/doc-builder",
114
+ "item": "https://doc-builder-delta.vercel.app"
115
+ },
116
+ {
117
+ "@type": "ListItem",
118
+ "position": 2,
119
+ "name": "Private",
120
+ "item": "https://doc-builder-delta.vercel.app/private/"
121
+ },
122
+ {
123
+ "@type": "ListItem",
124
+ "position": 3,
125
+ "name": "Next Steps Walkthrough",
126
+ "item": "https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html"
127
+ }
128
+ ]
129
+ }
130
+ }
131
+ </script>
132
+ </head>
133
+ <body>
134
+ <!-- Header -->
135
+ <header class="header">
136
+ <div class="header-content">
137
+ <a href="/index.html" class="logo">@knowcode/doc-builder</a>
138
+
139
+ <div class="header-actions">
140
+ <div class="deployment-info">
141
+ <span class="deployment-date" title="Built with doc-builder v1.8.0">Last updated: Jul 26, 2025, 10:20 AM UTC</span>
142
+ </div>
143
+
144
+
145
+ <a href="../../login.html" class="auth-btn" title="Login/Logout">
146
+ <i class="fas fa-sign-in-alt"></i>
147
+ </a>
148
+
149
+
150
+ <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
151
+ <i class="fas fa-moon"></i>
152
+ </button>
153
+
154
+ <button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
155
+ <i class="fas fa-bars"></i>
156
+ </button>
157
+ </div>
158
+ </div>
159
+ </header>
160
+
161
+ <!-- Preview Banner -->
162
+ <div id="preview-banner" class="preview-banner">
163
+ <div class="banner-content">
164
+ <i class="fas fa-exclamation-triangle banner-icon"></i>
165
+ <span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
166
+ <button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
167
+ <i class="fas fa-times"></i>
168
+ </button>
169
+ </div>
170
+ </div>
171
+
172
+ <!-- Breadcrumbs -->
173
+ <nav class="breadcrumbs" id="breadcrumbs">
174
+ <!-- Breadcrumbs will be generated by JavaScript -->
175
+ </nav>
176
+
177
+ <!-- Main Content -->
178
+ <div class="main-wrapper">
179
+ <!-- Sidebar -->
180
+ <aside class="sidebar">
181
+ <div class="sidebar-header">
182
+ <div class="filter-box">
183
+ <input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
184
+ <i class="fas fa-search filter-icon"></i>
185
+ </div>
186
+ </div>
187
+ <nav class="navigation">
188
+
189
+ <div class="nav-section" data-level="0">
190
+ <a class="nav-title" href="/README.html" >
191
+ <i class="fas fa-home"></i> Documentation
192
+ </a>
193
+ <div class="nav-content" >
194
+ <a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
195
+ <a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
196
+ <a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing the Vercel CLI across different operating systems."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
197
+ <a href="/vercel-first-time-setup-guide.html" class="nav-item" data-tooltip="This guide walks you through the Vercel deployment process when using ."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
198
+ <div class="nav-section" data-level="1">
199
+ <a class="nav-title collapsible" href="#" data-target="nav-guides-1" >
200
+ <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
201
+ </a>
202
+ <div class="nav-content collapsed" id="nav-guides-1">
203
+ <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="fas fa-file-alt"></i> Authentication Default Change</a>
204
+ <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="fas fa-file-alt"></i> Authentication Guide</a>
205
+ <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
206
+ <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
207
+ <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="fas fa-file-alt"></i> Phosphor Icons Guide</a>
208
+ <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder provides flexible authentication options to protect your documentation."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
209
+ <a href="/guides/public-site-deployment.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="fas fa-file-alt"></i> Public Site Deployment</a>
210
+ <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="fas fa-file-alt"></i> Search Engine Verification Guide</a>
211
+ <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
212
+ <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features that automatically optimize your documentation for search..."><i class="fas fa-file-alt"></i> Seo Optimization Guide</a>
213
+ <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a>
214
+ <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="fas fa-file-alt"></i> Windows Setup Guide</a></div></div>
215
+ <div class="nav-section" data-level="1">
216
+ <a class="nav-title collapsible expanded" href="#" data-target="nav-private-1" >
217
+ <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Private
218
+ </a>
219
+ <div class="nav-content" id="nav-private-1">
220
+ <a href="/private/cache-control-anti-pattern.html" class="nav-item" data-tooltip="Cache Control Anti-Pattern: Why Aggressive Cache-Busting is Bad for Documentation Sites."><i class="fas fa-file-alt"></i> Cache Control Anti Pattern</a>
221
+ <a href="/private/next-steps-walkthrough.html" class="nav-item active" data-tooltip="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment."><i class="fas fa-file-alt"></i> Next Steps Walkthrough</a>
222
+ <a href="/private/supabase-auth-implementation-completed.html" class="nav-item" data-tooltip="This document records the successful implementation of Supabase authentication in @knowcode/doc-builder v1.7.5+."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Completed</a>
223
+ <a href="/private/supabase-auth-implementation-plan.html" class="nav-item" data-tooltip="Supabase Auth Implementation Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Plan</a>
224
+ <a href="/private/supabase-auth-integration-plan.html" class="nav-item" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Integration Plan</a>
225
+ <a href="/private/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase."><i class="fas fa-file-alt"></i> Supabase Auth Setup Guide</a>
226
+ <a href="/private/test-private-doc.html" class="nav-item" data-tooltip="Test Private Document."><i class="fas fa-file-alt"></i> Test Private Doc</a></div></div>
227
+ <div class="nav-section" data-level="2">
228
+ <a class="nav-title collapsible" href="/private/launch/README.html" data-target="nav-private-launch-2" >
229
+ <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Launch
230
+ </a>
231
+ <div class="nav-content collapsed" id="nav-private-launch-2">
232
+ <a href="/private/launch/README.html" class="nav-item" data-tooltip="This directory contains all documentation related to the commercial launch of @knowcode/doc-builder, including go-to-market strategy, platform..."><i class="fas fa-file-alt"></i> Launch Overview</a>
233
+ <a href="/private/launch/auth-cleanup-summary.html" class="nav-item" data-tooltip="All references to the old client-side authentication system have been removed from @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Auth Cleanup Summary</a>
234
+ <a href="/private/launch/bubble-plugin-specification.html" class="nav-item" data-tooltip="This document outlines the technical specification for creating a Bubble.io plugin that integrates @knowcode/doc-builder, enabling Bubble developers..."><i class="fas fa-file-alt"></i> Bubble Plugin Specification</a>
235
+ <a href="/private/launch/go-to-market-strategy.html" class="nav-item" data-tooltip="Go-to-Market Strategy &amp; Product Launch Plan."><i class="fas fa-file-alt"></i> Go To Market Strategy</a>
236
+ <a href="/private/launch/launch-announcements.html" class="nav-item" data-tooltip="This document contains ready-to-use announcement templates for launching @knowcode/doc-builder across various platforms and channels."><i class="fas fa-file-alt"></i> Launch Announcements</a>
237
+ <a href="/private/launch/vercel-deployment-auth-setup.html" class="nav-item" data-tooltip="Vercel Deployment Authentication Setup Guide."><i class="fas fa-file-alt"></i> Vercel Deployment Auth Setup</a></div></div>
238
+ </nav>
239
+ <div class="resize-handle"></div>
240
+ </aside>
241
+
242
+ <!-- Content Area -->
243
+ <main class="content">
244
+ <div class="content-inner">
245
+ <h1>Next Steps: Testing and Deployment Walkthrough</h1>
246
+ <h2>Overview</h2>
247
+ <p>Now that we&#39;ve implemented Supabase authentication, let&#39;s walk through testing the implementation and preparing for deployment. This guide provides detailed, step-by-step instructions.</p>
248
+ <h2>🧪 Phase 1: Local Testing</h2>
249
+ <h3>Step 1: Install Dependencies</h3>
250
+ <p>First, install the new Supabase dependency:</p>
251
+ <pre><code class="language-bash">cd /Users/lindsaysmith/Documents/lambda1.nosync/doc-builder
252
+ npm install
253
+ </code></pre>
254
+ <h3>Step 2: Set Up Test Supabase Project</h3>
255
+ <ol>
256
+ <li><strong>Go to Supabase</strong>: Visit <a href="https://app.supabase.com">app.supabase.com</a></li>
257
+ <li><strong>Create new project</strong>: <ul>
258
+ <li>Name: <code>doc-builder-test</code></li>
259
+ <li>Database password: Choose a secure password</li>
260
+ <li>Region: Choose closest to you</li>
261
+ </ul>
262
+ </li>
263
+ <li><strong>Wait for setup</strong>: Usually takes 1-2 minutes</li>
264
+ </ol>
265
+ <h3>Step 3: Create Database Tables</h3>
266
+ <ol>
267
+ <li><strong>Go to SQL Editor</strong> in Supabase dashboard</li>
268
+ <li><strong>Run this SQL</strong> to create the required tables:</li>
269
+ </ol>
270
+ <pre><code class="language-sql">-- Table 1: Documentation sites
271
+ CREATE TABLE docbuilder_sites (
272
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
273
+ domain TEXT UNIQUE NOT NULL,
274
+ name TEXT NOT NULL,
275
+ created_at TIMESTAMPTZ DEFAULT NOW()
276
+ );
277
+
278
+ -- Table 2: User access mapping
279
+ CREATE TABLE docbuilder_access (
280
+ user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
281
+ site_id UUID REFERENCES docbuilder_sites(id) ON DELETE CASCADE,
282
+ created_at TIMESTAMPTZ DEFAULT NOW(),
283
+ PRIMARY KEY (user_id, site_id)
284
+ );
285
+
286
+ -- Enable Row Level Security
287
+ ALTER TABLE docbuilder_sites ENABLE ROW LEVEL SECURITY;
288
+ ALTER TABLE docbuilder_access ENABLE ROW LEVEL SECURITY;
289
+
290
+ -- RLS Policy: Users can only see sites they have access to
291
+ CREATE POLICY &quot;Users see accessible sites&quot; ON docbuilder_sites
292
+ FOR SELECT USING (
293
+ EXISTS (
294
+ SELECT 1 FROM docbuilder_access
295
+ WHERE site_id = docbuilder_sites.id
296
+ AND user_id = auth.uid()
297
+ )
298
+ );
299
+
300
+ -- RLS Policy: Users can see their own access
301
+ CREATE POLICY &quot;Users see own access&quot; ON docbuilder_access
302
+ FOR SELECT USING (user_id = auth.uid());
303
+ </code></pre>
304
+ <h3>Step 4: Get Supabase Credentials</h3>
305
+ <ol>
306
+ <li><strong>Go to Settings → API</strong> in Supabase dashboard</li>
307
+ <li><strong>Copy these values</strong>:<ul>
308
+ <li>Project URL (e.g., <code>https://abc123.supabase.co</code>)</li>
309
+ <li>Anon public key (starts with <code>eyJ...</code>)</li>
310
+ </ul>
311
+ </li>
312
+ </ol>
313
+ <h3>Step 5: Create Test Configuration</h3>
314
+ <ol>
315
+ <li><strong>Create test config file</strong>:</li>
316
+ </ol>
317
+ <pre><code class="language-bash"># In the doc-builder directory
318
+ cat &gt; test-config.js &lt;&lt; &#39;EOF&#39;
319
+ module.exports = {
320
+ siteName: &#39;Test Documentation&#39;,
321
+
322
+ features: {
323
+ authentication: &#39;supabase&#39;
324
+ },
325
+
326
+ auth: {
327
+ supabaseUrl: &#39;YOUR_SUPABASE_URL_HERE&#39;,
328
+ supabaseAnonKey: &#39;YOUR_ANON_KEY_HERE&#39;,
329
+ siteId: &#39;&#39; // Will be filled in next step
330
+ }
331
+ };
332
+ EOF
333
+ </code></pre>
334
+ <ol start="2">
335
+ <li><strong>Replace the placeholders</strong> with your actual Supabase credentials</li>
336
+ </ol>
337
+ <h3>Step 6: Test the CLI Commands</h3>
338
+ <ol>
339
+ <li><strong>Test the auth:init command</strong>:</li>
340
+ </ol>
341
+ <pre><code class="language-bash">node cli.js auth:init --config test-config.js
342
+ </code></pre>
343
+ <p>This should prompt you for Supabase credentials and create/update the config.</p>
344
+ <ol start="2">
345
+ <li><strong>Add a test site to database</strong>:</li>
346
+ </ol>
347
+ <pre><code class="language-sql">-- Run in Supabase SQL Editor
348
+ INSERT INTO docbuilder_sites (domain, name)
349
+ VALUES (&#39;localhost:3000&#39;, &#39;Test Site&#39;)
350
+ RETURNING id;
351
+ </code></pre>
352
+ <ol start="3">
353
+ <li><strong>Copy the returned site ID</strong> and update your <code>test-config.js</code>:</li>
354
+ </ol>
355
+ <pre><code class="language-javascript">siteId: &#39;the-uuid-returned-from-above&#39;
356
+ </code></pre>
357
+ <h3>Step 7: Create Test Documentation</h3>
358
+ <ol>
359
+ <li><strong>Create test docs folder</strong>:</li>
360
+ </ol>
361
+ <pre><code class="language-bash">mkdir -p test-docs
362
+ echo &quot;# Test Documentation
363
+
364
+ This is a test page for Supabase authentication.
365
+
366
+ ## Features
367
+
368
+ - Secure login with Supabase
369
+ - User access control
370
+ - Session management
371
+
372
+ If you can see this page, authentication is working!&quot; &gt; test-docs/README.md
373
+ </code></pre>
374
+ <h3>Step 8: Test Build Process</h3>
375
+ <ol>
376
+ <li><strong>Build with authentication</strong>:</li>
377
+ </ol>
378
+ <pre><code class="language-bash">node cli.js build --config test-config.js --input test-docs --output test-html
379
+ </code></pre>
380
+ <ol start="2">
381
+ <li><strong>Check for expected files</strong>:</li>
382
+ </ol>
383
+ <pre><code class="language-bash">ls -la test-html/
384
+ # Should see:
385
+ # - login.html
386
+ # - logout.html
387
+ # - js/auth.js
388
+ # - index.html
389
+ </code></pre>
390
+ <ol start="3">
391
+ <li><strong>Inspect generated auth script</strong>:</li>
392
+ </ol>
393
+ <pre><code class="language-bash">head -20 test-html/js/auth.js
394
+ # Should show Supabase integration code, not basic auth
395
+ </code></pre>
396
+ <h3>Step 9: Test Local Server</h3>
397
+ <ol>
398
+ <li><strong>Start development server</strong>:</li>
399
+ </ol>
400
+ <pre><code class="language-bash">node cli.js dev --config test-config.js --input test-docs --port 3001
401
+ </code></pre>
402
+ <ol start="2">
403
+ <li><strong>Open browser</strong> to <code>http://localhost:3001</code></li>
404
+ <li><strong>Expected behavior</strong>:<ul>
405
+ <li>Should redirect to <code>/login.html</code> </li>
406
+ <li>Login page should show email/password fields</li>
407
+ <li>Should show Supabase errors (no user exists yet)</li>
408
+ </ul>
409
+ </li>
410
+ </ol>
411
+ <h3>Step 10: Create Test User</h3>
412
+ <ol>
413
+ <li><strong>In Supabase dashboard</strong>, go to <strong>Authentication → Users</strong></li>
414
+ <li><strong>Click &quot;Add User&quot;</strong>:<ul>
415
+ <li>Email: <code>test@example.com</code></li>
416
+ <li>Password: <code>testpassword123</code></li>
417
+ <li>Email confirm: <code>true</code></li>
418
+ </ul>
419
+ </li>
420
+ <li><strong>Get the user ID</strong> from the users table</li>
421
+ </ol>
422
+ <h3>Step 11: Grant Access to Test User</h3>
423
+ <pre><code class="language-sql">-- Run in Supabase SQL Editor
424
+ -- Replace with actual user ID and site ID
425
+ INSERT INTO docbuilder_access (user_id, site_id)
426
+ VALUES (&#39;USER_ID_FROM_STEP_10&#39;, &#39;SITE_ID_FROM_STEP_6&#39;);
427
+ </code></pre>
428
+ <h3>Step 12: Test Complete Flow</h3>
429
+ <ol>
430
+ <li><strong>Go to</strong> <code>http://localhost:3001</code></li>
431
+ <li><strong>Should redirect to login</strong></li>
432
+ <li><strong>Login with</strong>:<ul>
433
+ <li>Email: <code>test@example.com</code></li>
434
+ <li>Password: <code>testpassword123</code></li>
435
+ </ul>
436
+ </li>
437
+ <li><strong>Should redirect to documentation</strong></li>
438
+ <li><strong>Should see the test content</strong></li>
439
+ <li><strong>Logout should work</strong></li>
440
+ </ol>
441
+ <h2><i class="ph ph-rocket-launch" aria-label="launch"></i> Phase 2: Deployment Testing</h2>
442
+ <h3>Step 13: Test Vercel Deployment</h3>
443
+ <ol>
444
+ <li><strong>Update config for deployment</strong>:</li>
445
+ </ol>
446
+ <pre><code class="language-javascript">// test-config.js
447
+ module.exports = {
448
+ siteName: &#39;Test Documentation&#39;,
449
+
450
+ features: {
451
+ authentication: &#39;supabase&#39;
452
+ },
453
+
454
+ auth: {
455
+ supabaseUrl: process.env.SUPABASE_URL || &#39;your-fallback-url&#39;,
456
+ supabaseAnonKey: process.env.SUPABASE_ANON_KEY || &#39;your-fallback-key&#39;,
457
+ siteId: process.env.DOC_SITE_ID || &#39;your-site-id&#39;
458
+ }
459
+ };
460
+ </code></pre>
461
+ <ol start="2">
462
+ <li><strong>Create environment file</strong> for local testing:</li>
463
+ </ol>
464
+ <pre><code class="language-bash">cat &gt; .env &lt;&lt; &#39;EOF&#39;
465
+ SUPABASE_URL=your-supabase-url
466
+ SUPABASE_ANON_KEY=your-anon-key
467
+ DOC_SITE_ID=your-site-id
468
+ EOF
469
+ </code></pre>
470
+ <ol start="3">
471
+ <li><strong>Test with environment variables</strong>:</li>
472
+ </ol>
473
+ <pre><code class="language-bash">source .env
474
+ node cli.js build --config test-config.js --input test-docs --output test-html
475
+ </code></pre>
476
+ <ol start="4">
477
+ <li><strong>Deploy to Vercel</strong>:</li>
478
+ </ol>
479
+ <pre><code class="language-bash">node cli.js deploy --config test-config.js --input test-docs
480
+ </code></pre>
481
+ <ol start="5">
482
+ <li><strong>Configure environment variables in Vercel</strong>:<ul>
483
+ <li>Go to Vercel dashboard</li>
484
+ <li>Find your project</li>
485
+ <li>Go to Settings → Environment Variables</li>
486
+ <li>Add: <code>SUPABASE_URL</code>, <code>SUPABASE_ANON_KEY</code>, <code>DOC_SITE_ID</code></li>
487
+ </ul>
488
+ </li>
489
+ </ol>
490
+ <h3>Step 14: Update Site Domain in Database</h3>
491
+ <pre><code class="language-sql">-- Update the domain to match your Vercel URL
492
+ UPDATE docbuilder_sites
493
+ SET domain = &#39;your-vercel-url.vercel.app&#39;
494
+ WHERE id = &#39;your-site-id&#39;;
495
+ </code></pre>
496
+ <h2><i class="ph ph-wrench" aria-label="settings"></i> Phase 3: Version Management</h2>
497
+ <h3>Step 15: Update Version Number</h3>
498
+ <ol>
499
+ <li><strong>Update package.json</strong>:</li>
500
+ </ol>
501
+ <pre><code class="language-bash"># Current version is 1.7.4, bump to 2.0.0 for breaking changes
502
+ npm version major
503
+ </code></pre>
504
+ <ol start="2">
505
+ <li><strong>Update CHANGELOG.md</strong>:</li>
506
+ </ol>
507
+ <pre><code class="language-bash">cat &gt;&gt; CHANGELOG.md &lt;&lt; &#39;EOF&#39;
508
+
509
+ ## [2.0.0] - 2025-07-25
510
+
511
+ ### BREAKING CHANGES
512
+ - **Removed insecure basic authentication** - All client-side credential checking has been removed for security
513
+ - **Removed --no-auth CLI flag** - Use `authentication: false` in config instead
514
+ - **Updated configuration format** - `auth` object now requires Supabase credentials
515
+
516
+ ### Added
517
+ - **Supabase authentication integration** - Enterprise-grade secure authentication
518
+ - **Multi-site SSO support** - One account can access multiple documentation sites
519
+ - **CLI authentication commands** - `auth:init`, `auth:add-site`, `auth:grant`, `auth:revoke`, `auth:list-users`
520
+ - **Comprehensive setup guide** - Step-by-step Supabase authentication setup
521
+ - **Environment variable support** - Better security for production deployments
522
+
523
+ ### Security
524
+ - **Fixed critical vulnerability** - Client-side credentials are no longer exposed in JavaScript
525
+ - **Added Row Level Security** - Database-level access control
526
+ - **JWT token authentication** - Industry-standard secure sessions
527
+ - **Password hashing with bcrypt** - Secure password storage
528
+ - **Built-in password reset** - Users can reset their own passwords
529
+
530
+ ### Migration
531
+ - See `docs/guides/supabase-auth-setup-guide.md` for migration instructions
532
+ - Old basic auth configurations will need to be updated
533
+ - Existing users will need to be migrated to Supabase
534
+
535
+ EOF
536
+ </code></pre>
537
+ <h3>Step 16: Test Package Publishing</h3>
538
+ <ol>
539
+ <li><strong>Test pack command</strong>:</li>
540
+ </ol>
541
+ <pre><code class="language-bash">npm pack
542
+ # This creates a .tgz file without publishing
543
+ </code></pre>
544
+ <ol start="2">
545
+ <li><strong>Test installation from local package</strong>:</li>
546
+ </ol>
547
+ <pre><code class="language-bash"># In a different directory
548
+ mkdir test-install
549
+ cd test-install
550
+ npm install ../doc-builder/*.tgz
551
+
552
+ # Test the CLI
553
+ npx doc-builder --version
554
+ npx doc-builder --help
555
+ </code></pre>
556
+ <h2><i class="ph ph-clipboard-text" aria-label="clipboard"></i> Phase 4: Quality Assurance</h2>
557
+ <h3>Step 17: Test All CLI Commands</h3>
558
+ <pre><code class="language-bash"># Test help
559
+ node cli.js --help
560
+
561
+ # Test settings
562
+ node cli.js settings --config test-config.js
563
+
564
+ # Test each auth command
565
+ node cli.js auth:init --help
566
+ node cli.js auth:add-site --help
567
+ node cli.js auth:grant --help
568
+ node cli.js auth:revoke --help
569
+ node cli.js auth:list-users --help
570
+
571
+ # Test build with different options
572
+ node cli.js build --config test-config.js
573
+ node cli.js build --preset notion-inspired
574
+ </code></pre>
575
+ <h3>Step 18: Validate Generated Files</h3>
576
+ <ol>
577
+ <li><strong>Check authentication files</strong>:</li>
578
+ </ol>
579
+ <pre><code class="language-bash"># Should exist and contain Supabase code
580
+ cat test-html/js/auth.js | grep -i supabase
581
+ cat test-html/login.html | grep -i supabase
582
+ cat test-html/logout.html | head -10
583
+ </code></pre>
584
+ <ol start="2">
585
+ <li><strong>Check for security issues</strong>:</li>
586
+ </ol>
587
+ <pre><code class="language-bash"># Should NOT contain any hardcoded credentials
588
+ grep -r &quot;password.*:&quot; test-html/ || echo &quot;Good - no hardcoded passwords&quot;
589
+ grep -r &quot;username.*:&quot; test-html/ || echo &quot;Good - no hardcoded usernames&quot;
590
+ </code></pre>
591
+ <h3>Step 19: Cross-Platform Testing</h3>
592
+ <p>If possible, test on different systems:</p>
593
+ <ul>
594
+ <li><strong>macOS</strong>: Current system <i class="ph ph-check-circle" aria-label="checked"></i></li>
595
+ <li><strong>Windows</strong>: Test in WSL or Windows machine</li>
596
+ <li><strong>Linux</strong>: Test in Docker or Linux VM</li>
597
+ </ul>
598
+ <h3>Step 20: Documentation Review</h3>
599
+ <ol>
600
+ <li><strong>Check all documentation links</strong>:</li>
601
+ </ol>
602
+ <pre><code class="language-bash"># Test that all internal links work
603
+ find docs/ -name &quot;*.md&quot; -exec grep -l &quot;]\(&quot; {} \;
604
+ </code></pre>
605
+ <ol start="2">
606
+ <li><strong>Validate setup guide</strong>:<ul>
607
+ <li>Follow the setup guide from scratch</li>
608
+ <li>Ensure all steps work as documented</li>
609
+ <li>Check for missing steps or unclear instructions</li>
610
+ </ul>
611
+ </li>
612
+ </ol>
613
+ <h2><i class="ph ph-target" aria-label="goal"></i> Success Criteria Checklist</h2>
614
+ <p>Before considering deployment ready:</p>
615
+ <h3>Functionality</h3>
616
+ <ul>
617
+ <li><input disabled="" type="checkbox"> CLI auth commands work correctly</li>
618
+ <li><input disabled="" type="checkbox"> Build process generates Supabase auth files</li>
619
+ <li><input disabled="" type="checkbox"> Login/logout flow works end-to-end</li>
620
+ <li><input disabled="" type="checkbox"> User access control functions properly</li>
621
+ <li><input disabled="" type="checkbox"> Environment variables work in production</li>
622
+ <li><input disabled="" type="checkbox"> Vercel deployment succeeds with auth</li>
623
+ </ul>
624
+ <h3>Security</h3>
625
+ <ul>
626
+ <li><input disabled="" type="checkbox"> No hardcoded credentials in generated files</li>
627
+ <li><input disabled="" type="checkbox"> Row Level Security policies work</li>
628
+ <li><input disabled="" type="checkbox"> JWT tokens are properly validated</li>
629
+ <li><input disabled="" type="checkbox"> Session management is secure</li>
630
+ <li><input disabled="" type="checkbox"> Password reset functionality works</li>
631
+ </ul>
632
+ <h3>Documentation</h3>
633
+ <ul>
634
+ <li><input disabled="" type="checkbox"> Setup guide is complete and accurate</li>
635
+ <li><input disabled="" type="checkbox"> Migration instructions are clear</li>
636
+ <li><input disabled="" type="checkbox"> CLI help text is updated</li>
637
+ <li><input disabled="" type="checkbox"> README reflects new authentication</li>
638
+ <li><input disabled="" type="checkbox"> Security warnings are prominent</li>
639
+ </ul>
640
+ <h3>Compatibility</h3>
641
+ <ul>
642
+ <li><input disabled="" type="checkbox"> Node.js 14+ compatibility maintained</li>
643
+ <li><input disabled="" type="checkbox"> Vercel deployment works</li>
644
+ <li><input disabled="" type="checkbox"> Environment variable support</li>
645
+ <li><input disabled="" type="checkbox"> Cross-platform functionality</li>
646
+ </ul>
647
+ <h2><i class="ph ph-siren" aria-label="alert"></i> Issues to Watch For</h2>
648
+ <h3>Common Problems</h3>
649
+ <ol>
650
+ <li><strong>Supabase URL format errors</strong> - Must be <code>https://xxx.supabase.co</code></li>
651
+ <li><strong>RLS policy conflicts</strong> - May interfere with existing policies</li>
652
+ <li><strong>JavaScript errors in browser</strong> - Check console for auth failures</li>
653
+ <li><strong>Build failures</strong> - Missing Supabase credentials cause build errors</li>
654
+ <li><strong>Environment variable issues</strong> - Vercel env vars not loading properly</li>
655
+ </ol>
656
+ <h3>Debugging Tips</h3>
657
+ <ol>
658
+ <li><strong>Check browser console</strong> for JavaScript errors</li>
659
+ <li><strong>Verify Supabase credentials</strong> in dashboard</li>
660
+ <li><strong>Test database queries</strong> directly in Supabase SQL editor</li>
661
+ <li><strong>Check generated files</strong> contain expected Supabase code</li>
662
+ <li><strong>Validate environment variables</strong> are loaded correctly</li>
663
+ </ol>
664
+ <h2>Ready to Proceed?</h2>
665
+ <p>Once you&#39;ve completed Phase 1 (Local Testing), let me know the results and we can move to Phase 2 (Deployment Testing). I&#39;m here to help troubleshoot any issues that come up during testing!</p>
666
+
667
+ </div>
668
+ </main>
669
+ </div>
670
+
671
+ <!-- Scripts -->
672
+ <script>
673
+ // Pass configuration to frontend
674
+ window.docBuilderConfig = {
675
+ features: {
676
+ showPdfDownload: true,
677
+ menuDefaultOpen: false
678
+ }
679
+ };
680
+ </script>
681
+ <script src="/js/main.js"></script>
682
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
683
+ <script src="/js/auth.js"></script>
684
+ </body>
685
+ </html>