How bjoernrave/rave-ui works
Project type and purpose
• This is an open‑source React UI component library (“Rave‑Ui”) specialized in dynamic form inputs, tables, modals, theming, and localization.
• It ships as a single package that consumers install via npm/yarn. Storybook is used for live component demos, and Jest for automated testing.
File structure
• Top‑level folders:
• .github/workflows/ – CI pipelines for build, test, bundle‑size checks.
• storybook/ – Storybook configuration and setup files.
• src/ – All application code:
– src/FormItems/Basic/ – Primitive form controls (TextInput, DateInput, etc.).
– src/locales/ – i18n resource files for “en” and “de.”
– Various higher‑order or composite components (FormPage, DocumentViewer, ImageViewer, Table, etc.).
– Entry point: src/index.ts.
• src/tests/ – Jest tests for utility functions and components.
• stories/ – Storybook stories illustrating component usage.
• Config files: package.json, tsconfig.json, jest.config.js, biome.json (formatter/linter), and CI workflows.
README for additional insights
• Lists peer dependencies on React, MUI, @emotion, React Hook Form, Zod, date‑fns, etc.
Main components
a. Core UI Library (src/index.ts)
b. Form Engine:
– Basic Inputs (FormItems/Basic/*)
– Composite Controls (MultiCreate, EntitySelect, TableInput, etc.)
– Form context & validation (React Hook Form + Zod + SchemaContext)
c. Theming & Styling
– Emotion + MUI theme integration (lib/theme.ts, lib/styles.tsx)
d. Localization
– i18n loader + JSON resources (locales/en, locales/de)
e. Stories & Demos
– Storybook server & configurations (.storybook/)
f. CI/CD
– GitHub Actions workflows for test, build, bundle size
g. Consumers
– External applications importing the library as a dependency
Relationships & interactions
• Consumer App → installs Rave‑Ui → imports components from src/index.ts.
• UI components → depend on theme & styling context.
• Form components → send/receive data via React Hook Form context & Zod schemas.
• Basic controls → form composites.
• Localization provider → supplies translation strings to components.
• Storybook → imports same entry point + mocks providers for live preview.
• CI workflows → run tests, lint, build artifacts, and publish to NPM.
Architectural patterns & design principles
• Component‑based Architecture: each input is a self‑contained React component.
• Provider pattern: ThemeProvider, LocalizationProvider, FormProvider.
• Composition over inheritance: composite form controls built by combining Basic inputs.
• Separation of concerns: lib/ holds utilities; FormItems/ holds UI; stories/ holds demos.
• Extensibility: consumers can wrap or extend SchemaContext, override theme tokens, add new locales.
Technologies & frameworks to annotate
• React, TypeScript
• MUI (Material‑UI) + @emotion/react for styling
• React Hook Form + @hookform/resolvers + Zod for form management & validation
• date‑fns for date utilities
• react‑dropzone for file inputs
• Storybook for component sandbox
• Jest + Testing Library for automated tests