arifshariati / nx-monorepo

nestjs, reactjs and react-native app in nx work-spaces. This repo demonstrate type and code sharing amongst apps which scales development for larger projects in cross functional teams.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

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;

  1. ITodo interface is shared between all three apps (backend, reactjs and react-native) and is placed in libs folder as shared-types
  2. 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.

How to install?

clone the repo and move to project folder and run below command.

npm i

How to run apps?

Run below command in project root folder to spin the project you want to run.

NestJs backend (api)

nest serve api

React (webapp)

nest serve webapp

React-Native (rnapp)

# 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 🚀

About

nestjs, reactjs and react-native app in nx work-spaces. This repo demonstrate type and code sharing amongst apps which scales development for larger projects in cross functional teams.


Languages

Language:TypeScript 35.4%Language:Java 32.6%Language:JavaScript 12.7%Language:Objective-C 11.8%Language:Ruby 3.5%Language:Starlark 2.6%Language:HTML 1.4%