How alexeagleson/monorepo-example works
Project type and purpose
• This is a small-scale full-stack TypeScript “monorepo” tutorial that demonstrates how to combine:
• An Express server (packages/simple-express-server)
• A React front-end (packages/simple-react-app)
• A shared data package (packages/simple-shared-data)
• A Git submodule (react-dark-mode)
• Orchestration via Lerna + Yarn Workspaces + root TypeScript config
• The goal is to show code sharing, version alignment, hoisting, parallel scripts, and submodule integration.
File structure
• Root directories & files:
• lerna.json (defines packages/*, versioning, npmClient=yarn, useWorkspaces)
• package.json (private: true, workspaces: ["packages/*"], start script uses lerna run --parallel)
• tsconfig.json (baseUrl: "./packages")
• .gitmodules (tracks the react-dark-mode submodule)
• packages/ contains three sub-projects plus the Git submodule under simple-react-app/src/react-dark-mode:
• simple-express-server – Express API on port 3001, exports QueryPayload interface
• simple-react-app – CRA TypeScript app, fetches JSON from server, imports shared types and submodule component
• simple-shared-data – holds the shared QueryPayload interface
README insights
• Confirms use of Lerna and Yarn workspaces, reasons for monorepos (sync versions, share types), submodules for external independent repos
• Stresses running yarn start at root to launch both server and client in parallel
• Shows code-sharing of lodash and QueryPayload, and submodule addition of react-dark-mode