How carl-labs/feeller-app works
Project type and purpose
• This is a front-end single-page application (SPA) written in React + TypeScript, built and served by Vite.
• It includes a minimal plugin-driven “core engine,” an ESLint setup, and supports HMR via either Babel or SWC.
File structure
• Top-level
• package.json, package-lock.json – dependencies & scripts
• vite.config.ts – Vite build/dev server config (plugins, aliases)
• eslint.config.js – linting rules (including optional React-X, React-DOM plugins)
• tsconfig*.json – TS compiler setups for app and Node
• main.cjs, preload.cjs – (optional) Node/Electron main & preload scripts
• index.html – application shell
• src/
• main.tsx – React entry point
• App.jsx – top-level React component
• components/ – UI pieces (e.g. TitleBar.tsx)
• utils/@core-engine.jsx – plugin host
• utils/Plugins/*.jsx – placeholderPlugin, etc.
• assets/css – global & module CSS
README for architectural hints
• Describes a minimal React+TS+Vite template
• Mentions two HMR plugins: @vitejs/plugin-react (Babel) or plugin-react-swc (SWC)
• Guides on expanding ESLint for type-aware rules
Main components & their interactions
A. Development & Build Layer
• ESLint (in-editor / CI) enforces code quality via eslint.config.js + tsconfig*.json
• Vite Dev Server (via vite.config.ts + React plugin) watches src/, transforms TSX/JSX, and pushes HMR updates
• TypeScript compiler ensures type safety
B. Source Code Layer
• index.html bootstraps main.tsx
• main.tsx renders <App /> into the DOM
• App.jsx initializes @core-engine, loads Plugins dynamically
• Components (e.g. TitleBar) consume props, core-engine APIs, and CSS modules
• Assets (CSS, images) are imported and processed by Vite’s asset pipeline
C. Runtime & Hosting Layer
• Browser (or Electron’s renderer if main.cjs/preload.cjs are used) executes the bundled code
• Production build: Vite bundles modules (Rollup under the hood) into /dist → served by static host or CDN
D. (Optional) Node/Electron Layer
• main.cjs spawns BrowserWindow
• preload.cjs injects APIs into renderer
Architectural patterns & design principles
• SPA with unidirectional data flow (React)
• Plugin architecture (core-engine + Plugins folder) for extensibility
• Clear separation of concerns:
• Dev vs. Prod (Vite server vs. static build)
• UI components vs. engine vs. assets
• CSS Modules for scoped styling