|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import { PageHero } from '@/components/site/page-hero'; |
| 4 | +import { Section, FadeIn } from '@/components/site/section'; |
| 5 | +import { motion } from 'framer-motion'; |
| 6 | +import { FileCode2, GitBranch, Database, MonitorSmartphone, Cpu, CheckCircle2, ArrowRight } from 'lucide-react'; |
| 7 | + |
| 8 | +const stages = [ |
| 9 | + { icon: FileCode2, label: 'Watcher (Chokidar)', description: 'Observes filesystem events without altering code', color: 'text-primary' }, |
| 10 | + { icon: GitBranch, label: 'Transaction Manager', description: 'Groups edits with adaptive cooldown (default 20000ms)', color: 'text-warning' }, |
| 11 | + { icon: Cpu, label: 'Engineering Compiler', description: 'Sole writer of Engineering Memory & AST symbols', color: 'text-primary' }, |
| 12 | + { icon: Database, label: 'SQLite Index', description: 'Single source of truth (.devmemory/index.db)', color: 'text-success' }, |
| 13 | + { icon: MonitorSmartphone, label: 'Embedded Dashboard', description: 'Renders UI on port 31415 via Runtime API', color: 'text-primary' }, |
| 14 | + { icon: ArrowRight, label: 'CLI & Agents', description: 'Queries memory via dmai ask and dmai summary', color: 'text-success' }, |
| 15 | +]; |
| 16 | + |
| 17 | +export default function ArchitecturePage() { |
| 18 | + return ( |
| 19 | + <> |
| 20 | + <PageHero |
| 21 | + label="Canonical Architecture — v1.0.0" |
| 22 | + title={<>System Architecture <span className="text-muted-foreground">& Pipeline</span></>} |
| 23 | + description="DevMemory AI v1.0.0 is built on a single Runtime orchestrator. Learn how file changes move from Watcher to Engineering Compiler to SQLite Index." |
| 24 | + /> |
| 25 | + |
| 26 | + <Section className="border-t border-border"> |
| 27 | + {/* Pipeline diagram */} |
| 28 | + <FadeIn> |
| 29 | + <div className="rounded-3xl border border-border bg-card/40 p-6 lg:p-8"> |
| 30 | + <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 items-center"> |
| 31 | + {stages.map((stage, i) => ( |
| 32 | + <div key={stage.label} className="flex flex-col items-center"> |
| 33 | + <motion.div |
| 34 | + initial={{ opacity: 0, scale: 0.9 }} |
| 35 | + whileInView={{ opacity: 1, scale: 1 }} |
| 36 | + viewport={{ once: true }} |
| 37 | + transition={{ delay: i * 0.08, duration: 0.3 }} |
| 38 | + className="flex w-full flex-col items-center gap-2.5 rounded-2xl border border-border bg-background p-4 text-center min-h-[140px] justify-center" |
| 39 | + > |
| 40 | + <div className={`flex h-9 w-9 items-center justify-center rounded-xl border border-border ${stage.color}`}> |
| 41 | + <stage.icon className="h-4 w-4" /> |
| 42 | + </div> |
| 43 | + <div> |
| 44 | + <div className="text-xs font-semibold text-foreground">{stage.label}</div> |
| 45 | + <div className="mt-1 text-[10px] leading-tight text-muted-foreground">{stage.description}</div> |
| 46 | + </div> |
| 47 | + </motion.div> |
| 48 | + </div> |
| 49 | + ))} |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + </FadeIn> |
| 53 | + |
| 54 | + {/* Core Rules */} |
| 55 | + <div className="mt-12 grid gap-6 lg:grid-cols-2"> |
| 56 | + <FadeIn> |
| 57 | + <div className="rounded-3xl border border-border bg-card/40 p-8 space-y-4"> |
| 58 | + <h3 className="text-xl font-bold text-foreground">Local-First Architecture Rules</h3> |
| 59 | + <p className="text-sm leading-relaxed text-muted-foreground"> |
| 60 | + DevMemory AI v1.0.0 operates completely offline. No cloud dependencies, no remote telemetries, no data leaving your machine. |
| 61 | + </p> |
| 62 | + <div className="space-y-2.5 pt-2"> |
| 63 | + {[ |
| 64 | + 'ONE Runtime orchestrator — central management', |
| 65 | + 'ONE Engineering Compiler — sole writer of Engineering Memory', |
| 66 | + 'ONE SQLite Index — .devmemory/index.db single source of truth', |
| 67 | + 'ONE query engine — powering dmai ask & dashboard', |
| 68 | + ].map((item) => ( |
| 69 | + <div key={item} className="flex items-center gap-2.5 text-sm text-muted-foreground"> |
| 70 | + <CheckCircle2 className="h-4 w-4 text-primary shrink-0" /> |
| 71 | + <span>{item}</span> |
| 72 | + </div> |
| 73 | + ))} |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + </FadeIn> |
| 77 | + <FadeIn delay={100}> |
| 78 | + <div className="rounded-3xl border border-border bg-card/40 p-8 space-y-4"> |
| 79 | + <h3 className="text-xl font-bold text-foreground">Transaction & Build Lifecycle</h3> |
| 80 | + <p className="text-sm leading-relaxed text-muted-foreground"> |
| 81 | + Instead of building on every keystroke, file save events are grouped into transactions with adaptive cooldown timers. |
| 82 | + </p> |
| 83 | + <div className="space-y-2.5 font-mono text-xs pt-2"> |
| 84 | + <div className="rounded-xl border border-border bg-background p-3 text-zinc-300"> |
| 85 | + File Saves → Chokidar Watcher → Transaction (Cooldown) |
| 86 | + </div> |
| 87 | + <div className="rounded-xl border border-border bg-background p-3 text-zinc-300"> |
| 88 | + Transaction Closed → Engineering Compiler AST Scan |
| 89 | + </div> |
| 90 | + <div className="rounded-xl border border-border bg-background p-3 text-success font-bold"> |
| 91 | + Write Build #N to SQLite Index (.devmemory/index.db) |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </FadeIn> |
| 96 | + </div> |
| 97 | + |
| 98 | + {/* Data flow */} |
| 99 | + <FadeIn delay={200}> |
| 100 | + <div className="mt-12 rounded-3xl border border-border bg-card/40 p-8 space-y-4"> |
| 101 | + <h3 className="text-xl font-bold text-foreground">System Component Boundaries</h3> |
| 102 | + <div className="overflow-x-auto"> |
| 103 | + <pre className="font-mono text-xs leading-relaxed text-zinc-900 dark:text-zinc-300 rounded-2xl border border-zinc-200 dark:border-zinc-800 bg-zinc-100 dark:bg-zinc-950 p-5 shadow-sm"> |
| 104 | +{`Watcher (Chokidar) → Observes filesystem changes (No Writes) |
| 105 | + ↓ |
| 106 | +Transaction Manager → Groups file events with adaptive cooldown (No Writes) |
| 107 | + ↓ |
| 108 | +Engineering Compiler→ Sole writer of Engineering Memory (AST extraction) |
| 109 | + ↓ |
| 110 | +SQLite Database → .devmemory/index.db (Nodes, Edges, Builds, Prompts) |
| 111 | + ↓ |
| 112 | +Runtime API Engine → Serves CLI (dmai ask) & Embedded Dashboard (:31415)`} |
| 113 | + </pre> |
| 114 | + </div> |
| 115 | + </div> |
| 116 | + </FadeIn> |
| 117 | + </Section> |
| 118 | + </> |
| 119 | + ); |
| 120 | +} |
0 commit comments