How sitevision/sitevision-apps works
This project is a monorepo for various Sitevision libraries and tools that support building Sitevision WebApps and RESTApps. The repository contains multiple interrelated packages such as an API library that offers both client and server utilities, babel presets for React on both client and server, ESLint configurations, a “create-sitevision-app” scaffolding tool, and a set of scripts (sitevision‑scripts) that cover build, deploy, testing, and other development tasks.
Overall Structure – The Monorepo
– API (located in packages/api)
– Babel Presets (react-client and react-server)
– Create Sitevision App (scaffolding tool)
– ESLint Configuration Packages (recommended, typescript, webapp-react)
– Sitevision Scripts (tooling and build/deploy utilities)
Main Components and Their Roles
• API Package:
– Inside this node, subdivide it to highlight its internal layers:
▪ Client Layer: Contains modules such as requester, toasts, etc.
▪ Common Layer: Offers shared functionality like events, router, security, app logic.
▪ Public API Layer: Exposes numerous server utilities (for example, ArchiveUtil, ChannelUtil, UserUtil, many other util modules).
▪ Server Layer: Includes modules related to server-side functions (like appData, headless, hooks, OAuth2, privileged operations, storage, AI integration, etc.).
• Babel Presets:
– Group together the babel-preset-react-client and babel-preset-react-server packages.
• Create-Sitevision-App Tool:
– Mark this package as a scaffolding or CLI tool that a developer would run to quickly bootstrap new Sitevision applications.
– Connect this tool with the API and configuration packages (indicating that generated apps will use the utilities provided by these libraries).
• ESLint and Prettier Configurations:
– Represent the various ESLint config packages (eslint-config-recommended, eslint-config-typescript, eslint-config-webapp-react) as configuration tools that help maintain code quality across the apps.
– These should be shown as supporting tools that feed into every package/application built within the monorepo.
• Sitevision Scripts:
– Display its responsibilities: building, deploying (with both production and development scripts), testing, signing, transpiling, and asset management.
Interactions and Data Flow
• Links from the build and deploy scripts (sitevision-scripts) toward project packaging, testing, and deployment – indicating automation.
Architectural Patterns and Technologies
• That the project uses Lerna for package management and Yarn (the .yarn folder and yarn releases indicate Yarn 4.5.0 is used).
• That the API package itself adheres to a modular design separating client, common, public API, and server utilities. This design enables reusability and clear separation of concerns.
• That the babel presets, ESLint configurations, and scripts are utility layers that help maintain consistency during development, testing, and production deployment.