Currently in the process of researching how to transition my repositories into a monorepo and further segment the codebase by early 2023.
- I am utilizing TypeScript
- I have multiple servers that I plan to break down into microservices for easier development
- I also have several React frontends that I intend to refactor into a separate set
The envisioned final structure is as follows:
/project-root
/desktop # electron apps
/documentation
/examples
/lib # commonly used libraries
/mobile # ionic apps
/server # node/express
/lib # server code libraries
/validation
/...
/gateway
/api # public API
/ms-xxx # microservices (Docker containers)
/ms-yyy
/...
/web # react apps
/lib # frontend code libraries
/uilib
/...
/webapp-1
/webapp-2
/...
/website # code for product website, potentially a CMS
After exploring various tools, these criteria appear feasible:
- Package manager: pnpm with workspaces
- Build tool: Vite
- Regarding Monorepo/packaging options such as Nx and Turborepo/Turbopack, while they seem limiting, I may not be fully informed on their capabilities yet.
I aim to implement multi-level tsconfig
and package.json
files, particularly under server and web directories, providing a consistent environment for servers and web applications.
- I encountered issues with @nrwl tooling versions using Nx, causing dependency conflicts
- Turbo boilerplate leans towards Next.js, whereas Nx requires extensive customization. Without these, hardcoding packages becomes necessary
- pnpm's handling of peer dependencies remains unresolved currently
Despite some basic examples, larger code bases do not seem prevalent with these tools, prompting the question: Is this approach viable, or am I misunderstanding something?