How strikestrike/datadocs works
Project type and purpose
• This is a large monorepo hosting a front‑end only web application called “Datadocs,” plus supporting libraries.
• Datadocs is a Svelte/TypeScript SPA for loading, viewing, and manipulating large columnar data sets from multiple sources.
• There is no production backend here—only a mock-api-server for local development.
File structure
• Top‐level “packages” folder contains all sub‑projects:
• datadocs: the main Svelte web app
• canvas-datagrid-ng: the reusable grid component library
• datasource-duckdb, duckdb-utils, duckdb-wasm: DuckDB‑related data layers
• local-storage: IndexedDB/OPFS persistence adapters
• mock-api-server: local mock HTTP API
• Other utility sub‑modules and templates (e.g., windi‑plugins, submodule‑template).
• CI/CD manifests in .github/workflows and deploy scripts in /deploy.
• Build configurations: Yarn (monorepo via Lerna), Vite (front‑end), Rollup (library bundling), TypeScript, ESLint, Husky, etc.
README
• Confirms monorepo structure with UI only, mock API server, no real backend.
• Points to grid‑component docs, panels layout, and usage of various “data sources” (CSV, Firestore, DuckDB).
a. Main components
• Browser Client (Datadocs SPA)
• Grid Component Library (canvas‑datagrid‑ng)
• Data‑Source Layer
• DuckDB WASM (duckdb-wasm + datasource-duckdb)
• Firestore connector (via datadocs/src/api/firestore)
• Local storage (IndexedDB/OPFS)
• CSV/XML parsers
• Mock API Server (mock-api-server)
• CI/CD & Deploy Pipeline (GitHub Actions + deploy scripts)
• External Services (e.g., Firestore, real backend under NDA)
b. Relationships & interactions
• The SPA imports and renders grid components from canvas‑datagrid‑ng.
• Grid component issues data‑fetch requests via a generic data‑source interface.
• At runtime, data source implementations are chosen (DuckDB WASM in‑browser, Firestore via HTTP, local persistence).
• The SPA also calls the mock‑API server for metadata, authentication flows, and file listings.
• Local‑storage package provides offline persistence; integrated with DuckDB or as fallback.
• CI pipeline runs build & tests on each package; deploy script pushes static assets to hosting.
c. Architectural patterns & principles
• Monorepo with clearly separated packages (library vs. application).
• Component‑based UI (Svelte) + unidirectional data flow (stores, actions).
• Plug‑in data‑source abstraction (Strategy Pattern): grid core is agnostic to underlying data.
• Library bundling via Rollup; application bundling via Vite.
• Mock server for development (Test Double pattern).
d. Key technologies & frameworks
• UI: Svelte, TypeScript, Yarn, Vite
• Grid Library: canvas and Web‑Component (custom elements), Rollup
• Data Layer: DuckDB‑WASM, IndexedDB/OPFS, Firestore REST API, CSV parsers
• CI/CD: GitHub Actions, Husky, Lerna
• Styling: WindiCSS, Tailwind, CSS modules