This repo is an example of setting up nx monorepo with Nestjs as backend, reactjs as web app and react-native app as mobile app.
Code sharing is demonstrated as;
- ITodo interface is shared between all three apps (backend, reactjs and react-native) and is placed in libs folder as shared-types
- useTodos custom hook is shared between reactjs and react-native and is placed in libs folder under data-access
As one the benifits of monorepo, all projects have single node_modules and piece of code or component is being shared among projects.
clone the repo and move to project folder and run below command.
npm i
Run below command in project root folder to spin the project you want to run.
nest serve api
nest serve webapp
# spin metro bundler
nx start rnapp
# spin ios simulator
nx run-ios rnapp
Let me know if this was helpful for you or you have any question. Happy coding 🚀