@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,529 @@
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="This document outlines the complete plan for integrating Supabase authentication into @knowcode/doc-builder, providing a simple but secure authentication...">
7
+ <title>Supabase Auth Implementation Plan for @knowcode...</title>
8
+
9
+ <meta name="author" content="Lindsay Smith">
10
+ <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, auth, supabase">
11
+ <meta name="robots" content="index, follow">
12
+ <link rel="canonical" href="https://doc-builder-delta.vercel.app/private/supabase-auth-implementation-plan.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/supabase-auth-implementation-plan.html">
17
+ <meta property="og:title" content="Supabase Auth Implementation Plan for @knowcode...">
18
+ <meta property="og:description" content="This document outlines the complete plan for integrating Supabase authentication into @knowcode/doc-builder, providing a simple but secure authentication...">
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="Supabase Auth Implementation Plan for @knowcode...">
28
+ <meta name="twitter:description" content="This document outlines the complete plan for integrating Supabase authentication into @knowcode/doc-builder, providing a simple but secure authentication...">
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": "Supabase Auth Implementation Plan for @knowcode/doc-builder",
58
+ "description": "This document outlines the complete plan for integrating Supabase authentication into @knowcode/doc-builder, providing a simple but secure authentication...",
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.007Z",
69
+ "dateModified": "2025-07-26T09:59:23.007Z",
70
+ "mainEntityOfPage": {
71
+ "@type": "WebPage",
72
+ "@id": "https://doc-builder-delta.vercel.app/private/supabase-auth-implementation-plan.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": "Supabase Auth Implementation Plan",
93
+ "item": "https://doc-builder-delta.vercel.app/private/supabase-auth-implementation-plan.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>Supabase Auth Implementation Plan for @knowcode/doc-builder</h1>
186
+ <h2>Implementation Overview</h2>
187
+ <p>This document outlines the complete plan for integrating Supabase authentication into @knowcode/doc-builder, providing a simple but secure authentication system that leverages Supabase&#39;s built-in auth functionality.</p>
188
+ <h2>Goals</h2>
189
+ <ol>
190
+ <li><strong>Simplicity</strong>: Minimal configuration and setup required</li>
191
+ <li><strong>Security</strong>: Leverage Supabase&#39;s enterprise-grade authentication</li>
192
+ <li><strong>Clean Architecture</strong>: Remove insecure basic auth entirely</li>
193
+ <li><strong>Future-Proof</strong>: Single, secure authentication method</li>
194
+ </ol>
195
+ <h2>Architecture Summary</h2>
196
+ <div class="mermaid-wrapper">
197
+ <div class="mermaid">graph TD
198
+ subgraph "Build Time"
199
+ Config[doc-builder.config.js]
200
+ Build[Build Process]
201
+ Config --> Build
202
+ Build --> AuthJS[Generate auth.js]
203
+ Build --> LoginPage[Generate login.html]
204
+ Build --> SDK[Include Supabase SDK]
205
+ end
206
+
207
+ subgraph "Runtime"
208
+ User[User Visit]
209
+ User --> Check{Auth Check}
210
+ Check -->|No Auth| Login
211
+ Check -->|Has Auth| Access{Access Check}
212
+ Access -->|Allowed| Docs[Show Docs]
213
+ Access -->|Denied| Denied[Access Denied]
214
+ Login --> SupaAuth[Supabase Auth]
215
+ SupaAuth --> Check
216
+ end
217
+
218
+ subgraph "Supabase"
219
+ AuthUsers[auth.users]
220
+ DocSites[docbuilder_sites]
221
+ DocAccess[docbuilder_access]
222
+ AuthUsers -.-> DocAccess
223
+ DocAccess -.-> DocSites
224
+ end</div>
225
+ </div>
226
+ <h2>Database Schema</h2>
227
+ <pre><code class="language-sql">-- Table 1: Documentation sites
228
+ CREATE TABLE docbuilder_sites (
229
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
230
+ domain TEXT UNIQUE NOT NULL,
231
+ name TEXT NOT NULL,
232
+ created_at TIMESTAMPTZ DEFAULT NOW()
233
+ );
234
+
235
+ -- Table 2: User access mapping
236
+ CREATE TABLE docbuilder_access (
237
+ user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
238
+ site_id UUID REFERENCES docbuilder_sites(id) ON DELETE CASCADE,
239
+ created_at TIMESTAMPTZ DEFAULT NOW(),
240
+ PRIMARY KEY (user_id, site_id)
241
+ );
242
+
243
+ -- Enable Row Level Security
244
+ ALTER TABLE docbuilder_sites ENABLE ROW LEVEL SECURITY;
245
+ ALTER TABLE docbuilder_access ENABLE ROW LEVEL SECURITY;
246
+
247
+ -- RLS Policies
248
+ CREATE POLICY &quot;Users see accessible sites&quot; ON docbuilder_sites
249
+ FOR SELECT USING (
250
+ EXISTS (
251
+ SELECT 1 FROM docbuilder_access
252
+ WHERE site_id = docbuilder_sites.id
253
+ AND user_id = auth.uid()
254
+ )
255
+ );
256
+
257
+ CREATE POLICY &quot;Users see own access&quot; ON docbuilder_access
258
+ FOR SELECT USING (user_id = auth.uid());
259
+ </code></pre>
260
+ <h2>Implementation Steps</h2>
261
+ <h3>Phase 1: Core Infrastructure</h3>
262
+ <h4>1.1 Update Configuration System</h4>
263
+ <ul>
264
+ <li>Replace auth types with: <code>false</code> (no auth) or <code>&#39;supabase&#39;</code> (secure auth)</li>
265
+ <li>Remove all basic auth configuration fields</li>
266
+ <li>Clean up insecure authentication references</li>
267
+ </ul>
268
+ <p><strong>File</strong>: <code>lib/config.js</code></p>
269
+ <pre><code class="language-javascript">// Updated auth configuration - REMOVE basic auth fields
270
+ auth: {
271
+ // Only Supabase fields remain
272
+ supabaseUrl: &#39;&#39;,
273
+ supabaseAnonKey: &#39;&#39;,
274
+ siteId: &#39;&#39;
275
+ }
276
+ </code></pre>
277
+ <h4>1.2 Create Supabase Auth Module</h4>
278
+ <p><strong>New File</strong>: <code>lib/supabase-auth.js</code></p>
279
+ <ul>
280
+ <li>Supabase client initialization</li>
281
+ <li>Auth check functionality</li>
282
+ <li>Access verification</li>
283
+ <li>Session management helpers</li>
284
+ </ul>
285
+ <h4>1.3 Update Core Builder</h4>
286
+ <p><strong>File</strong>: <code>lib/core-builder.js</code></p>
287
+ <ul>
288
+ <li>Detect Supabase auth configuration</li>
289
+ <li>Generate appropriate auth files</li>
290
+ <li>Include Supabase SDK in build output</li>
291
+ </ul>
292
+ <h3>Phase 2: Client-Side Implementation</h3>
293
+ <h4>2.1 Supabase Auth Script</h4>
294
+ <p><strong>Generated File</strong>: <code>js/auth.js</code></p>
295
+ <pre><code class="language-javascript">// Clean Supabase-only auth checking logic
296
+ // - Check for valid session
297
+ // - Verify site access
298
+ // - Handle redirects
299
+ // - No fallback to basic auth
300
+ </code></pre>
301
+ <h4>2.2 Login Page Generation</h4>
302
+ <p><strong>Generated File</strong>: <code>login.html</code></p>
303
+ <ul>
304
+ <li>Email/password form</li>
305
+ <li>Supabase auth integration</li>
306
+ <li>Error handling</li>
307
+ <li>Redirect management</li>
308
+ </ul>
309
+ <h4>2.3 Logout Functionality</h4>
310
+ <ul>
311
+ <li>Clear Supabase session</li>
312
+ <li>Redirect to login page</li>
313
+ <li>Clean up any local storage</li>
314
+ </ul>
315
+ <h3>Phase 3: Build Process Updates</h3>
316
+ <h4>3.1 SDK Integration</h4>
317
+ <ul>
318
+ <li>Download Supabase client library during build</li>
319
+ <li>Include in output directory</li>
320
+ <li>Optimize for production use</li>
321
+ </ul>
322
+ <h4>3.2 Environment Variable Support</h4>
323
+ <pre><code class="language-bash"># Support for environment variables
324
+ SUPABASE_URL=https://xxx.supabase.co
325
+ SUPABASE_ANON_KEY=xxx
326
+ DOC_SITE_ID=uuid
327
+ </code></pre>
328
+ <h4>3.3 Build Validation</h4>
329
+ <ul>
330
+ <li>Check for required Supabase configuration</li>
331
+ <li>Validate connection to Supabase</li>
332
+ <li>Warn about missing setup</li>
333
+ </ul>
334
+ <h3>Phase 4: User Management Tools</h3>
335
+ <h4>4.1 CLI Commands</h4>
336
+ <p><strong>File</strong>: <code>cli.js</code> - Major updates needed</p>
337
+ <pre><code class="language-bash"># Initialize Supabase auth for project
338
+ npx @knowcode/doc-builder auth:init
339
+
340
+ # Add site to Supabase database
341
+ npx @knowcode/doc-builder auth:add-site --domain docs.example.com --name &quot;Company Docs&quot;
342
+
343
+ # Grant user access to site
344
+ npx @knowcode/doc-builder auth:grant --email user@example.com --site-id xxx
345
+
346
+ # Revoke user access
347
+ npx @knowcode/doc-builder auth:revoke --email user@example.com --site-id xxx
348
+
349
+ # List users with access to site
350
+ npx @knowcode/doc-builder auth:list-users --site-id xxx
351
+
352
+ # List all sites user has access to
353
+ npx @knowcode/doc-builder auth:list-sites --email user@example.com
354
+
355
+ # Remove the old --no-auth flag (no longer needed)
356
+ # Add validation for Supabase configuration
357
+ </code></pre>
358
+ <h4>4.2 Admin Script</h4>
359
+ <p><strong>New File</strong>: <code>lib/admin/supabase-admin.js</code></p>
360
+ <ul>
361
+ <li>Simple Node.js script for user management</li>
362
+ <li>Can be used standalone or via CLI</li>
363
+ <li>Requires service role key for admin operations</li>
364
+ </ul>
365
+ <h3>Phase 5: Documentation and Migration</h3>
366
+ <h4>5.1 Documentation Updates</h4>
367
+ <ul>
368
+ <li>Update main README with Supabase auth option</li>
369
+ <li>Create detailed Supabase setup guide</li>
370
+ <li>Add troubleshooting section</li>
371
+ <li>Include migration guide from basic auth</li>
372
+ </ul>
373
+ <h4>5.2 Migration Path</h4>
374
+ <ul>
375
+ <li>Scripts to migrate from basic auth to Supabase</li>
376
+ <li>Bulk user import functionality</li>
377
+ <li>Backward compatibility period</li>
378
+ </ul>
379
+ <h2>File Changes Summary</h2>
380
+ <h3>Modified Files</h3>
381
+ <ol>
382
+ <li><code>lib/config.js</code> - Replace basic auth with Supabase configuration</li>
383
+ <li><code>lib/core-builder.js</code> - Remove basic auth, add Supabase auth generation</li>
384
+ <li><code>html/js/auth.js</code> - Remove basic auth logic entirely</li>
385
+ <li><code>cli.js</code> - <strong>MAJOR UPDATE</strong>: Add auth management commands, remove --no-auth flag</li>
386
+ <li><code>package.json</code> - Add @supabase/supabase-js dependency</li>
387
+ <li><code>README.md</code> - Document Supabase auth (remove basic auth docs)</li>
388
+ </ol>
389
+ <h3>New Files</h3>
390
+ <ol>
391
+ <li><code>lib/supabase-auth.js</code> - Supabase auth utilities</li>
392
+ <li><code>lib/admin/supabase-admin.js</code> - Admin management script</li>
393
+ <li><code>docs/guides/supabase-setup-guide.md</code> - Setup documentation</li>
394
+ <li><code>examples/supabase-auth/</code> - Example configuration</li>
395
+ </ol>
396
+ <h3>Generated Files (at build time)</h3>
397
+ <ol>
398
+ <li>Clean <code>js/auth.js</code> with Supabase-only support </li>
399
+ <li>Secure <code>login.html</code> with Supabase integration</li>
400
+ <li>Included Supabase SDK files</li>
401
+ </ol>
402
+ <h3>Removed Files/Code</h3>
403
+ <ol>
404
+ <li>All basic auth logic from existing auth.js</li>
405
+ <li>Hardcoded credentials from login page generation</li>
406
+ <li>Basic auth configuration options</li>
407
+ <li>Insecure client-side credential checking</li>
408
+ <li>CLI <code>--no-auth</code> flag (replaced with <code>authentication: false</code> in config)</li>
409
+ <li>Basic auth preset configurations</li>
410
+ </ol>
411
+ <h2>Testing Plan</h2>
412
+ <h3>Unit Tests</h3>
413
+ <ul>
414
+ <li>Configuration validation</li>
415
+ <li>Auth script generation</li>
416
+ <li>Build process with Supabase</li>
417
+ </ul>
418
+ <h3>Integration Tests</h3>
419
+ <ul>
420
+ <li>Full build with Supabase auth</li>
421
+ <li>Login/logout flow</li>
422
+ <li>Access control verification</li>
423
+ </ul>
424
+ <h3>Manual Testing</h3>
425
+ <ul>
426
+ <li>Deploy test site with Supabase auth</li>
427
+ <li>Test user registration/login</li>
428
+ <li>Verify access control</li>
429
+ <li>Test session persistence</li>
430
+ </ul>
431
+ <h2>Rollout Strategy</h2>
432
+ <h3>Version 2.0.0 (Breaking Change)</h3>
433
+ <ul>
434
+ <li><strong>BREAKING</strong>: Remove all basic auth functionality</li>
435
+ <li>Core Supabase authentication only</li>
436
+ <li>Clean, secure implementation</li>
437
+ <li>Migration guide for existing users</li>
438
+ </ul>
439
+ <h3>Version 2.0.1 (Stable)</h3>
440
+ <ul>
441
+ <li>Bug fixes from 2.0.0 release</li>
442
+ <li>Enhanced CLI tools</li>
443
+ <li>User management utilities</li>
444
+ </ul>
445
+ <h3>Version 2.1.0 (Enhanced)</h3>
446
+ <ul>
447
+ <li>Advanced features (roles, audit logs)</li>
448
+ <li>Admin dashboard</li>
449
+ <li>SSO support</li>
450
+ </ul>
451
+ <h2>Success Criteria</h2>
452
+ <ol>
453
+ <li><strong>Working Authentication</strong>: Users can log in via Supabase</li>
454
+ <li><strong>Access Control</strong>: Only authorized users see documentation </li>
455
+ <li><strong>Security</strong>: No more client-side credentials vulnerability</li>
456
+ <li><strong>Simple Setup</strong>: &lt; 10 minutes to configure</li>
457
+ <li><strong>Clean Architecture</strong>: Single auth method, no legacy code</li>
458
+ </ol>
459
+ <h2>Risk Mitigation</h2>
460
+ <ol>
461
+ <li><strong>Complexity</strong>: Keep initial implementation minimal</li>
462
+ <li><strong>Breaking Changes</strong>: Clear migration path and documentation</li>
463
+ <li><strong>Performance</strong>: Cache auth checks appropriately</li>
464
+ <li><strong>Security</strong>: Follow Supabase best practices</li>
465
+ <li><strong>Support</strong>: Provide clear documentation and migration guide</li>
466
+ </ol>
467
+ <h2><i class="ph ph-check-circle" aria-label="checked"></i> Implementation Status: COMPLETE</h2>
468
+ <p>All planned phases have been successfully implemented:</p>
469
+ <h3><i class="ph ph-check-circle" aria-label="checked"></i> Phase 1: Core Infrastructure - COMPLETE</h3>
470
+ <ul>
471
+ <li><input checked="" disabled="" type="checkbox"> Updated configuration system to remove basic auth</li>
472
+ <li><input checked="" disabled="" type="checkbox"> Added Supabase SDK dependency</li>
473
+ <li><input checked="" disabled="" type="checkbox"> Created Supabase auth module (<code>lib/supabase-auth.js</code>)</li>
474
+ <li><input checked="" disabled="" type="checkbox"> Updated core-builder.js integration</li>
475
+ </ul>
476
+ <h3><i class="ph ph-check-circle" aria-label="checked"></i> Phase 2: Client-Side Implementation - COMPLETE</h3>
477
+ <ul>
478
+ <li><input checked="" disabled="" type="checkbox"> Generated Supabase auth script replaces basic auth</li>
479
+ <li><input checked="" disabled="" type="checkbox"> Secure login page with Supabase integration</li>
480
+ <li><input checked="" disabled="" type="checkbox"> Logout functionality with proper session cleanup</li>
481
+ </ul>
482
+ <h3><i class="ph ph-check-circle" aria-label="checked"></i> Phase 3: Build Process Updates - COMPLETE</h3>
483
+ <ul>
484
+ <li><input checked="" disabled="" type="checkbox"> Supabase SDK integration in build output</li>
485
+ <li><input checked="" disabled="" type="checkbox"> Environment variable support</li>
486
+ <li><input checked="" disabled="" type="checkbox"> Build validation and error handling</li>
487
+ </ul>
488
+ <h3><i class="ph ph-check-circle" aria-label="checked"></i> Phase 4: User Management Tools - COMPLETE</h3>
489
+ <ul>
490
+ <li><input checked="" disabled="" type="checkbox"> CLI commands: <code>auth:init</code>, <code>auth:add-site</code>, <code>auth:grant</code>, <code>auth:revoke</code>, <code>auth:list-users</code></li>
491
+ <li><input checked="" disabled="" type="checkbox"> Updated settings command to show Supabase config</li>
492
+ <li><input checked="" disabled="" type="checkbox"> Removed insecure <code>--no-auth</code> flag</li>
493
+ </ul>
494
+ <h3><i class="ph ph-check-circle" aria-label="checked"></i> Phase 5: Documentation and Migration - COMPLETE</h3>
495
+ <ul>
496
+ <li><input checked="" disabled="" type="checkbox"> Comprehensive Supabase setup guide created</li>
497
+ <li><input checked="" disabled="" type="checkbox"> Updated main README with new auth information</li>
498
+ <li><input checked="" disabled="" type="checkbox"> Deprecated old authentication guide with security warnings</li>
499
+ <li><input checked="" disabled="" type="checkbox"> Migration instructions for existing users</li>
500
+ </ul>
501
+ <h2>Next Steps for Deployment</h2>
502
+ <h2>Questions to Address</h2>
503
+ <ol>
504
+ <li>Should we support multiple auth providers initially or just email/password?</li>
505
+ <li>Do we need audit logging from day one?</li>
506
+ <li>Should the admin tools be part of the main package or separate?</li>
507
+ <li>What&#39;s the target timeline for the beta release?</li>
508
+ </ol>
509
+ <hr>
510
+ <p>This plan provides a clear path to implementing Supabase authentication while maintaining the simplicity that makes @knowcode/doc-builder attractive to users.</p>
511
+
512
+ </div>
513
+ </main>
514
+ </div>
515
+
516
+ <!-- Scripts -->
517
+ <script>
518
+ // Pass configuration to frontend
519
+ window.docBuilderConfig = {
520
+ features: {
521
+ showPdfDownload: true,
522
+ menuDefaultOpen: false
523
+ }
524
+ };
525
+ </script>
526
+ <script src="/js/main.js"></script>
527
+
528
+ </body>
529
+ </html>