How autoinvent/conveyor works
Project type and purpose
• Conveyor is an open-source React UI component library (not a full-stack app) aimed at simplifying CRUD interactions with GraphQL APIs generated by Magql.
• It packages a set of prebuilt, configurable components (tables, forms, inputs, displays, actions, etc.), supports UMD and ES modules, and comes with Storybook examples and a CDN distribution.
File structure
• Top-level build/config files:
– package.json, pnpm-lock.yaml, vite.config.ts (build/bundle)
– tailwind.config.js, postcss.config.cjs, biome.json (styles & linting)
– .github/workflows/storybook-deploy.yaml (CI/CD)
• Examples folder: sample integrations (CDN, Vite React TS)
• docs & examples: usage instructions, publishing guide
• src folder: main library source, subdivided by feature areas:
– Actions, BasicDisplays, BasicInputs, Conveyor (core wrapper), Data, Form, Header, Lenses, ModelCheckDelete, ModelForm, ModelTable, Pagination, SearchResults, Slots, Table
– lib/components/ui: underlying primitive UI building blocks
– styles, types, utils: cross-cutting concerns
• Storybook configs under .storybook; backlog contains prototypes.
README insights
• Conveyor is installed via pnpm/npm or included via CDN.
• React is a peer dependency.
• Scripts define build, CSS build, Storybook local server, format, lint, packaging.
a. Main components:
• Source code modules (Actions, Displays, Inputs, Table, Form, Conveyor core, etc.)
• UI primitives (lib/components/ui)
• Shared layers (utils, types, styles)
• Build pipeline (Vite/Rollup bundle, Tailwind CSS)
• Storybook server for cataloging components
• CI/CD workflow (GitHub Actions deploy to Storybook, publish to npm)
• Distribution outputs: dist/ (UMD + ES modules), CSS file
• Consumers: npm package users, CDN users, example apps (Vite React TS)
b. Relationships & interactions:
• All src modules import from lib/ui primitives + utils + types + styles
• Conveyor core orchestrates context providers (Data, Form, ConveyorStore, Lenses, Table, Slots)
• Build pipeline ingests src + styles → outputs dist artifacts
• Storybook reads distilled component exports + MDX to render documentation
• CI/CD pushes dist to npm registry and publishes Storybook site
• Consumer apps import from '@autoinvent/conveyor' (ES/UMD) or reference CDN → integrate into their React code; GraphQL queries flow to Magql API
c. Architectural patterns & principles:
• Modular feature-based decomposition (one folder per feature)
• Context + hooks for state management in each module (useDataStore, useFormStore, useTableStore, etc.)
• Composition over inheritance: base UI primitives in lib/components/ui, extended by feature modules
• Separation of concerns: pure UI primitives vs. domain-specific feature components
• Peer dependency model for React and GraphQL client
d. Key technologies/frameworks:
• React + TSX, pnpm, Vite/Rollup, Tailwind CSS, Biome linter/formatter, Storybook, GitHub Actions, Magql