feat: serve site content from Appwrite TablesDB with .md fallback
Replace astro:content getCollection() reads in all 9 content pages with src/lib/content-source.ts: Appwrite TablesDB (spaghet-home database on appwrite.spaghet.io) first, bundled src/content/*.md fallback on a cold-cache outage. Blog/project/legal detail pages flip from prerender to SSR (content now arrives at request time); sitemap keeps every detail URL via customPages computed from the bundled .md copies. - src/lib/appwrite.ts: TablesDB service (node-appwrite), markdown rendered through Astro's own satteri+shiki pipeline (dual-theme, same config as astro.config.mjs) — article HTML verified byte-identical to production. Public reads: tables grant read(any), no secret required. 60s in-process cache, stale-serving on refresh failure. - src/lib/__tests__/appwrite.test.ts: 11 tests mocking the SDK boundary (the SDK binds its own fetch, so global stubs do not intercept it). - Draft posts now 302 to /blog and drop off listings/RSS/search at request time instead of at build time. - astro check: 0 errors; vitest: 94 pass; build clean; end-to-end verified against live Appwrite and against a forced outage.
This commit is contained in:
1 parent
2b775cbf99
commit
80577d6404
17 files changed
+872
-131
No files matched your search
Generated
+42
@@ -9,6 +9,7 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.10",
|
||||
"@astrojs/markdown-satteri": "^0.4.3",
|
||||
"@astrojs/mdx": "^8.0.3",
|
||||
"@astrojs/node": "^11.1.7",
|
||||
"@astrojs/rss": "^4.0.19",
|
||||
@@ -20,6 +21,7 @@
|
||||
"astro": "^7.3.8",
|
||||
"clsx": "^2.1.0",
|
||||
"fuse.js": "^7.0.0",
|
||||
"node-appwrite": "^32.4.0",
|
||||
"notenv": "^2.0.3",
|
||||
"rehype-stringify": "^10.0.1",
|
||||
"remark": "^15.0.1",
|
||||
@@ -3246,6 +3248,15 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/bignumber.js": {
|
||||
"version": "9.3.1",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
|
||||
"integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/boolbase": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
||||
@@ -4324,6 +4335,15 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/json-bigint": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
|
||||
"integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bignumber.js": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
@@ -5284,6 +5304,28 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/node-appwrite": {
|
||||
"version": "32.4.0",
|
||||
"resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-32.4.0.tgz",
|
||||
"integrity": "sha512-m+NeMSCpqE8Vfe6rBQvOnzL+X7aEahizG60I2TdKQK7jHzVIKnlhgOfSAW8z87/fi5qp/bks5GHC8kdpehsMjQ==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"json-bigint": "1.0.0",
|
||||
"undici": "^6.27.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-appwrite/node_modules/undici": {
|
||||
"version": "6.29.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",
|
||||
"integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch-native": {
|
||||
"version": "1.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz",
|
||||
|
||||
Reference in new issue
Block a user