write-with-webiny icon indicating copy to clipboard operation
write-with-webiny copied to clipboard

Build a Monorepo for your Internationalized Frontends with Nx and Webiny

Open endymion1818 opened this issue 2 years ago • 5 comments

Introduction

Nx is a popular workspace management tool that helps manage dependencies and provides other useful features such as computation caching, smart rebuilds and easy code sharing when building groups of sites, APIs and libraries in a monorepo.

Although you can use Webiny to manage your frontend projects as well, some teams like to separate concerns by having a separate monorepo for the frontend and the backend.

Goals

In this article we will demonstrate how to build a monorepo in NX with a shared UI library for sites which share components but whose content is written in 2 different languages using Webiny's built-in internationalization feature.

Outline

  • Introduction
    • What is a monorepo
    • Introduction to Webiny
    • Introduction to Nx
  • Setting up a Webiny project with 2 languages
    • Setting up content models in each locale
    • Writing content in each locale
  • Setting up a Monorepo with Nx
    • Setting up a shared UI library
    • Set up shared helper functions ilbrary
    • Set up 2 applications (using existing Nx plugins for Svelte / Next / Astro)
    • Connecting to each locale on the frontend
    • Fetching article content and rendering a home page
  • Conclusion

Sample articles

No response

endymion1818 avatar Aug 09 '22 09:08 endymion1818

Set up 2 applications using existing Nx Plugins for Svelte / Next / Astro

You mean either Svelte, Next or Astro and not all of them, right? @endymion1818

EmmanuelTheCoder avatar Aug 21 '22 13:08 EmmanuelTheCoder

Yes that's correct. Nx is very opinionated, it's for iterating on one core concept so one of these technologies is suitable.

endymion1818 avatar Sep 19 '22 09:09 endymion1818

I would like to on this

mike-nzioki avatar Oct 04 '22 05:10 mike-nzioki

Hi @Nziokitech thanks for your interest! Have you worked with Nx before? I'd also really like to see some of your written content. Could you share some articles? Send me a DM in the community slack if that's easier 🙂

endymion1818 avatar Oct 04 '22 08:10 endymion1818

Hi @Nziokitech, how are you getting on with writing this article? Please respond soon or I will have to assign it to someone else.

endymion1818 avatar Nov 10 '22 11:11 endymion1818