GithubHelp home page GithubHelp logo

nextjs-monorepo's Introduction

Nextjs-monorepo

Experimenting NextJS application in Monorepo

This repo is just for learning purpose to understand how to setup Monorepo using npm workspaces only for NextJS applications and its share components

Prerequisites

To run this application, you'll need the following:

  • Node.js (v16.3.1 or above)
  • npm (v8.1.2 or above)

Getting Started

Follow the steps below to set up and run the Next.js application:

git clone https://github.com/your-username/nextjs-app.git
cd next-monorepo
npm install

Development server:

Run on the root project

npm run dev -w <pkg>
# example: npm run dev -w customer-web

or you might want to use available script from root

npm run dev:<pkg>
# example npm run dev:customer-web

Project Structure

The project structure is organized as follows:

  • customer-web/: Simulate real case of Next.js application for customer-side.
  • internal-dashboard/: Simulate real case of Next.js application for internal operational.
  • shared/: contain shared lib (e.g UI component, theming)

Available Scripts

In the root project directory, you can run the following scripts:

  • npm run dev:internal-dashboard: Starts the development server for internal-dashboard project.
  • npm run dev:customer-web: Starts the development server for customer-web project.
  • npm run lint-packages: Run linting all packages.

Deployment

npm run build -w <pkg>
# npm run build -w customer-web

nextjs-monorepo's People

Contributors

eriansha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.