@knowcode/doc-builder 1.7.4 → 1.7.6
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.
- package/.claude/settings.local.json +6 -1
- package/CHANGELOG.md +50 -0
- package/README.md +47 -7
- package/RELEASE-NOTES-1.7.5.md +64 -0
- package/add-user-clive.sql +35 -0
- package/add-user-lindsay-fixed.sql +85 -0
- package/add-user-lindsay.sql +68 -0
- package/add-user-pmorgan.sql +35 -0
- package/add-user-robbie.sql +35 -0
- package/add-wru-users.sql +105 -0
- package/cli.js +223 -8
- package/grant-access.sql +15 -0
- package/html/README.html +14 -4
- package/html/auth.js +97 -0
- package/html/documentation-index.html +14 -4
- package/html/guides/authentication-default-change.html +302 -0
- package/html/guides/authentication-guide.html +32 -14
- package/html/guides/cache-control-anti-pattern.html +361 -0
- package/html/guides/claude-workflow-guide.html +14 -4
- package/html/guides/documentation-standards.html +14 -4
- package/html/guides/next-steps-walkthrough.html +638 -0
- package/html/guides/phosphor-icons-guide.html +14 -4
- package/html/guides/public-site-deployment.html +363 -0
- package/html/guides/search-engine-verification-guide.html +14 -4
- package/html/guides/seo-guide.html +14 -4
- package/html/guides/seo-optimization-guide.html +14 -4
- package/html/guides/supabase-auth-implementation-plan.html +543 -0
- package/html/guides/supabase-auth-integration-plan.html +671 -0
- package/html/guides/supabase-auth-setup-guide.html +498 -0
- package/html/guides/troubleshooting-guide.html +14 -4
- package/html/guides/vercel-deployment-auth-setup.html +337 -0
- package/html/guides/windows-setup-guide.html +14 -4
- package/html/index.html +14 -4
- package/html/launch/README.html +14 -4
- package/html/launch/bubble-plugin-specification.html +14 -4
- package/html/launch/go-to-market-strategy.html +14 -4
- package/html/launch/launch-announcements.html +14 -4
- package/html/login.html +102 -0
- package/html/logout.html +18 -0
- package/html/sitemap.xml +69 -21
- package/html/vercel-cli-setup-guide.html +14 -4
- package/html/vercel-first-time-setup-guide.html +14 -4
- package/lib/config.js +33 -29
- package/lib/core-builder.js +142 -88
- package/lib/supabase-auth.js +295 -0
- package/manage-users.sql +191 -0
- package/package.json +2 -1
- package/public-config.js +22 -0
- package/public-html/404.html +115 -0
- package/public-html/README.html +149 -0
- package/public-html/css/notion-style.css +2036 -0
- package/public-html/index.html +149 -0
- package/public-html/js/main.js +1485 -0
- package/quick-test-commands.md +40 -0
- package/recordings/Screenshot 2025-07-24 at 18.22.01.png +0 -0
- package/setup-database.sql +41 -0
- package/test-auth-config.js +17 -0
- package/test-docs/README.md +39 -0
- package/test-html/404.html +115 -0
- package/test-html/README.html +172 -0
- package/test-html/auth.js +97 -0
- package/test-html/css/notion-style.css +2036 -0
- package/test-html/index.html +172 -0
- package/test-html/js/auth.js +97 -0
- package/test-html/js/main.js +1485 -0
- package/test-html/login.html +102 -0
- package/test-html/logout.html +18 -0
- package/update-domain.sql +9 -0
- package/view-all-users.sql +40 -0
- package/wru-auth-config.js +17 -0
- /package/{assets → public-html}/js/auth.js +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
<title>Login - Test Documentation</title>
|
|
7
|
+
<link rel="stylesheet" href="css/notion-style.css">
|
|
8
|
+
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body class="auth-page">
|
|
11
|
+
<div class="auth-container">
|
|
12
|
+
<div class="auth-box">
|
|
13
|
+
<h1>Login to Test Documentation</h1>
|
|
14
|
+
<form id="login-form">
|
|
15
|
+
<div class="form-group">
|
|
16
|
+
<label for="email">Email</label>
|
|
17
|
+
<input type="email" id="email" name="email" required>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="form-group">
|
|
20
|
+
<label for="password">Password</label>
|
|
21
|
+
<input type="password" id="password" name="password" required>
|
|
22
|
+
</div>
|
|
23
|
+
<button type="submit" class="auth-button">Login</button>
|
|
24
|
+
</form>
|
|
25
|
+
<div id="error-message" class="error-message"></div>
|
|
26
|
+
<div class="auth-links">
|
|
27
|
+
<a href="#" id="forgot-password">Forgot Password?</a>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
// Initialize Supabase
|
|
34
|
+
const { createClient } = supabase;
|
|
35
|
+
const supabaseClient = createClient('https://xcihhnfcitjrwbynxmka.supabase.co', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY');
|
|
36
|
+
|
|
37
|
+
// Handle login form
|
|
38
|
+
document.getElementById('login-form').addEventListener('submit', async function(e) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
|
|
41
|
+
const email = document.getElementById('email').value;
|
|
42
|
+
const password = document.getElementById('password').value;
|
|
43
|
+
const errorDiv = document.getElementById('error-message');
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
// Sign in with Supabase
|
|
47
|
+
const { data, error } = await supabaseClient.auth.signInWithPassword({
|
|
48
|
+
email: email,
|
|
49
|
+
password: password
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (error) throw error;
|
|
53
|
+
|
|
54
|
+
// Check if user has access to this site
|
|
55
|
+
const { data: access, error: accessError } = await supabaseClient
|
|
56
|
+
.from('docbuilder_access')
|
|
57
|
+
.select('*')
|
|
58
|
+
.eq('user_id', data.user.id)
|
|
59
|
+
.eq('site_id', '4d8a53bf-dcdd-48c0-98e0-cd1451518735')
|
|
60
|
+
.single();
|
|
61
|
+
|
|
62
|
+
if (accessError || !access) {
|
|
63
|
+
await supabaseClient.auth.signOut();
|
|
64
|
+
throw new Error('You do not have access to this documentation site');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Redirect to requested page
|
|
68
|
+
const params = new URLSearchParams(window.location.search);
|
|
69
|
+
const redirect = params.get('redirect') || '/';
|
|
70
|
+
window.location.href = redirect;
|
|
71
|
+
|
|
72
|
+
} catch (error) {
|
|
73
|
+
errorDiv.textContent = error.message;
|
|
74
|
+
errorDiv.style.display = 'block';
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Handle forgot password
|
|
79
|
+
document.getElementById('forgot-password').addEventListener('click', async function(e) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
|
|
82
|
+
const email = document.getElementById('email').value;
|
|
83
|
+
if (!email) {
|
|
84
|
+
alert('Please enter your email address first');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const { error } = await supabaseClient.auth.resetPasswordForEmail(email, {
|
|
90
|
+
redirectTo: window.location.origin + '/login.html'
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (error) throw error;
|
|
94
|
+
|
|
95
|
+
alert('Password reset email sent! Check your inbox.');
|
|
96
|
+
} catch (error) {
|
|
97
|
+
alert('Error sending reset email: ' + error.message);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
101
|
+
</body>
|
|
102
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
<title>Logged Out - Test Documentation</title>
|
|
7
|
+
<link rel="stylesheet" href="css/notion-style.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body class="auth-page">
|
|
10
|
+
<div class="auth-container">
|
|
11
|
+
<div class="auth-box">
|
|
12
|
+
<h1>You have been logged out</h1>
|
|
13
|
+
<p>Thank you for using Test Documentation.</p>
|
|
14
|
+
<a href="login.html" class="auth-button">Login Again</a>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Update domain for Vercel deployment
|
|
2
|
+
UPDATE docbuilder_sites
|
|
3
|
+
SET domain = 'doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app'
|
|
4
|
+
WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
|
|
5
|
+
|
|
6
|
+
-- Verify the update
|
|
7
|
+
SELECT id, domain, name
|
|
8
|
+
FROM docbuilder_sites
|
|
9
|
+
WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
-- =====================================================
|
|
2
|
+
-- VIEW ALL USERS WITH ACCESS
|
|
3
|
+
-- Site: https://wru-bid-analysis.vercel.app/
|
|
4
|
+
-- =====================================================
|
|
5
|
+
|
|
6
|
+
-- See everyone who has access to the WRU site
|
|
7
|
+
SELECT
|
|
8
|
+
u.email,
|
|
9
|
+
u.created_at as user_created,
|
|
10
|
+
da.created_at as access_granted,
|
|
11
|
+
CASE
|
|
12
|
+
WHEN u.last_sign_in_at IS NULL THEN '❌ Never logged in'
|
|
13
|
+
ELSE '✅ Has logged in'
|
|
14
|
+
END as login_status,
|
|
15
|
+
u.last_sign_in_at
|
|
16
|
+
FROM docbuilder_access da
|
|
17
|
+
JOIN auth.users u ON u.id = da.user_id
|
|
18
|
+
WHERE da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
|
|
19
|
+
ORDER BY da.created_at DESC;
|
|
20
|
+
|
|
21
|
+
-- Count total users with access
|
|
22
|
+
SELECT COUNT(*) as total_users_with_access
|
|
23
|
+
FROM docbuilder_access
|
|
24
|
+
WHERE site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
|
|
25
|
+
|
|
26
|
+
-- Check which of the 4 users exist in Supabase
|
|
27
|
+
SELECT
|
|
28
|
+
email,
|
|
29
|
+
CASE
|
|
30
|
+
WHEN id IS NOT NULL THEN '✅ User exists'
|
|
31
|
+
ELSE '❌ Not created yet'
|
|
32
|
+
END as status
|
|
33
|
+
FROM (
|
|
34
|
+
VALUES
|
|
35
|
+
('lindsay@knowcode.tech'),
|
|
36
|
+
('pmorgan@wru.cymru'),
|
|
37
|
+
('clive@hyperforma.co.uk'),
|
|
38
|
+
('robbie.macintosh@marbledropper.com')
|
|
39
|
+
) AS emails(email)
|
|
40
|
+
LEFT JOIN auth.users u ON u.email = emails.email;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// doc-builder.config.js - Configuration with Supabase Authentication
|
|
2
|
+
module.exports = {
|
|
3
|
+
siteName: 'WRU Bid Analysis Documentation',
|
|
4
|
+
siteDescription: 'Analysis and documentation for WRU bidding process',
|
|
5
|
+
|
|
6
|
+
// Enable Supabase authentication
|
|
7
|
+
features: {
|
|
8
|
+
authentication: 'supabase' // This turns on auth (set to false for public)
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
// Supabase configuration
|
|
12
|
+
auth: {
|
|
13
|
+
supabaseUrl: 'https://xcihhnfcitjrwbynxmka.supabase.co',
|
|
14
|
+
supabaseAnonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY',
|
|
15
|
+
siteId: '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
File without changes
|