@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,498 +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="Complete guide for setting up secure authentication for your @knowcode/doc-builder documentation sites using Supabase.">
7
- <title>Supabase Authentication Setup Guide | @knowcode/doc-builder</title>
8
-
9
- <meta name="author" content="Lindsay Smith">
10
- <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, supabase, your">
11
- <meta name="robots" content="index, follow">
12
- <link rel="canonical" href="https://doc-builder-delta.vercel.app/guides/supabase-auth-setup-guide.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-setup-guide.html">
17
- <meta property="og:title" content="Supabase Authentication Setup Guide | @knowcode/doc-builder">
18
- <meta property="og:description" content="Complete guide for setting up secure authentication for your @knowcode/doc-builder documentation sites using Supabase.">
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 Setup Guide | @knowcode/doc-builder">
28
- <meta name="twitter:description" content="Complete guide for setting up secure authentication for your @knowcode/doc-builder documentation sites using Supabase.">
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 Setup Guide",
58
- "description": "Complete guide for setting up secure authentication for your @knowcode/doc-builder documentation sites using Supabase.",
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.556Z",
69
- "dateModified": "2025-07-25T13:49:06.556Z",
70
- "mainEntityOfPage": {
71
- "@type": "WebPage",
72
- "@id": "https://doc-builder-delta.vercel.app/guides/supabase-auth-setup-guide.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 Setup Guide",
93
- "item": "https://doc-builder-delta.vercel.app/guides/supabase-auth-setup-guide.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" 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 active" 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 Setup Guide</h1>
200
- <p>Complete guide for setting up secure authentication for your @knowcode/doc-builder documentation sites using Supabase.</p>
201
- <h2>Overview</h2>
202
- <p>@knowcode/doc-builder now supports enterprise-grade authentication through Supabase, replacing the previous insecure basic authentication. This provides:</p>
203
- <ul>
204
- <li><strong>Secure authentication</strong> with industry-standard security practices</li>
205
- <li><strong>Multi-site support</strong> - one account can access multiple documentation sites</li>
206
- <li><strong>User management</strong> through CLI commands</li>
207
- <li><strong>Password reset</strong> functionality built-in</li>
208
- <li><strong>Enterprise features</strong> like audit logging and access control</li>
209
- </ul>
210
- <h2>Prerequisites</h2>
211
- <ol>
212
- <li><strong>Supabase Account</strong>: Create a free account at <a href="https://supabase.com">supabase.com</a></li>
213
- <li><strong>Node.js 14+</strong>: Required for @knowcode/doc-builder</li>
214
- <li><strong>Basic SQL knowledge</strong>: For database setup</li>
215
- </ol>
216
- <h2>Step 1: Create Supabase Project</h2>
217
- <ol>
218
- <li>Go to <a href="https://app.supabase.com">app.supabase.com</a></li>
219
- <li>Click &quot;New Project&quot;</li>
220
- <li>Choose your organization</li>
221
- <li>Enter project name and database password</li>
222
- <li>Select a region close to your users</li>
223
- <li>Click &quot;Create new project&quot;</li>
224
- </ol>
225
- <p>Wait for the project to be created (usually 1-2 minutes).</p>
226
- <h2>Step 2: Create Database Tables</h2>
227
- <p>In your Supabase dashboard, go to <strong>SQL Editor</strong> and run this SQL:</p>
228
- <pre><code class="language-sql">-- Table 1: Documentation sites
229
- CREATE TABLE docbuilder_sites (
230
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
231
- domain TEXT UNIQUE NOT NULL,
232
- name TEXT NOT NULL,
233
- created_at TIMESTAMPTZ DEFAULT NOW()
234
- );
235
-
236
- -- Table 2: User access mapping
237
- CREATE TABLE docbuilder_access (
238
- user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
239
- site_id UUID REFERENCES docbuilder_sites(id) ON DELETE CASCADE,
240
- created_at TIMESTAMPTZ DEFAULT NOW(),
241
- PRIMARY KEY (user_id, site_id)
242
- );
243
-
244
- -- Enable Row Level Security
245
- ALTER TABLE docbuilder_sites ENABLE ROW LEVEL SECURITY;
246
- ALTER TABLE docbuilder_access ENABLE ROW LEVEL SECURITY;
247
-
248
- -- RLS Policy: Users can only see sites they have access to
249
- CREATE POLICY &quot;Users see accessible sites&quot; ON docbuilder_sites
250
- FOR SELECT USING (
251
- EXISTS (
252
- SELECT 1 FROM docbuilder_access
253
- WHERE site_id = docbuilder_sites.id
254
- AND user_id = auth.uid()
255
- )
256
- );
257
-
258
- -- RLS Policy: Users can see their own access
259
- CREATE POLICY &quot;Users see own access&quot; ON docbuilder_access
260
- FOR SELECT USING (user_id = auth.uid());
261
- </code></pre>
262
- <h2>Step 3: Get Supabase Credentials</h2>
263
- <ol>
264
- <li>In your Supabase dashboard, go to <strong>Settings</strong> → <strong>API</strong></li>
265
- <li>Copy these values:<ul>
266
- <li><strong>Project URL</strong> (looks like <code>https://xxx.supabase.co</code>)</li>
267
- <li><strong>Anon/Public Key</strong> (starts with <code>eyJ...</code>)</li>
268
- </ul>
269
- </li>
270
- </ol>
271
- <p><i class="ph ph-warning-circle" aria-label="warning"></i> <strong>Never share your service role key</strong> - only use the anon/public key for doc-builder.</p>
272
- <h2>Step 4: Initialize Authentication</h2>
273
- <p>Run the initialization command in your documentation project:</p>
274
- <pre><code class="language-bash">npx @knowcode/doc-builder auth:init
275
- </code></pre>
276
- <p>This will prompt you for:</p>
277
- <ul>
278
- <li>Your Supabase project URL</li>
279
- <li>Your Supabase anonymous key </li>
280
- <li>A name for your documentation site</li>
281
- </ul>
282
- <p>It creates a <code>doc-builder.config.js</code> file like this:</p>
283
- <pre><code class="language-javascript">module.exports = {
284
- siteName: &#39;My Documentation&#39;,
285
-
286
- features: {
287
- authentication: &#39;supabase&#39;
288
- },
289
-
290
- auth: {
291
- supabaseUrl: &#39;https://xxx.supabase.co&#39;,
292
- supabaseAnonKey: &#39;eyJ...&#39;,
293
- siteId: &#39;&#39; // Will be set in next step
294
- }
295
- };
296
- </code></pre>
297
- <h2>Step 5: Add Your Site to Database</h2>
298
- <h3>Option A: Using SQL (Recommended)</h3>
299
- <p>In Supabase SQL Editor, run:</p>
300
- <pre><code class="language-sql">INSERT INTO docbuilder_sites (domain, name)
301
- VALUES (&#39;docs.yourcompany.com&#39;, &#39;Company Documentation&#39;)
302
- RETURNING id;
303
- </code></pre>
304
- <p>Copy the returned ID and update your config file&#39;s <code>siteId</code> field.</p>
305
- <h3>Option B: Using CLI (Coming Soon)</h3>
306
- <pre><code class="language-bash">npx @knowcode/doc-builder auth:add-site \
307
- --domain docs.yourcompany.com \
308
- --name &quot;Company Documentation&quot;
309
- </code></pre>
310
- <h2>Step 6: Create Your First User</h2>
311
- <h3>Method 1: Through Supabase Dashboard</h3>
312
- <ol>
313
- <li>Go to <strong>Authentication</strong> → <strong>Users</strong> in Supabase</li>
314
- <li>Click &quot;Add User&quot;</li>
315
- <li>Enter email and password</li>
316
- <li>Click &quot;Create User&quot;</li>
317
- <li>Copy the user ID from the users table</li>
318
- </ol>
319
- <h3>Method 2: Through Your App (Recommended)</h3>
320
- <p>Users can sign up when they visit your documentation site and try to log in.</p>
321
- <h2>Step 7: Grant User Access</h2>
322
- <h3>Using SQL:</h3>
323
- <pre><code class="language-sql">-- Replace with actual user ID and site ID
324
- INSERT INTO docbuilder_access (user_id, site_id)
325
- VALUES (&#39;user-uuid-here&#39;, &#39;site-uuid-here&#39;);
326
- </code></pre>
327
- <h3>Using CLI (Coming Soon):</h3>
328
- <pre><code class="language-bash">npx @knowcode/doc-builder auth:grant \
329
- --email user@example.com \
330
- --site-id your-site-uuid
331
- </code></pre>
332
- <h2>Step 8: Build and Deploy</h2>
333
- <pre><code class="language-bash"># Build with Supabase authentication
334
- npx @knowcode/doc-builder build
335
-
336
- # Deploy to Vercel
337
- npx @knowcode/doc-builder deploy
338
- </code></pre>
339
- <p>Your documentation site now has secure authentication! <i class="ph ph-confetti" aria-label="party"></i></p>
340
- <h2>User Management</h2>
341
- <h3>List Users with Access</h3>
342
- <pre><code class="language-sql">SELECT u.email, da.created_at as granted_at
343
- FROM docbuilder_access da
344
- JOIN auth.users u ON u.id = da.user_id
345
- WHERE da.site_id = &#39;your-site-id&#39;;
346
- </code></pre>
347
- <h3>Revoke Access</h3>
348
- <pre><code class="language-sql">DELETE FROM docbuilder_access
349
- WHERE user_id = (SELECT id FROM auth.users WHERE email = &#39;user@example.com&#39;)
350
- AND site_id = &#39;your-site-id&#39;;
351
- </code></pre>
352
- <h3>Reset User Password</h3>
353
- <p>Users can reset their own passwords through the login page &quot;Forgot Password&quot; link.</p>
354
- <h2>Environment Variables (Optional)</h2>
355
- <p>For better security, use environment variables:</p>
356
- <pre><code class="language-bash"># .env
357
- SUPABASE_URL=https://xxx.supabase.co
358
- SUPABASE_ANON_KEY=eyJ...
359
- DOC_SITE_ID=your-site-uuid
360
- </code></pre>
361
- <p>Update your config:</p>
362
- <pre><code class="language-javascript">module.exports = {
363
- auth: {
364
- supabaseUrl: process.env.SUPABASE_URL,
365
- supabaseAnonKey: process.env.SUPABASE_ANON_KEY,
366
- siteId: process.env.DOC_SITE_ID
367
- }
368
- };
369
- </code></pre>
370
- <h2>Multi-Site Setup</h2>
371
- <p>To use one Supabase project for multiple documentation sites:</p>
372
- <ol>
373
- <li>Add each site to the database:</li>
374
- </ol>
375
- <pre><code class="language-sql">INSERT INTO docbuilder_sites (domain, name) VALUES
376
- (&#39;docs.product1.com&#39;, &#39;Product 1 Docs&#39;),
377
- (&#39;internal.company.com&#39;, &#39;Internal Docs&#39;),
378
- (&#39;api.company.com&#39;, &#39;API Documentation&#39;);
379
- </code></pre>
380
- <ol start="2">
381
- <li><p>Create separate config files for each site with different <code>siteId</code> values</p>
382
- </li>
383
- <li><p>Grant users access to specific sites:</p>
384
- </li>
385
- </ol>
386
- <pre><code class="language-sql">-- User can access both Product 1 and Internal docs
387
- INSERT INTO docbuilder_access (user_id, site_id) VALUES
388
- (&#39;user-uuid&#39;, &#39;product1-site-uuid&#39;),
389
- (&#39;user-uuid&#39;, &#39;internal-site-uuid&#39;);
390
- </code></pre>
391
- <h2>Security Features</h2>
392
- <h3>What Supabase Provides</h3>
393
- <ul>
394
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Password hashing</strong> with bcrypt</li>
395
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>JWT tokens</strong> with automatic refresh</li>
396
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Session management</strong> with secure cookies</li>
397
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Rate limiting</strong> on authentication endpoints</li>
398
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Email verification</strong> (optional)</li>
399
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Password reset</strong> flows</li>
400
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <strong>Multi-factor authentication</strong> (optional)</li>
401
- </ul>
402
- <h3>Row Level Security</h3>
403
- <p>All data access is protected by RLS policies:</p>
404
- <ul>
405
- <li>Users can only see sites they have access to</li>
406
- <li>Users can only see their own access records</li>
407
- <li>No way to access other users&#39; data</li>
408
- </ul>
409
- <h2>Troubleshooting</h2>
410
- <h3>&quot;Invalid JWT&quot; Errors</h3>
411
- <ul>
412
- <li>Check that your Supabase URL and anon key are correct</li>
413
- <li>Ensure you&#39;re using the anon key, not the service role key</li>
414
- <li>Clear browser cookies and try again</li>
415
- </ul>
416
- <h3>Users Can&#39;t Access Site</h3>
417
- <ul>
418
- <li>Verify the user exists in <code>auth.users</code> table</li>
419
- <li>Check that user has access in <code>docbuilder_access</code> table </li>
420
- <li>Confirm the <code>site_id</code> matches your config</li>
421
- </ul>
422
- <h3>Login Page Not Working</h3>
423
- <ul>
424
- <li>Check browser console for JavaScript errors</li>
425
- <li>Verify Supabase credentials in generated HTML</li>
426
- <li>Ensure Supabase project is not paused</li>
427
- </ul>
428
- <h3>Build Errors</h3>
429
- <ul>
430
- <li>Run <code>npm install @supabase/supabase-js</code> if missing</li>
431
- <li>Check that config file has all required fields</li>
432
- <li>Validate Supabase URL format (must be <a href="https://xxx.supabase.co">https://xxx.supabase.co</a>)</li>
433
- </ul>
434
- <h2>Migration from Basic Auth</h2>
435
- <p>If you were using the old basic authentication:</p>
436
- <ol>
437
- <li><strong>Update config</strong> - Remove <code>username</code>/<code>password</code>, add Supabase fields</li>
438
- <li><strong>Create users</strong> - Add your team members to Supabase</li>
439
- <li><strong>Grant access</strong> - Give users access to your sites</li>
440
- <li><strong>Update deployments</strong> - Rebuild and redeploy your documentation</li>
441
- </ol>
442
- <p>The old basic auth has been completely removed for security reasons.</p>
443
- <h2>Advanced Configuration</h2>
444
- <h3>Custom Login Styling</h3>
445
- <p>Customize the login page by modifying the generated CSS:</p>
446
- <pre><code class="language-css">.auth-container {
447
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
448
- }
449
-
450
- .auth-box {
451
- backdrop-filter: blur(10px);
452
- border: 1px solid rgba(255,255,255,0.1);
453
- }
454
- </code></pre>
455
- <h3>OAuth Providers</h3>
456
- <p>Enable social login in Supabase:</p>
457
- <ol>
458
- <li>Go to <strong>Authentication</strong> → <strong>Providers</strong></li>
459
- <li>Enable Google, GitHub, etc.</li>
460
- <li>Configure OAuth settings</li>
461
- <li>Users can then sign in with social accounts</li>
462
- </ol>
463
- <p>No changes needed in doc-builder - it automatically supports all Supabase auth providers.</p>
464
- <h2>Support</h2>
465
- <ul>
466
- <li><strong>Documentation Issues</strong>: <a href="https://github.com/wapdat/doc-builder/issues">GitHub Issues</a></li>
467
- <li><strong>Supabase Help</strong>: <a href="https://supabase.com/docs">Supabase Docs</a></li>
468
- <li><strong>Authentication Guides</strong>: <a href="https://supabase.com/docs/guides/auth">Supabase Auth</a></li>
469
- </ul>
470
- <h2>Summary</h2>
471
- <p>You now have secure, enterprise-grade authentication for your documentation! Key benefits:</p>
472
- <ol>
473
- <li><strong>No more client-side credentials</strong> - everything is server-validated</li>
474
- <li><strong>Multi-site support</strong> - one account for all your docs</li>
475
- <li><strong>Professional features</strong> - password reset, session management</li>
476
- <li><strong>Scalable</strong> - handles teams of any size</li>
477
- <li><strong>Free tier</strong> - supports up to 50,000 monthly active users</li>
478
- </ol>
479
- <p>Your documentation is now properly secured while maintaining the simplicity that makes @knowcode/doc-builder great to use.</p>
480
-
481
- </div>
482
- </main>
483
- </div>
484
-
485
- <!-- Scripts -->
486
- <script>
487
- // Pass configuration to frontend
488
- window.docBuilderConfig = {
489
- features: {
490
- showPdfDownload: true,
491
- menuDefaultOpen: false
492
- }
493
- };
494
- </script>
495
- <script src="/js/main.js"></script>
496
-
497
- </body>
498
- </html>