@knowcode/doc-builder 1.7.6 → 1.8.0

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 (42) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/CHANGELOG.md +22 -0
  3. package/assets/css/notion-style.css +9 -1
  4. package/html/README.html +5 -19
  5. package/html/css/notion-style.css +9 -1
  6. package/html/documentation-index.html +5 -19
  7. package/html/guides/authentication-default-change.html +5 -19
  8. package/html/guides/authentication-guide.html +189 -262
  9. package/html/guides/claude-workflow-guide.html +5 -19
  10. package/html/guides/documentation-standards.html +5 -19
  11. package/html/guides/phosphor-icons-guide.html +5 -19
  12. package/html/guides/private-directory-authentication.html +352 -0
  13. package/html/guides/public-site-deployment.html +11 -24
  14. package/html/guides/search-engine-verification-guide.html +5 -19
  15. package/html/guides/seo-guide.html +5 -19
  16. package/html/guides/seo-optimization-guide.html +5 -19
  17. package/html/guides/troubleshooting-guide.html +5 -19
  18. package/html/guides/windows-setup-guide.html +5 -19
  19. package/html/index.html +5 -19
  20. package/html/private/cache-control-anti-pattern.html +347 -0
  21. package/html/private/launch/README.html +289 -0
  22. package/html/private/launch/auth-cleanup-summary.html +279 -0
  23. package/html/private/launch/bubble-plugin-specification.html +925 -0
  24. package/html/private/launch/go-to-market-strategy.html +655 -0
  25. package/html/private/launch/launch-announcements.html +585 -0
  26. package/html/private/launch/vercel-deployment-auth-setup.html +329 -0
  27. package/html/private/next-steps-walkthrough.html +624 -0
  28. package/html/private/supabase-auth-implementation-completed.html +372 -0
  29. package/html/private/supabase-auth-implementation-plan.html +529 -0
  30. package/html/private/supabase-auth-integration-plan.html +657 -0
  31. package/html/private/supabase-auth-setup-guide.html +484 -0
  32. package/html/private/test-private-doc.html +220 -0
  33. package/html/sitemap.xml +113 -29
  34. package/html/vercel-cli-setup-guide.html +5 -19
  35. package/html/vercel-first-time-setup-guide.html +5 -19
  36. package/lib/config.js +24 -0
  37. package/lib/core-builder.js +40 -6
  38. package/lib/supabase-auth.js +60 -11
  39. package/package.json +1 -1
  40. package/user-management/README.md +81 -0
  41. package/user-management/add-users.sh +357 -0
  42. package/user-management/users.txt +15 -0
@@ -0,0 +1,624 @@
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
+
50
+ <!-- Favicon -->
51
+ <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>">
52
+
53
+ <script type="application/ld+json">
54
+ {
55
+ "@context": "https://schema.org",
56
+ "@type": "TechArticle",
57
+ "headline": "Next Steps: Testing and Deployment Walkthrough",
58
+ "description": "Now that we've implemented Supabase authentication, let's walk through testing the implementation and preparing for deployment. This guide provides detailed,...",
59
+ "author": {
60
+ "@type": "Person",
61
+ "name": "Lindsay Smith"
62
+ },
63
+ "publisher": {
64
+ "@type": "Organization",
65
+ "name": "Knowcode Ltd",
66
+ "url": "https://knowcode.tech"
67
+ },
68
+ "datePublished": "2025-07-26T09:59:23.002Z",
69
+ "dateModified": "2025-07-26T09:59:23.002Z",
70
+ "mainEntityOfPage": {
71
+ "@type": "WebPage",
72
+ "@id": "https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html"
73
+ },
74
+ "breadcrumb": {
75
+ "@type": "BreadcrumbList",
76
+ "itemListElement": [
77
+ {
78
+ "@type": "ListItem",
79
+ "position": 1,
80
+ "name": "@knowcode/doc-builder",
81
+ "item": "https://doc-builder-delta.vercel.app"
82
+ },
83
+ {
84
+ "@type": "ListItem",
85
+ "position": 2,
86
+ "name": "Private",
87
+ "item": "https://doc-builder-delta.vercel.app/private/"
88
+ },
89
+ {
90
+ "@type": "ListItem",
91
+ "position": 3,
92
+ "name": "Next Steps Walkthrough",
93
+ "item": "https://doc-builder-delta.vercel.app/private/next-steps-walkthrough.html"
94
+ }
95
+ ]
96
+ }
97
+ }
98
+ </script>
99
+ </head>
100
+ <body>
101
+ <!-- Header -->
102
+ <header class="header">
103
+ <div class="header-content">
104
+ <a href="/index.html" class="logo">@knowcode/doc-builder</a>
105
+
106
+ <div class="header-actions">
107
+ <div class="deployment-info">
108
+ <span class="deployment-date" title="Built with doc-builder v1.8.0">Last updated: Jul 26, 2025, 09:59 AM UTC</span>
109
+ </div>
110
+
111
+
112
+
113
+ <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
114
+ <i class="fas fa-moon"></i>
115
+ </button>
116
+
117
+ <button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
118
+ <i class="fas fa-bars"></i>
119
+ </button>
120
+ </div>
121
+ </div>
122
+ </header>
123
+
124
+ <!-- Preview Banner -->
125
+ <div id="preview-banner" class="preview-banner">
126
+ <div class="banner-content">
127
+ <i class="fas fa-exclamation-triangle banner-icon"></i>
128
+ <span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
129
+ <button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
130
+ <i class="fas fa-times"></i>
131
+ </button>
132
+ </div>
133
+ </div>
134
+
135
+ <!-- Breadcrumbs -->
136
+ <nav class="breadcrumbs" id="breadcrumbs">
137
+ <!-- Breadcrumbs will be generated by JavaScript -->
138
+ </nav>
139
+
140
+ <!-- Main Content -->
141
+ <div class="main-wrapper">
142
+ <!-- Sidebar -->
143
+ <aside class="sidebar">
144
+ <div class="sidebar-header">
145
+ <div class="filter-box">
146
+ <input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
147
+ <i class="fas fa-search filter-icon"></i>
148
+ </div>
149
+ </div>
150
+ <nav class="navigation">
151
+
152
+ <div class="nav-section" data-level="0">
153
+ <a class="nav-title" href="/README.html" >
154
+ <i class="fas fa-home"></i> Documentation
155
+ </a>
156
+ <div class="nav-content" >
157
+ <a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
158
+ <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>
159
+ <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>
160
+ <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>
161
+ <div class="nav-section" data-level="1">
162
+ <a class="nav-title collapsible" href="#" data-target="nav-guides-1" >
163
+ <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
164
+ </a>
165
+ <div class="nav-content collapsed" id="nav-guides-1">
166
+ <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>
167
+ <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>
168
+ <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>
169
+ <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>
170
+ <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>
171
+ <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now includes automatic authentication for documents placed in a directory."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
172
+ <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>
173
+ <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>
174
+ <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>
175
+ <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>
176
+ <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>
177
+ <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>
178
+ </nav>
179
+ <div class="resize-handle"></div>
180
+ </aside>
181
+
182
+ <!-- Content Area -->
183
+ <main class="content">
184
+ <div class="content-inner">
185
+ <h1>Next Steps: Testing and Deployment Walkthrough</h1>
186
+ <h2>Overview</h2>
187
+ <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>
188
+ <h2>🧪 Phase 1: Local Testing</h2>
189
+ <h3>Step 1: Install Dependencies</h3>
190
+ <p>First, install the new Supabase dependency:</p>
191
+ <pre><code class="language-bash">cd /Users/lindsaysmith/Documents/lambda1.nosync/doc-builder
192
+ npm install
193
+ </code></pre>
194
+ <h3>Step 2: Set Up Test Supabase Project</h3>
195
+ <ol>
196
+ <li><strong>Go to Supabase</strong>: Visit <a href="https://app.supabase.com">app.supabase.com</a></li>
197
+ <li><strong>Create new project</strong>: <ul>
198
+ <li>Name: <code>doc-builder-test</code></li>
199
+ <li>Database password: Choose a secure password</li>
200
+ <li>Region: Choose closest to you</li>
201
+ </ul>
202
+ </li>
203
+ <li><strong>Wait for setup</strong>: Usually takes 1-2 minutes</li>
204
+ </ol>
205
+ <h3>Step 3: Create Database Tables</h3>
206
+ <ol>
207
+ <li><strong>Go to SQL Editor</strong> in Supabase dashboard</li>
208
+ <li><strong>Run this SQL</strong> to create the required tables:</li>
209
+ </ol>
210
+ <pre><code class="language-sql">-- Table 1: Documentation sites
211
+ CREATE TABLE docbuilder_sites (
212
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
213
+ domain TEXT UNIQUE NOT NULL,
214
+ name TEXT NOT NULL,
215
+ created_at TIMESTAMPTZ DEFAULT NOW()
216
+ );
217
+
218
+ -- Table 2: User access mapping
219
+ CREATE TABLE docbuilder_access (
220
+ user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
221
+ site_id UUID REFERENCES docbuilder_sites(id) ON DELETE CASCADE,
222
+ created_at TIMESTAMPTZ DEFAULT NOW(),
223
+ PRIMARY KEY (user_id, site_id)
224
+ );
225
+
226
+ -- Enable Row Level Security
227
+ ALTER TABLE docbuilder_sites ENABLE ROW LEVEL SECURITY;
228
+ ALTER TABLE docbuilder_access ENABLE ROW LEVEL SECURITY;
229
+
230
+ -- RLS Policy: Users can only see sites they have access to
231
+ CREATE POLICY &quot;Users see accessible sites&quot; ON docbuilder_sites
232
+ FOR SELECT USING (
233
+ EXISTS (
234
+ SELECT 1 FROM docbuilder_access
235
+ WHERE site_id = docbuilder_sites.id
236
+ AND user_id = auth.uid()
237
+ )
238
+ );
239
+
240
+ -- RLS Policy: Users can see their own access
241
+ CREATE POLICY &quot;Users see own access&quot; ON docbuilder_access
242
+ FOR SELECT USING (user_id = auth.uid());
243
+ </code></pre>
244
+ <h3>Step 4: Get Supabase Credentials</h3>
245
+ <ol>
246
+ <li><strong>Go to Settings → API</strong> in Supabase dashboard</li>
247
+ <li><strong>Copy these values</strong>:<ul>
248
+ <li>Project URL (e.g., <code>https://abc123.supabase.co</code>)</li>
249
+ <li>Anon public key (starts with <code>eyJ...</code>)</li>
250
+ </ul>
251
+ </li>
252
+ </ol>
253
+ <h3>Step 5: Create Test Configuration</h3>
254
+ <ol>
255
+ <li><strong>Create test config file</strong>:</li>
256
+ </ol>
257
+ <pre><code class="language-bash"># In the doc-builder directory
258
+ cat &gt; test-config.js &lt;&lt; &#39;EOF&#39;
259
+ module.exports = {
260
+ siteName: &#39;Test Documentation&#39;,
261
+
262
+ features: {
263
+ authentication: &#39;supabase&#39;
264
+ },
265
+
266
+ auth: {
267
+ supabaseUrl: &#39;YOUR_SUPABASE_URL_HERE&#39;,
268
+ supabaseAnonKey: &#39;YOUR_ANON_KEY_HERE&#39;,
269
+ siteId: &#39;&#39; // Will be filled in next step
270
+ }
271
+ };
272
+ EOF
273
+ </code></pre>
274
+ <ol start="2">
275
+ <li><strong>Replace the placeholders</strong> with your actual Supabase credentials</li>
276
+ </ol>
277
+ <h3>Step 6: Test the CLI Commands</h3>
278
+ <ol>
279
+ <li><strong>Test the auth:init command</strong>:</li>
280
+ </ol>
281
+ <pre><code class="language-bash">node cli.js auth:init --config test-config.js
282
+ </code></pre>
283
+ <p>This should prompt you for Supabase credentials and create/update the config.</p>
284
+ <ol start="2">
285
+ <li><strong>Add a test site to database</strong>:</li>
286
+ </ol>
287
+ <pre><code class="language-sql">-- Run in Supabase SQL Editor
288
+ INSERT INTO docbuilder_sites (domain, name)
289
+ VALUES (&#39;localhost:3000&#39;, &#39;Test Site&#39;)
290
+ RETURNING id;
291
+ </code></pre>
292
+ <ol start="3">
293
+ <li><strong>Copy the returned site ID</strong> and update your <code>test-config.js</code>:</li>
294
+ </ol>
295
+ <pre><code class="language-javascript">siteId: &#39;the-uuid-returned-from-above&#39;
296
+ </code></pre>
297
+ <h3>Step 7: Create Test Documentation</h3>
298
+ <ol>
299
+ <li><strong>Create test docs folder</strong>:</li>
300
+ </ol>
301
+ <pre><code class="language-bash">mkdir -p test-docs
302
+ echo &quot;# Test Documentation
303
+
304
+ This is a test page for Supabase authentication.
305
+
306
+ ## Features
307
+
308
+ - Secure login with Supabase
309
+ - User access control
310
+ - Session management
311
+
312
+ If you can see this page, authentication is working!&quot; &gt; test-docs/README.md
313
+ </code></pre>
314
+ <h3>Step 8: Test Build Process</h3>
315
+ <ol>
316
+ <li><strong>Build with authentication</strong>:</li>
317
+ </ol>
318
+ <pre><code class="language-bash">node cli.js build --config test-config.js --input test-docs --output test-html
319
+ </code></pre>
320
+ <ol start="2">
321
+ <li><strong>Check for expected files</strong>:</li>
322
+ </ol>
323
+ <pre><code class="language-bash">ls -la test-html/
324
+ # Should see:
325
+ # - login.html
326
+ # - logout.html
327
+ # - js/auth.js
328
+ # - index.html
329
+ </code></pre>
330
+ <ol start="3">
331
+ <li><strong>Inspect generated auth script</strong>:</li>
332
+ </ol>
333
+ <pre><code class="language-bash">head -20 test-html/js/auth.js
334
+ # Should show Supabase integration code, not basic auth
335
+ </code></pre>
336
+ <h3>Step 9: Test Local Server</h3>
337
+ <ol>
338
+ <li><strong>Start development server</strong>:</li>
339
+ </ol>
340
+ <pre><code class="language-bash">node cli.js dev --config test-config.js --input test-docs --port 3001
341
+ </code></pre>
342
+ <ol start="2">
343
+ <li><strong>Open browser</strong> to <code>http://localhost:3001</code></li>
344
+ <li><strong>Expected behavior</strong>:<ul>
345
+ <li>Should redirect to <code>/login.html</code> </li>
346
+ <li>Login page should show email/password fields</li>
347
+ <li>Should show Supabase errors (no user exists yet)</li>
348
+ </ul>
349
+ </li>
350
+ </ol>
351
+ <h3>Step 10: Create Test User</h3>
352
+ <ol>
353
+ <li><strong>In Supabase dashboard</strong>, go to <strong>Authentication → Users</strong></li>
354
+ <li><strong>Click &quot;Add User&quot;</strong>:<ul>
355
+ <li>Email: <code>test@example.com</code></li>
356
+ <li>Password: <code>testpassword123</code></li>
357
+ <li>Email confirm: <code>true</code></li>
358
+ </ul>
359
+ </li>
360
+ <li><strong>Get the user ID</strong> from the users table</li>
361
+ </ol>
362
+ <h3>Step 11: Grant Access to Test User</h3>
363
+ <pre><code class="language-sql">-- Run in Supabase SQL Editor
364
+ -- Replace with actual user ID and site ID
365
+ INSERT INTO docbuilder_access (user_id, site_id)
366
+ VALUES (&#39;USER_ID_FROM_STEP_10&#39;, &#39;SITE_ID_FROM_STEP_6&#39;);
367
+ </code></pre>
368
+ <h3>Step 12: Test Complete Flow</h3>
369
+ <ol>
370
+ <li><strong>Go to</strong> <code>http://localhost:3001</code></li>
371
+ <li><strong>Should redirect to login</strong></li>
372
+ <li><strong>Login with</strong>:<ul>
373
+ <li>Email: <code>test@example.com</code></li>
374
+ <li>Password: <code>testpassword123</code></li>
375
+ </ul>
376
+ </li>
377
+ <li><strong>Should redirect to documentation</strong></li>
378
+ <li><strong>Should see the test content</strong></li>
379
+ <li><strong>Logout should work</strong></li>
380
+ </ol>
381
+ <h2><i class="ph ph-rocket-launch" aria-label="launch"></i> Phase 2: Deployment Testing</h2>
382
+ <h3>Step 13: Test Vercel Deployment</h3>
383
+ <ol>
384
+ <li><strong>Update config for deployment</strong>:</li>
385
+ </ol>
386
+ <pre><code class="language-javascript">// test-config.js
387
+ module.exports = {
388
+ siteName: &#39;Test Documentation&#39;,
389
+
390
+ features: {
391
+ authentication: &#39;supabase&#39;
392
+ },
393
+
394
+ auth: {
395
+ supabaseUrl: process.env.SUPABASE_URL || &#39;your-fallback-url&#39;,
396
+ supabaseAnonKey: process.env.SUPABASE_ANON_KEY || &#39;your-fallback-key&#39;,
397
+ siteId: process.env.DOC_SITE_ID || &#39;your-site-id&#39;
398
+ }
399
+ };
400
+ </code></pre>
401
+ <ol start="2">
402
+ <li><strong>Create environment file</strong> for local testing:</li>
403
+ </ol>
404
+ <pre><code class="language-bash">cat &gt; .env &lt;&lt; &#39;EOF&#39;
405
+ SUPABASE_URL=your-supabase-url
406
+ SUPABASE_ANON_KEY=your-anon-key
407
+ DOC_SITE_ID=your-site-id
408
+ EOF
409
+ </code></pre>
410
+ <ol start="3">
411
+ <li><strong>Test with environment variables</strong>:</li>
412
+ </ol>
413
+ <pre><code class="language-bash">source .env
414
+ node cli.js build --config test-config.js --input test-docs --output test-html
415
+ </code></pre>
416
+ <ol start="4">
417
+ <li><strong>Deploy to Vercel</strong>:</li>
418
+ </ol>
419
+ <pre><code class="language-bash">node cli.js deploy --config test-config.js --input test-docs
420
+ </code></pre>
421
+ <ol start="5">
422
+ <li><strong>Configure environment variables in Vercel</strong>:<ul>
423
+ <li>Go to Vercel dashboard</li>
424
+ <li>Find your project</li>
425
+ <li>Go to Settings → Environment Variables</li>
426
+ <li>Add: <code>SUPABASE_URL</code>, <code>SUPABASE_ANON_KEY</code>, <code>DOC_SITE_ID</code></li>
427
+ </ul>
428
+ </li>
429
+ </ol>
430
+ <h3>Step 14: Update Site Domain in Database</h3>
431
+ <pre><code class="language-sql">-- Update the domain to match your Vercel URL
432
+ UPDATE docbuilder_sites
433
+ SET domain = &#39;your-vercel-url.vercel.app&#39;
434
+ WHERE id = &#39;your-site-id&#39;;
435
+ </code></pre>
436
+ <h2><i class="ph ph-wrench" aria-label="settings"></i> Phase 3: Version Management</h2>
437
+ <h3>Step 15: Update Version Number</h3>
438
+ <ol>
439
+ <li><strong>Update package.json</strong>:</li>
440
+ </ol>
441
+ <pre><code class="language-bash"># Current version is 1.7.4, bump to 2.0.0 for breaking changes
442
+ npm version major
443
+ </code></pre>
444
+ <ol start="2">
445
+ <li><strong>Update CHANGELOG.md</strong>:</li>
446
+ </ol>
447
+ <pre><code class="language-bash">cat &gt;&gt; CHANGELOG.md &lt;&lt; &#39;EOF&#39;
448
+
449
+ ## [2.0.0] - 2025-07-25
450
+
451
+ ### BREAKING CHANGES
452
+ - **Removed insecure basic authentication** - All client-side credential checking has been removed for security
453
+ - **Removed --no-auth CLI flag** - Use `authentication: false` in config instead
454
+ - **Updated configuration format** - `auth` object now requires Supabase credentials
455
+
456
+ ### Added
457
+ - **Supabase authentication integration** - Enterprise-grade secure authentication
458
+ - **Multi-site SSO support** - One account can access multiple documentation sites
459
+ - **CLI authentication commands** - `auth:init`, `auth:add-site`, `auth:grant`, `auth:revoke`, `auth:list-users`
460
+ - **Comprehensive setup guide** - Step-by-step Supabase authentication setup
461
+ - **Environment variable support** - Better security for production deployments
462
+
463
+ ### Security
464
+ - **Fixed critical vulnerability** - Client-side credentials are no longer exposed in JavaScript
465
+ - **Added Row Level Security** - Database-level access control
466
+ - **JWT token authentication** - Industry-standard secure sessions
467
+ - **Password hashing with bcrypt** - Secure password storage
468
+ - **Built-in password reset** - Users can reset their own passwords
469
+
470
+ ### Migration
471
+ - See `docs/guides/supabase-auth-setup-guide.md` for migration instructions
472
+ - Old basic auth configurations will need to be updated
473
+ - Existing users will need to be migrated to Supabase
474
+
475
+ EOF
476
+ </code></pre>
477
+ <h3>Step 16: Test Package Publishing</h3>
478
+ <ol>
479
+ <li><strong>Test pack command</strong>:</li>
480
+ </ol>
481
+ <pre><code class="language-bash">npm pack
482
+ # This creates a .tgz file without publishing
483
+ </code></pre>
484
+ <ol start="2">
485
+ <li><strong>Test installation from local package</strong>:</li>
486
+ </ol>
487
+ <pre><code class="language-bash"># In a different directory
488
+ mkdir test-install
489
+ cd test-install
490
+ npm install ../doc-builder/*.tgz
491
+
492
+ # Test the CLI
493
+ npx doc-builder --version
494
+ npx doc-builder --help
495
+ </code></pre>
496
+ <h2><i class="ph ph-clipboard-text" aria-label="clipboard"></i> Phase 4: Quality Assurance</h2>
497
+ <h3>Step 17: Test All CLI Commands</h3>
498
+ <pre><code class="language-bash"># Test help
499
+ node cli.js --help
500
+
501
+ # Test settings
502
+ node cli.js settings --config test-config.js
503
+
504
+ # Test each auth command
505
+ node cli.js auth:init --help
506
+ node cli.js auth:add-site --help
507
+ node cli.js auth:grant --help
508
+ node cli.js auth:revoke --help
509
+ node cli.js auth:list-users --help
510
+
511
+ # Test build with different options
512
+ node cli.js build --config test-config.js
513
+ node cli.js build --preset notion-inspired
514
+ </code></pre>
515
+ <h3>Step 18: Validate Generated Files</h3>
516
+ <ol>
517
+ <li><strong>Check authentication files</strong>:</li>
518
+ </ol>
519
+ <pre><code class="language-bash"># Should exist and contain Supabase code
520
+ cat test-html/js/auth.js | grep -i supabase
521
+ cat test-html/login.html | grep -i supabase
522
+ cat test-html/logout.html | head -10
523
+ </code></pre>
524
+ <ol start="2">
525
+ <li><strong>Check for security issues</strong>:</li>
526
+ </ol>
527
+ <pre><code class="language-bash"># Should NOT contain any hardcoded credentials
528
+ grep -r &quot;password.*:&quot; test-html/ || echo &quot;Good - no hardcoded passwords&quot;
529
+ grep -r &quot;username.*:&quot; test-html/ || echo &quot;Good - no hardcoded usernames&quot;
530
+ </code></pre>
531
+ <h3>Step 19: Cross-Platform Testing</h3>
532
+ <p>If possible, test on different systems:</p>
533
+ <ul>
534
+ <li><strong>macOS</strong>: Current system <i class="ph ph-check-circle" aria-label="checked"></i></li>
535
+ <li><strong>Windows</strong>: Test in WSL or Windows machine</li>
536
+ <li><strong>Linux</strong>: Test in Docker or Linux VM</li>
537
+ </ul>
538
+ <h3>Step 20: Documentation Review</h3>
539
+ <ol>
540
+ <li><strong>Check all documentation links</strong>:</li>
541
+ </ol>
542
+ <pre><code class="language-bash"># Test that all internal links work
543
+ find docs/ -name &quot;*.md&quot; -exec grep -l &quot;]\(&quot; {} \;
544
+ </code></pre>
545
+ <ol start="2">
546
+ <li><strong>Validate setup guide</strong>:<ul>
547
+ <li>Follow the setup guide from scratch</li>
548
+ <li>Ensure all steps work as documented</li>
549
+ <li>Check for missing steps or unclear instructions</li>
550
+ </ul>
551
+ </li>
552
+ </ol>
553
+ <h2><i class="ph ph-target" aria-label="goal"></i> Success Criteria Checklist</h2>
554
+ <p>Before considering deployment ready:</p>
555
+ <h3>Functionality</h3>
556
+ <ul>
557
+ <li><input disabled="" type="checkbox"> CLI auth commands work correctly</li>
558
+ <li><input disabled="" type="checkbox"> Build process generates Supabase auth files</li>
559
+ <li><input disabled="" type="checkbox"> Login/logout flow works end-to-end</li>
560
+ <li><input disabled="" type="checkbox"> User access control functions properly</li>
561
+ <li><input disabled="" type="checkbox"> Environment variables work in production</li>
562
+ <li><input disabled="" type="checkbox"> Vercel deployment succeeds with auth</li>
563
+ </ul>
564
+ <h3>Security</h3>
565
+ <ul>
566
+ <li><input disabled="" type="checkbox"> No hardcoded credentials in generated files</li>
567
+ <li><input disabled="" type="checkbox"> Row Level Security policies work</li>
568
+ <li><input disabled="" type="checkbox"> JWT tokens are properly validated</li>
569
+ <li><input disabled="" type="checkbox"> Session management is secure</li>
570
+ <li><input disabled="" type="checkbox"> Password reset functionality works</li>
571
+ </ul>
572
+ <h3>Documentation</h3>
573
+ <ul>
574
+ <li><input disabled="" type="checkbox"> Setup guide is complete and accurate</li>
575
+ <li><input disabled="" type="checkbox"> Migration instructions are clear</li>
576
+ <li><input disabled="" type="checkbox"> CLI help text is updated</li>
577
+ <li><input disabled="" type="checkbox"> README reflects new authentication</li>
578
+ <li><input disabled="" type="checkbox"> Security warnings are prominent</li>
579
+ </ul>
580
+ <h3>Compatibility</h3>
581
+ <ul>
582
+ <li><input disabled="" type="checkbox"> Node.js 14+ compatibility maintained</li>
583
+ <li><input disabled="" type="checkbox"> Vercel deployment works</li>
584
+ <li><input disabled="" type="checkbox"> Environment variable support</li>
585
+ <li><input disabled="" type="checkbox"> Cross-platform functionality</li>
586
+ </ul>
587
+ <h2><i class="ph ph-siren" aria-label="alert"></i> Issues to Watch For</h2>
588
+ <h3>Common Problems</h3>
589
+ <ol>
590
+ <li><strong>Supabase URL format errors</strong> - Must be <code>https://xxx.supabase.co</code></li>
591
+ <li><strong>RLS policy conflicts</strong> - May interfere with existing policies</li>
592
+ <li><strong>JavaScript errors in browser</strong> - Check console for auth failures</li>
593
+ <li><strong>Build failures</strong> - Missing Supabase credentials cause build errors</li>
594
+ <li><strong>Environment variable issues</strong> - Vercel env vars not loading properly</li>
595
+ </ol>
596
+ <h3>Debugging Tips</h3>
597
+ <ol>
598
+ <li><strong>Check browser console</strong> for JavaScript errors</li>
599
+ <li><strong>Verify Supabase credentials</strong> in dashboard</li>
600
+ <li><strong>Test database queries</strong> directly in Supabase SQL editor</li>
601
+ <li><strong>Check generated files</strong> contain expected Supabase code</li>
602
+ <li><strong>Validate environment variables</strong> are loaded correctly</li>
603
+ </ol>
604
+ <h2>Ready to Proceed?</h2>
605
+ <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>
606
+
607
+ </div>
608
+ </main>
609
+ </div>
610
+
611
+ <!-- Scripts -->
612
+ <script>
613
+ // Pass configuration to frontend
614
+ window.docBuilderConfig = {
615
+ features: {
616
+ showPdfDownload: true,
617
+ menuDefaultOpen: false
618
+ }
619
+ };
620
+ </script>
621
+ <script src="/js/main.js"></script>
622
+
623
+ </body>
624
+ </html>