Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 6.57 KB

README.md

File metadata and controls

110 lines (80 loc) · 6.57 KB

Nx - Smart, Extensible Build Framework

React at Scale with Nx Workshop

✨ In this workshop we'll be building a store for a fictional board game company called The Board Game Hoard

We're going to be using Nx and some its plugins to accelerate the development of this app.

Some of the things you'll learn:

  • Generating a pristine Nx workspace
  • Generating frontend React apps and backend APIs inside your workspace, with pre-configured proxies
  • Creating shared libs for re-using code
  • Generating new routed components with all the routes pre-configured by Nx and ready to go
  • How to organize code in a monorepo
  • Easily move libs around your folder structure
  • Creating Storybook stories and e2e Cypress tests for your components

The Board Game Hoard

To help you understand how to apply some of these lessons in your own projects, we'll try to build a more "real-world" example. However, because of the time constrains and to make sure we get to cover as much material as possible, we'll provide you with all the code for any "non-Nx" work you need to do (like styling and configuring routes) - so you can focus on learning to use Nx to its full potential.

This is what we'll build:

lab4 file structure

Pre-requisites

Nx has support for a lot of platforms, but in this workshop we'll be using mainly React. While all the code for any React specific work will be provided, it will help if you have some experience with the React ecosystem.

Make sure you have the following installed:

  • Node.js version 12+ (14 recommended, but other versions might be okay as well)
    • node --version
  • A Github account

Optional (these won't be necessary to follow the workshop, but might unlock some bonus/advanced labs for you):

  • Yarn (you can also use npx or pnpx or global Nx CLI)
    • yarn --version
  • A Heroku account with the CLI installed
    • heroku --version
  • Docker
    • docker --version

How the labs work

Each lab will have the following sections:

  • ⏰  Estimated time
    • How much time we expect is needed to finish this lab
  • 📚  Learning outcomes
    • A summary of the most important things you'll learn in that lab
  • 📲  After this workshop, your app should look similar to this
    • This will contain a screenshot of any changes to the app visuals after the lab
  • 🏋️‍♀️  Steps
    • All the lab steps you need to follow
  • 🎓  Solution
    • If you get stuck running any Nx command, there is a SOLUTION.md file in each lab's folder.

The lab might also have this helpful sections:

  • 🐳  Hints and solutions feat. Ron the whale
    • While the mighty narwhal is away on secret missions, you will occasionally see his assistant, Ron The Whale offering helpful hints to the different exercises. Please use these if you get stuck.
  • ⚠️    Important information
    • Sometimes there are hidden gotchas or common mistakes. Read this before running the step
  • Source files
    • As mentioned, for anything React/styling or HTML template work we will provide the code you need as direct links to the files. Please use these as much as possible.

Finally, if you fall behind or join late, Git branches are provided for each lab, which will fast forward you to that lab - git checkout starting-labx (where x is the number of the lab you want to start). Note that this repository uses yarn as a package manager, so if you decide to fast-forward you will need Yarn to install dependencies.

If you want to skip ahead to the end: git checkout final.

The labs

Each lab will contain a link to the next one. Start from "Lab 1" and move through them as required:

Day 1

Day 2

Option 1 - NextJS frontends and more custom generators practice Option 2 - Heroku API deployments with Docker
🧭  Lab 19 - Creating and deploying a 2nd frontend 🧲  Lab 19 - Deploying the API
⛱️  Lab 20 - Mock Store 🎸  Lab 20 - Connecting the frontend and backend
🪁  Lab 21 - Setting up CD for automatic deployment 🎈  Lab 21 - Setting up CD for automatic deployment
💈  Lab 22 - Deploying only what changed 💈  Lab 22 - Deploying only what changed

Have fun learning! 🎉