chore: dump demo data

Login on the demo instance is SSO-only, so visitors always arrive as a
fresh user and consume seed content through Explore. Rebuild the seed
around that funnel: four personas (steven the maintainer, alice, ben,
zoe), a public feed mixing short captures with long-form anchors, and
protected memos that visibly appear after sign-in to teach the
visibility model.

Every headline feature is now demonstrated: nested tags, memo
references, comments with mentions, reactions, locations, a database-
stored image attachment, and a rendering test memo covering math,
mermaid, code, tables, and task lists.
This commit is contained in:
boojack
2026-07-17 00:14:01 +08:00
parent d4b5a1695b
commit 469c995cc0
4 changed files with 204 additions and 52 deletions
-1
View File
@@ -48,7 +48,6 @@ Don't want to install yet? Try our [live demo](https://demo.usememos.com/) first
### Other Installation Methods
- **Docker Compose** - Recommended for production deployments
- **Pre-built Binaries** - Available for Linux, macOS, and Windows
- **Kubernetes** - Helm charts and manifests available
- **Build from Source** - For development and customization
+8 -8
View File
@@ -46,20 +46,20 @@ func TestDemoSeedUsesDeploymentAuthenticationPolicy(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, provider)
demoUsername := "demo"
demoUser, err := stores.GetUser(ctx, &store.FindUser{Username: &demoUsername})
adminUsername := "steven"
adminUser, err := stores.GetUser(ctx, &store.FindUser{Username: &adminUsername})
require.NoError(t, err)
require.NotNil(t, demoUser)
require.Equal(t, store.RoleAdmin, demoUser.Role)
require.Error(t, bcrypt.CompareHashAndPassword([]byte(demoUser.PasswordHash), []byte("demo")))
demoCost, err := bcrypt.Cost([]byte(demoUser.PasswordHash))
require.NotNil(t, adminUser)
require.Equal(t, store.RoleAdmin, adminUser.Role)
require.Error(t, bcrypt.CompareHashAndPassword([]byte(adminUser.PasswordHash), []byte("demo")))
adminCost, err := bcrypt.Cost([]byte(adminUser.PasswordHash))
require.NoError(t, err)
require.GreaterOrEqual(t, demoCost, 12)
require.GreaterOrEqual(t, adminCost, 12)
aliceUsername := "alice"
aliceUser, err := stores.GetUser(ctx, &store.FindUser{Username: &aliceUsername})
require.NoError(t, err)
require.NotNil(t, aliceUser)
require.Error(t, bcrypt.CompareHashAndPassword([]byte(aliceUser.PasswordHash), []byte("demo")))
require.NotEqual(t, demoUser.PasswordHash, aliceUser.PasswordHash)
require.NotEqual(t, adminUser.PasswordHash, aliceUser.PasswordHash)
}
File diff suppressed because one or more lines are too long
@@ -50,13 +50,20 @@ export const MermaidBlock = ({ children, className }: MermaidBlockProps) => {
const renderDiagram = async () => {
try {
const { default: mermaid } = await import("mermaid");
// Text is measured against the final glyphs, so webfonts must be loaded
// first. The Font Loading API is absent in some environments (jsdom).
await document.fonts?.ready;
if (cancelled) return;
mermaid.initialize({
startOnLoad: false,
theme: toMermaidTheme(currentTheme),
securityLevel: "strict",
fontFamily: "inherit",
// Mermaid measures labels in a detached element at body level, but the
// rendered SVG lands inside a <pre> (monospace). "inherit" resolves to
// different fonts in those two places, sizing boxes too small for the
// final glyphs — pin the font so measurement and display agree.
fontFamily: getComputedStyle(document.body).fontFamily || "sans-serif",
suppressErrorRendering: true,
});