@knowcode/doc-builder 1.9.29 → 1.9.31

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 (197) hide show
  1. package/assets/js/main.js +7 -0
  2. package/lib/core-builder.js +18 -1
  3. package/package.json +12 -2
  4. package/.claude/settings.local.json +0 -56
  5. package/CACHE-BUSTING-GUIDE.md +0 -82
  6. package/CLAUDE.md +0 -86
  7. package/CONTRIBUTING.md +0 -148
  8. package/GITHUB_SETUP.md +0 -203
  9. package/RELEASE-NOTES-1.7.5.md +0 -64
  10. package/Screenshot 2025-07-22 at 19.51.21.png +0 -0
  11. package/Screenshot 2025-07-26 at 17.06.49.png +0 -0
  12. package/add-user-clive.sql +0 -35
  13. package/add-user-lindsay-fixed.sql +0 -85
  14. package/add-user-lindsay.sql +0 -68
  15. package/add-user-pmorgan.sql +0 -35
  16. package/add-user-robbie.sql +0 -35
  17. package/add-wru-users.sql +0 -105
  18. package/debug-login.sql +0 -30
  19. package/doc-builder.config.js +0 -126
  20. package/doc-builder.config.js.backup.1753793768283 +0 -47
  21. package/doc-builder.config.js.backup.1753803964423 +0 -114
  22. package/doc-builder.config.js.backup.1753945707032 +0 -115
  23. package/doc-builder.config.js.backup.1754059241330 +0 -115
  24. package/doc-builder.config.js.backup.1754119567787 +0 -123
  25. package/doc-builder.config.js.backup.1754120048862 +0 -124
  26. package/doc-builder.config.js.backup.1754120529913 +0 -124
  27. package/doc-builder.config.js.backup.1754218469785 +0 -124
  28. package/doc-builder.config.js.backup.1754384764054 +0 -124
  29. package/doc-builder.config.js.backup.1754567425847 +0 -124
  30. package/doc-builder.config.js.backup.1754568137859 +0 -126
  31. package/doc-builder.config.js.backup.1754569388252 +0 -126
  32. package/doc-builder.config.js.backup.1754576694123 +0 -126
  33. package/doc-builder.config.js.backup.1755031374829 +0 -126
  34. package/doc-builder.config.js.backup.1755034500990 +0 -126
  35. package/grant-access.sql +0 -15
  36. package/html/11.png +0 -0
  37. package/html/404.html +0 -115
  38. package/html/README.html +0 -522
  39. package/html/Screenshot 2025-08-12 at 21.35.07.png +0 -0
  40. package/html/about-doc-builder.html +0 -491
  41. package/html/auth.js +0 -157
  42. package/html/claude-workflow-guide.html +0 -525
  43. package/html/css/notion-style.css +0 -2502
  44. package/html/documentation-index.html +0 -471
  45. package/html/guides/authentication-default-change.html +0 -370
  46. package/html/guides/authentication-guide.html +0 -509
  47. package/html/guides/cache-control-anti-pattern.html +0 -361
  48. package/html/guides/claude-workflow-guide.html +0 -1074
  49. package/html/guides/configuration-guide.html +0 -472
  50. package/html/guides/document-standards.html +0 -518
  51. package/html/guides/documentation-standards.html +0 -694
  52. package/html/guides/html-embedding-guide.html +0 -461
  53. package/html/guides/image-modal-guide.html +0 -515
  54. package/html/guides/next-steps-walkthrough.html +0 -638
  55. package/html/guides/phosphor-icons-guide.html +0 -584
  56. package/html/guides/private-directory-authentication-troubleshooting.html +0 -555
  57. package/html/guides/private-directory-authentication.html +0 -541
  58. package/html/guides/public-site-deployment.html +0 -431
  59. package/html/guides/search-engine-verification-guide.html +0 -542
  60. package/html/guides/seo-guide.html +0 -661
  61. package/html/guides/seo-optimization-guide.html +0 -887
  62. package/html/guides/supabase-auth-implementation-plan.html +0 -543
  63. package/html/guides/supabase-auth-integration-plan.html +0 -671
  64. package/html/guides/supabase-auth-setup-guide.html +0 -498
  65. package/html/guides/supabase-authentication-complete-guide.html +0 -866
  66. package/html/guides/troubleshooting-guide.html +0 -633
  67. package/html/guides/vercel-deployment-auth-setup.html +0 -337
  68. package/html/guides/windows-setup-guide.html +0 -859
  69. package/html/image-modal-test.html +0 -318
  70. package/html/index.html +0 -522
  71. package/html/js/auth.js +0 -157
  72. package/html/js/main.js +0 -1747
  73. package/html/launch/README.html +0 -297
  74. package/html/launch/bubble-plugin-specification.html +0 -933
  75. package/html/launch/go-to-market-strategy.html +0 -663
  76. package/html/launch/launch-announcements.html +0 -593
  77. package/html/login.html +0 -102
  78. package/html/logout.html +0 -18
  79. package/html/private/cache-control-anti-pattern.html +0 -429
  80. package/html/private/launch/README.html +0 -371
  81. package/html/private/launch/auth-cleanup-summary.html +0 -361
  82. package/html/private/launch/bubble-plugin-specification.html +0 -1007
  83. package/html/private/launch/go-to-market-strategy.html +0 -737
  84. package/html/private/launch/launch-announcements.html +0 -667
  85. package/html/private/launch/vercel-deployment-auth-setup.html +0 -417
  86. package/html/private/next-steps-walkthrough.html +0 -679
  87. package/html/private/supabase-auth-implementation-completed.html +0 -454
  88. package/html/private/supabase-auth-implementation-plan.html +0 -594
  89. package/html/private/supabase-auth-integration-plan.html +0 -704
  90. package/html/private/supabase-auth-setup-guide.html +0 -555
  91. package/html/private/test-private-doc.html +0 -302
  92. package/html/private/user-management-tooling.html +0 -601
  93. package/html/prompts/Screenshot 2025-08-02 at 08.49.55.png +0 -0
  94. package/html/prompts/beautiful-documentation-design.html +0 -784
  95. package/html/prompts/markdown-document-standards.html +0 -422
  96. package/html/prompts/project-rename-strategy-sasha-publish.html +0 -530
  97. package/html/robots.txt +0 -9
  98. package/html/sitemap.xml +0 -357
  99. package/html/test-questions/how-does-it-work%3F.html +0 -294
  100. package/html/test-questions/step-1%3A%20getting-started.html +0 -289
  101. package/html/test-questions/what-is-the-purpose.html +0 -293
  102. package/html/test-status.html +0 -281
  103. package/html/vercel-cli-setup-guide.html +0 -495
  104. package/html/vercel-first-time-setup-guide.html +0 -454
  105. package/html/vercel.json +0 -29
  106. package/html-static/11.png +0 -0
  107. package/html-static/404.html +0 -115
  108. package/html-static/README.html +0 -599
  109. package/html-static/Screenshot 2025-08-12 at 21.35.07.png +0 -0
  110. package/html-static/about-doc-builder.html +0 -568
  111. package/html-static/css/notion-style.css +0 -2502
  112. package/html-static/documentation-index.html +0 -548
  113. package/html-static/guides/authentication-default-change.html +0 -447
  114. package/html-static/guides/authentication-guide.html +0 -586
  115. package/html-static/guides/claude-workflow-guide.html +0 -1151
  116. package/html-static/guides/configuration-guide.html +0 -549
  117. package/html-static/guides/documentation-standards.html +0 -771
  118. package/html-static/guides/html-embedding-guide.html +0 -538
  119. package/html-static/guides/image-modal-guide.html +0 -592
  120. package/html-static/guides/phosphor-icons-guide.html +0 -661
  121. package/html-static/guides/private-directory-authentication-troubleshooting.html +0 -632
  122. package/html-static/guides/private-directory-authentication.html +0 -618
  123. package/html-static/guides/public-site-deployment.html +0 -508
  124. package/html-static/guides/search-engine-verification-guide.html +0 -619
  125. package/html-static/guides/seo-guide.html +0 -738
  126. package/html-static/guides/seo-optimization-guide.html +0 -964
  127. package/html-static/guides/supabase-authentication-complete-guide.html +0 -943
  128. package/html-static/guides/troubleshooting-guide.html +0 -710
  129. package/html-static/guides/windows-setup-guide.html +0 -936
  130. package/html-static/image-modal-test.html +0 -395
  131. package/html-static/index.html +0 -599
  132. package/html-static/js/main.js +0 -1747
  133. package/html-static/prompts/Screenshot 2025-08-02 at 08.49.55.png +0 -0
  134. package/html-static/prompts/beautiful-documentation-design.html +0 -861
  135. package/html-static/prompts/markdown-document-standards.html +0 -499
  136. package/html-static/prompts/project-rename-strategy-sasha-publish.html +0 -607
  137. package/html-static/robots.txt +0 -5
  138. package/html-static/sitemap.xml +0 -195
  139. package/html-static/test-questions/how-does-it-work%3F.html +0 -371
  140. package/html-static/test-questions/step-1%3A%20getting-started.html +0 -366
  141. package/html-static/test-questions/what-is-the-purpose.html +0 -370
  142. package/html-static/vercel-cli-setup-guide.html +0 -572
  143. package/html-static/vercel-first-time-setup-guide.html +0 -531
  144. package/manage-users.sql +0 -191
  145. package/migrate-to-domain-auth.sql +0 -47
  146. package/package/CACHE-BUSTING-GUIDE.md +0 -82
  147. package/package/CHANGELOG.md +0 -902
  148. package/package/README.md +0 -248
  149. package/package/assets/css/notion-style.css +0 -2211
  150. package/package/assets/js/auth.js +0 -67
  151. package/package/assets/js/main.js +0 -1565
  152. package/package/cli.js +0 -764
  153. package/package/index.js +0 -38
  154. package/package/knowcode-doc-builder-1.3.15.tgz +0 -0
  155. package/package/lib/builder.js +0 -32
  156. package/package/lib/config.js +0 -278
  157. package/package/lib/core-builder.js +0 -957
  158. package/package/lib/deploy.js +0 -497
  159. package/package/lib/dev-server.js +0 -96
  160. package/package/package.json +0 -34
  161. package/package/scripts/npx-runner.js +0 -27
  162. package/package/scripts/setup.js +0 -56
  163. package/package/test-cache-bust.sh +0 -43
  164. package/public-config.js +0 -22
  165. package/public-html/404.html +0 -115
  166. package/public-html/README.html +0 -149
  167. package/public-html/css/notion-style.css +0 -2036
  168. package/public-html/index.html +0 -149
  169. package/public-html/js/auth.js +0 -67
  170. package/public-html/js/main.js +0 -1485
  171. package/quick-test-commands.md +0 -40
  172. package/recordings/Screenshot 2025-07-24 at 18.22.01.png +0 -0
  173. package/recordings/mh-ls-22jul.txt +0 -2305
  174. package/screenshot.png +0 -0
  175. package/scripts/Screenshot 2025-07-23 at 15.39.41.png +0 -0
  176. package/setup-database-v2.sql +0 -53
  177. package/setup-database.sql +0 -41
  178. package/test-auth-config.js +0 -17
  179. package/test-cache-bust.sh +0 -43
  180. package/test-docs/README.md +0 -39
  181. package/test-html/404.html +0 -115
  182. package/test-html/README.html +0 -172
  183. package/test-html/auth.js +0 -97
  184. package/test-html/css/notion-style.css +0 -2036
  185. package/test-html/index.html +0 -172
  186. package/test-html/js/auth.js +0 -97
  187. package/test-html/js/main.js +0 -1485
  188. package/test-html/login.html +0 -102
  189. package/test-html/logout.html +0 -18
  190. package/update-domain.sql +0 -9
  191. package/user-access-view.sql +0 -49
  192. package/user-management/README.md +0 -301
  193. package/user-management/add-users.sh +0 -776
  194. package/user-management/create-user.js +0 -65
  195. package/user-management/users.txt +0 -15
  196. package/view-all-users.sql +0 -40
  197. package/wru-auth-config.js +0 -17
@@ -1,671 +0,0 @@
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="Transform @knowcode/doc-builder from basic client-side authentication to a sophisticated, centralized authentication system powered by Supabase that enables:">
7
- <title>Supabase Authentication Integration Plan for @k...</title>
8
-
9
- <meta name="author" content="Lindsay Smith">
10
- <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, authentication, security">
11
- <meta name="robots" content="index, follow">
12
- <link rel="canonical" href="https://doc-builder-delta.vercel.app/guides/supabase-auth-integration-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/guides/supabase-auth-integration-plan.html">
17
- <meta property="og:title" content="Supabase Authentication Integration Plan for @k...">
18
- <meta property="og:description" content="Transform @knowcode/doc-builder from basic client-side authentication to a sophisticated, centralized authentication system powered by Supabase that enables:">
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 Authentication Integration Plan for @k...">
28
- <meta name="twitter:description" content="Transform @knowcode/doc-builder from basic client-side authentication to a sophisticated, centralized authentication system powered by Supabase that enables:">
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 Authentication Integration Plan for @knowcode/doc-builder",
58
- "description": "Transform @knowcode/doc-builder from basic client-side authentication to a sophisticated, centralized authentication system powered by Supabase that enables:",
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-25T13:49:06.554Z",
69
- "dateModified": "2025-07-25T13:49:06.554Z",
70
- "mainEntityOfPage": {
71
- "@type": "WebPage",
72
- "@id": "https://doc-builder-delta.vercel.app/guides/supabase-auth-integration-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": "Guides",
87
- "item": "https://doc-builder-delta.vercel.app/guides/"
88
- },
89
- {
90
- "@type": "ListItem",
91
- "position": 3,
92
- "name": "Supabase Auth Integration Plan",
93
- "item": "https://doc-builder-delta.vercel.app/guides/supabase-auth-integration-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.7.5">Last updated: Jul 25, 2025, 01:49 PM 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 expanded" 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" 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="🚨 This authentication method has been REMOVED in version 2.0.0 due to serious security flaws."><i class="fas fa-file-alt"></i> Authentication Guide</a>
168
- <a href="/guides/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>
169
- <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>
170
- <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>
171
- <a href="/guides/next-steps-walkthrough.html" class="nav-item" 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>
172
- <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>
173
- <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>
174
- <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>
175
- <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>
176
- <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>
177
- <a href="/guides/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>
178
- <a href="/guides/supabase-auth-integration-plan.html" class="nav-item active" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Integration Plan</a>
179
- <a href="/guides/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder now supports enterprise-grade authentication through Supabase, replacing the previous insecure basic authentication."><i class="fas fa-file-alt"></i> Supabase Auth Setup Guide</a>
180
- <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>
181
- <a href="/guides/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>
182
- <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>
183
- <div class="nav-section" data-level="1">
184
- <a class="nav-title collapsible" href="/launch/README.html" data-target="nav-launch-1" >
185
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Launch
186
- </a>
187
- <div class="nav-content collapsed" id="nav-launch-1">
188
- <a href="/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>
189
- <a href="/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>
190
- <a href="/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>
191
- <a href="/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></div></div>
192
- </nav>
193
- <div class="resize-handle"></div>
194
- </aside>
195
-
196
- <!-- Content Area -->
197
- <main class="content">
198
- <div class="content-inner">
199
- <h1>Supabase Authentication Integration Plan for @knowcode/doc-builder</h1>
200
- <h2>Vision</h2>
201
- <p>Transform @knowcode/doc-builder from basic client-side authentication to a sophisticated, centralized authentication system powered by Supabase that enables:</p>
202
- <ul>
203
- <li><strong>Single Sign-On (SSO)</strong> across all deployed documentation sites</li>
204
- <li><strong>Multi-tenant support</strong> with fine-grained access control</li>
205
- <li><strong>Enterprise-grade security</strong> with JWT tokens and Row Level Security</li>
206
- <li><strong>Scalable user management</strong> for teams of any size</li>
207
- <li><strong>Audit logging</strong> for compliance and security</li>
208
- </ul>
209
- <h2>Architecture Overview</h2>
210
- <div class="mermaid-wrapper">
211
- <div class="mermaid">graph TB
212
- subgraph "Supabase Cloud"
213
- DB[(PostgreSQL)]
214
- AUTH[Auth Service]
215
- RLS[Row Level Security]
216
-
217
- DB --> |Protected by| RLS
218
- AUTH --> |Issues| JWT[JWT Tokens]
219
- end
220
-
221
- subgraph "Documentation Sites"
222
- Site1[docs.company1.com]
223
- Site2[docs.company2.com]
224
- Site3[internal.docs.com]
225
- end
226
-
227
- subgraph "Client Browser"
228
- SDK[Supabase JS SDK]
229
- Cookie[Secure Cookie]
230
- end
231
-
232
- AUTH --> SDK
233
- SDK --> Cookie
234
- Cookie --> Site1
235
- Cookie --> Site2
236
- Cookie --> Site3
237
-
238
- style AUTH fill:#4ade80
239
- style DB fill:#60a5fa
240
- style RLS fill:#f87171</div>
241
- </div>
242
- <h2>Database Schema</h2>
243
- <h3>Core Tables</h3>
244
- <pre><code class="language-sql">-- Organizations table
245
- CREATE TABLE organizations (
246
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
247
- name TEXT NOT NULL,
248
- slug TEXT UNIQUE NOT NULL,
249
- created_at TIMESTAMPTZ DEFAULT NOW(),
250
- settings JSONB DEFAULT &#39;{}&#39;::jsonb
251
- );
252
-
253
- -- Documentation sites table
254
- CREATE TABLE doc_sites (
255
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
256
- org_id UUID REFERENCES organizations(id),
257
- name TEXT NOT NULL,
258
- domain TEXT UNIQUE NOT NULL,
259
- config JSONB DEFAULT &#39;{}&#39;::jsonb,
260
- created_at TIMESTAMPTZ DEFAULT NOW(),
261
- is_active BOOLEAN DEFAULT true
262
- );
263
-
264
- -- User access table (many-to-many)
265
- CREATE TABLE user_site_access (
266
- user_id UUID REFERENCES auth.users(id),
267
- site_id UUID REFERENCES doc_sites(id),
268
- role TEXT NOT NULL DEFAULT &#39;viewer&#39;,
269
- granted_at TIMESTAMPTZ DEFAULT NOW(),
270
- granted_by UUID REFERENCES auth.users(id),
271
- expires_at TIMESTAMPTZ,
272
- PRIMARY KEY (user_id, site_id)
273
- );
274
-
275
- -- Access logs for audit trail
276
- CREATE TABLE access_logs (
277
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
278
- user_id UUID REFERENCES auth.users(id),
279
- site_id UUID REFERENCES doc_sites(id),
280
- action TEXT NOT NULL,
281
- metadata JSONB DEFAULT &#39;{}&#39;::jsonb,
282
- ip_address INET,
283
- user_agent TEXT,
284
- created_at TIMESTAMPTZ DEFAULT NOW()
285
- );
286
-
287
- -- Invitation links
288
- CREATE TABLE invitations (
289
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
290
- site_id UUID REFERENCES doc_sites(id),
291
- email TEXT NOT NULL,
292
- role TEXT NOT NULL DEFAULT &#39;viewer&#39;,
293
- token TEXT UNIQUE NOT NULL,
294
- created_by UUID REFERENCES auth.users(id),
295
- created_at TIMESTAMPTZ DEFAULT NOW(),
296
- expires_at TIMESTAMPTZ NOT NULL,
297
- claimed_at TIMESTAMPTZ,
298
- claimed_by UUID REFERENCES auth.users(id)
299
- );
300
- </code></pre>
301
- <h3>Row Level Security Policies</h3>
302
- <pre><code class="language-sql">-- Users can only see sites they have access to
303
- CREATE POLICY &quot;Users can view accessible sites&quot; ON doc_sites
304
- FOR SELECT USING (
305
- EXISTS (
306
- SELECT 1 FROM user_site_access
307
- WHERE site_id = doc_sites.id
308
- AND user_id = auth.uid()
309
- AND (expires_at IS NULL OR expires_at &gt; NOW())
310
- )
311
- );
312
-
313
- -- Access logs are append-only
314
- CREATE POLICY &quot;Insert access logs&quot; ON access_logs
315
- FOR INSERT WITH CHECK (user_id = auth.uid());
316
-
317
- -- Users can view their own access logs
318
- CREATE POLICY &quot;View own access logs&quot; ON access_logs
319
- FOR SELECT USING (user_id = auth.uid());
320
- </code></pre>
321
- <h2>Implementation Architecture</h2>
322
- <h3>1. Authentication Flow</h3>
323
- <div class="mermaid-wrapper">
324
- <div class="mermaid">sequenceDiagram
325
- participant User
326
- participant DocSite
327
- participant SupabaseSDK
328
- participant SupabaseAuth
329
- participant Database
330
-
331
- User->>DocSite: Visit protected page
332
- DocSite->>SupabaseSDK: Check session
333
-
334
- alt No valid session
335
- SupabaseSDK-->>DocSite: No session
336
- DocSite->>User: Redirect to login
337
- User->>DocSite: Enter credentials
338
- DocSite->>SupabaseAuth: signInWithPassword()
339
- SupabaseAuth->>Database: Verify credentials
340
- Database-->>SupabaseAuth: User data + access
341
- SupabaseAuth-->>DocSite: JWT token
342
- DocSite->>DocSite: Store in secure cookie
343
- end
344
-
345
- DocSite->>Database: Check site access
346
- Database-->>DocSite: Access granted/denied
347
-
348
- alt Access granted
349
- DocSite->>User: Show documentation
350
- DocSite->>Database: Log access
351
- else Access denied
352
- DocSite->>User: Show 403 error
353
- end</div>
354
- </div>
355
- <h3>2. Client-Side Implementation</h3>
356
- <pre><code class="language-javascript">// lib/supabase-auth.js
357
- import { createClient } from &#39;@supabase/supabase-js&#39;;
358
-
359
- class SupabaseAuthManager {
360
- constructor(config) {
361
- this.supabase = createClient(
362
- config.supabaseUrl,
363
- config.supabaseAnonKey,
364
- {
365
- auth: {
366
- persistSession: true,
367
- autoRefreshToken: true,
368
- detectSessionInUrl: true
369
- }
370
- }
371
- );
372
- this.siteId = config.siteId;
373
- }
374
-
375
- async checkAccess() {
376
- const { data: { user } } = await this.supabase.auth.getUser();
377
- if (!user) return false;
378
-
379
- const { data, error } = await this.supabase
380
- .from(&#39;user_site_access&#39;)
381
- .select(&#39;role, expires_at&#39;)
382
- .eq(&#39;user_id&#39;, user.id)
383
- .eq(&#39;site_id&#39;, this.siteId)
384
- .single();
385
-
386
- if (error || !data) return false;
387
- if (data.expires_at &amp;&amp; new Date(data.expires_at) &lt; new Date()) return false;
388
-
389
- // Log access
390
- await this.logAccess(&#39;page_view&#39;);
391
-
392
- return data;
393
- }
394
-
395
- async signIn(email, password) {
396
- const { data, error } = await this.supabase.auth.signInWithPassword({
397
- email,
398
- password
399
- });
400
-
401
- if (error) throw error;
402
-
403
- // Check if user has access to this site
404
- const access = await this.checkAccess();
405
- if (!access) {
406
- await this.supabase.auth.signOut();
407
- throw new Error(&#39;You do not have access to this documentation site&#39;);
408
- }
409
-
410
- return data;
411
- }
412
-
413
- async signInWithMagicLink(email) {
414
- const { error } = await this.supabase.auth.signInWithOtp({
415
- email,
416
- options: {
417
- emailRedirectTo: window.location.origin
418
- }
419
- });
420
-
421
- if (error) throw error;
422
- }
423
-
424
- async logAccess(action, metadata = {}) {
425
- await this.supabase.from(&#39;access_logs&#39;).insert({
426
- site_id: this.siteId,
427
- action,
428
- metadata,
429
- ip_address: await this.getClientIP(),
430
- user_agent: navigator.userAgent
431
- });
432
- }
433
- }
434
- </code></pre>
435
- <h3>3. Build-Time Integration</h3>
436
- <pre><code class="language-javascript">// lib/core-builder.js modifications
437
- async function buildWithSupabaseAuth(config) {
438
- if (config.features.authentication === &#39;supabase&#39;) {
439
- // Inject Supabase configuration
440
- const supabaseConfig = {
441
- supabaseUrl: config.auth.supabaseUrl,
442
- supabaseAnonKey: config.auth.supabaseAnonKey,
443
- siteId: config.auth.siteId
444
- };
445
-
446
- // Create enhanced auth.js with Supabase integration
447
- const authScript = generateSupabaseAuthScript(supabaseConfig);
448
- await fs.writeFile(
449
- path.join(outputDir, &#39;js&#39;, &#39;auth.js&#39;),
450
- authScript
451
- );
452
-
453
- // Create login page with Supabase UI
454
- const loginPage = generateSupabaseLoginPage(config);
455
- await fs.writeFile(
456
- path.join(outputDir, &#39;login.html&#39;),
457
- loginPage
458
- );
459
-
460
- // Add Supabase SDK to dependencies
461
- await injectSupabaseSDK(outputDir);
462
- }
463
- }
464
- </code></pre>
465
- <h2>Configuration Options</h2>
466
- <h3>Enhanced doc-builder.config.js</h3>
467
- <pre><code class="language-javascript">module.exports = {
468
- siteName: &#39;Internal Documentation&#39;,
469
-
470
- features: {
471
- authentication: &#39;supabase&#39;, // &#39;basic&#39; | &#39;supabase&#39; | false
472
- },
473
-
474
- auth: {
475
- // Supabase configuration
476
- supabaseUrl: process.env.SUPABASE_URL,
477
- supabaseAnonKey: process.env.SUPABASE_ANON_KEY,
478
- siteId: process.env.DOC_SITE_ID,
479
-
480
- // Optional: Custom login page styling
481
- loginTheme: {
482
- logo: &#39;/assets/logo.png&#39;,
483
- primaryColor: &#39;#4F46E5&#39;,
484
- backgroundImage: &#39;/assets/login-bg.jpg&#39;
485
- },
486
-
487
- // Optional: Authentication providers
488
- providers: [&#39;email&#39;, &#39;google&#39;, &#39;github&#39;],
489
-
490
- // Optional: Custom redirect after login
491
- redirectUrl: &#39;/&#39;,
492
-
493
- // Optional: Require email verification
494
- requireEmailVerification: false,
495
-
496
- // Optional: Session timeout (minutes)
497
- sessionTimeout: 1440, // 24 hours
498
-
499
- // Optional: Enable SSO
500
- sso: {
501
- enabled: true,
502
- domain: &#39;company.com&#39;
503
- }
504
- }
505
- };
506
- </code></pre>
507
- <h2>Migration Strategy</h2>
508
- <h3>Phase 1: Backward Compatibility (Week 1-2)</h3>
509
- <ol>
510
- <li>Add Supabase as optional authentication method</li>
511
- <li>Keep existing basic auth as default</li>
512
- <li>Allow configuration to choose auth type</li>
513
- <li>No breaking changes to existing deployments</li>
514
- </ol>
515
- <h3>Phase 2: Feature Parity (Week 3-4)</h3>
516
- <ol>
517
- <li>Implement core Supabase authentication</li>
518
- <li>Add login/logout pages with Supabase UI</li>
519
- <li>Implement access checking</li>
520
- <li>Add basic user management CLI commands</li>
521
- </ol>
522
- <h3>Phase 3: Advanced Features (Week 5-6)</h3>
523
- <ol>
524
- <li>Multi-site SSO support</li>
525
- <li>Role-based access control</li>
526
- <li>Invitation system</li>
527
- <li>Audit logging</li>
528
- <li>Admin dashboard</li>
529
- </ol>
530
- <h3>Phase 4: Migration Tools (Week 7-8)</h3>
531
- <ol>
532
- <li>Migration script from basic auth to Supabase</li>
533
- <li>Bulk user import</li>
534
- <li>Documentation and guides</li>
535
- <li>Deprecation notices for basic auth</li>
536
- </ol>
537
- <h2>CLI Commands</h2>
538
- <h3>New Authentication Commands</h3>
539
- <pre><code class="language-bash"># Initialize Supabase auth for a project
540
- npx @knowcode/doc-builder auth init
541
-
542
- # Add a user to documentation site
543
- npx @knowcode/doc-builder auth add-user email@example.com --role editor
544
-
545
- # Generate invitation link
546
- npx @knowcode/doc-builder auth invite email@example.com --expires 7d
547
-
548
- # List users with access
549
- npx @knowcode/doc-builder auth list-users
550
-
551
- # Revoke access
552
- npx @knowcode/doc-builder auth revoke email@example.com
553
-
554
- # View access logs
555
- npx @knowcode/doc-builder auth logs --days 30
556
- </code></pre>
557
- <h2>Security Benefits</h2>
558
- <h3>Current Basic Auth Vulnerabilities</h3>
559
- <ul>
560
- <li><i class="ph ph-x-circle" aria-label="error"></i> Credentials visible in browser</li>
561
- <li><i class="ph ph-x-circle" aria-label="error"></i> No password hashing</li>
562
- <li><i class="ph ph-x-circle" aria-label="error"></i> No session management</li>
563
- <li><i class="ph ph-x-circle" aria-label="error"></i> No audit trail</li>
564
- <li><i class="ph ph-x-circle" aria-label="error"></i> Single shared password</li>
565
- </ul>
566
- <h3>Supabase Auth Security</h3>
567
- <ul>
568
- <li><i class="ph ph-check-circle" aria-label="checked"></i> Server-side authentication</li>
569
- <li><i class="ph ph-check-circle" aria-label="checked"></i> Bcrypt password hashing</li>
570
- <li><i class="ph ph-check-circle" aria-label="checked"></i> JWT tokens with expiration</li>
571
- <li><i class="ph ph-check-circle" aria-label="checked"></i> Row Level Security</li>
572
- <li><i class="ph ph-check-circle" aria-label="checked"></i> Comprehensive audit logs</li>
573
- <li><i class="ph ph-check-circle" aria-label="checked"></i> Multi-factor authentication support</li>
574
- <li><i class="ph ph-check-circle" aria-label="checked"></i> OAuth provider support</li>
575
- </ul>
576
- <h2>Cost Analysis</h2>
577
- <h3>Supabase Free Tier</h3>
578
- <ul>
579
- <li>50,000 Monthly Active Users</li>
580
- <li>Unlimited authentication providers</li>
581
- <li>Row Level Security</li>
582
- <li>Real-time subscriptions</li>
583
- </ul>
584
- <h3>Estimated Usage</h3>
585
- <ul>
586
- <li>Small teams (&lt; 100 users): <strong>Free</strong></li>
587
- <li>Medium organizations (&lt; 5,000 users): <strong>Free</strong></li>
588
- <li>Large enterprises (&lt; 50,000 users): <strong>Free</strong></li>
589
- <li>Very large (&gt; 50,000 users): <strong>$25/month</strong> Pro tier</li>
590
- </ul>
591
- <h2>Implementation Timeline</h2>
592
- <h3>Week 1-2: Foundation</h3>
593
- <ul>
594
- <li><input disabled="" type="checkbox"> Add Supabase SDK integration</li>
595
- <li><input disabled="" type="checkbox"> Create database schema</li>
596
- <li><input disabled="" type="checkbox"> Implement basic auth flow</li>
597
- <li><input disabled="" type="checkbox"> Update configuration system</li>
598
- </ul>
599
- <h3>Week 3-4: Core Features</h3>
600
- <ul>
601
- <li><input disabled="" type="checkbox"> Build login/logout pages</li>
602
- <li><input disabled="" type="checkbox"> Implement access checking</li>
603
- <li><input disabled="" type="checkbox"> Add session management</li>
604
- <li><input disabled="" type="checkbox"> Create CLI commands</li>
605
- </ul>
606
- <h3>Week 5-6: Advanced Features</h3>
607
- <ul>
608
- <li><input disabled="" type="checkbox"> Multi-site SSO</li>
609
- <li><input disabled="" type="checkbox"> Role management</li>
610
- <li><input disabled="" type="checkbox"> Invitation system</li>
611
- <li><input disabled="" type="checkbox"> Audit logging</li>
612
- </ul>
613
- <h3>Week 7-8: Polish &amp; Migration</h3>
614
- <ul>
615
- <li><input disabled="" type="checkbox"> Migration tools</li>
616
- <li><input disabled="" type="checkbox"> Documentation</li>
617
- <li><input disabled="" type="checkbox"> Testing &amp; QA</li>
618
- <li><input disabled="" type="checkbox"> Release preparation</li>
619
- </ul>
620
- <h2>Benefits Summary</h2>
621
- <h3>For End Users</h3>
622
- <ul>
623
- <li><strong>Single Sign-On</strong>: One account for all documentation</li>
624
- <li><strong>Better Security</strong>: Enterprise-grade authentication</li>
625
- <li><strong>Password Recovery</strong>: Self-service password reset</li>
626
- <li><strong>OAuth Login</strong>: Sign in with Google/GitHub</li>
627
- </ul>
628
- <h3>For Administrators</h3>
629
- <ul>
630
- <li><strong>User Management</strong>: Add/remove users easily</li>
631
- <li><strong>Access Control</strong>: Fine-grained permissions</li>
632
- <li><strong>Audit Trail</strong>: Complete access history</li>
633
- <li><strong>Compliance</strong>: Meet security requirements</li>
634
- </ul>
635
- <h3>For Developers</h3>
636
- <ul>
637
- <li><strong>Easy Integration</strong>: Simple configuration</li>
638
- <li><strong>Extensible</strong>: Add custom auth logic</li>
639
- <li><strong>Well-Documented</strong>: Comprehensive guides</li>
640
- <li><strong>Open Source</strong>: Fully transparent</li>
641
- </ul>
642
- <h2>Next Steps</h2>
643
- <ol>
644
- <li><strong>Validate Architecture</strong>: Review with team</li>
645
- <li><strong>Create Prototype</strong>: Build proof of concept</li>
646
- <li><strong>Security Review</strong>: Audit implementation</li>
647
- <li><strong>Documentation</strong>: Write integration guides</li>
648
- <li><strong>Beta Testing</strong>: Deploy to test sites</li>
649
- <li><strong>Release</strong>: Publish new version</li>
650
- </ol>
651
- <h2>Conclusion</h2>
652
- <p>This Supabase integration transforms @knowcode/doc-builder from a basic documentation generator into an enterprise-ready documentation platform with professional authentication and access control. The centralized auth approach enables organizations to manage documentation access across multiple sites while maintaining security and compliance.</p>
653
-
654
- </div>
655
- </main>
656
- </div>
657
-
658
- <!-- Scripts -->
659
- <script>
660
- // Pass configuration to frontend
661
- window.docBuilderConfig = {
662
- features: {
663
- showPdfDownload: true,
664
- menuDefaultOpen: false
665
- }
666
- };
667
- </script>
668
- <script src="/js/main.js"></script>
669
-
670
- </body>
671
- </html>