How to create a Node and React Monorepo with Git Submodules

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • monorepo-example

    Example of a simple Node Server and React app monorepo using git submodules (by alexeagleson)

  • This is also a good time to commit your new project to your repository. I'll be doing that now as well, you can see the final version here.

  • React

    The library for web and native user interfaces.

  • import React from "react"; import logo from "./logo.svg"; import "./App.css"; import _ from "lodash"; import { QueryPayload } from "simple-express-server/server"; function App() { return (

    logo

    Edit src/App.tsxcode> and save to reload. p> {_.toUpper("Learn React")} a> { fetch("http://localhost:3001/", {}) .then((response) => response.json()) .then((data: QueryPayload) => console.log(data.payload)); }} > GET SOME DATA button> header> div> ); } export default App;

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • lodash

    A modern JavaScript utility library delivering modularity, performance, & extras.

  • Let's say that there's a utility library that we want to use in both our React app and on our Express server. For simplicity let's choose lodash which many people are familiar with.

  • lerna

    :dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.

  • Lerna: For running scripts across multiple projects and adding new dependencies. Lerna is also built to manage publishing your packages (though we will not be doing that as part of this tutorial)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts