• Stars
    star
    171
  • Rank 214,802 (Top 5 %)
  • Language
    TypeScript
  • Created about 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Companion labs for the workshop: "Develop at Scale with Nx Monorepos"

Nx Workshop - Building a Board Game Store

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 of its plugins to accelerate the development of this application.

Some of the things you'll learn:

  • Generating a pristine Nx workspace
  • Generating frontend Angular 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 lazily loaded 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
  • How to set boundaries between the different scopes in your project
  • Write automated source code generators for common tasks in your workspace
  • Set-up CI workflows for your Pull Requests
  • Add distributed caching
  • Set up the NxCloud GitHub integration
  • Write advanced deployment targets using the run-commands executor
  • Set up Continuous Deployment systems that deploy only the affected projects

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 Angular 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 Angular. While all the code for any Angular specific work will be provided, it will help if you have some experience with the Angular ecosystem.

Make sure you have the following installed:

For day 2, option 2 only:

How the labs work

Each lab will have the following sections:

  • ๐Ÿ“š "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
    • Any changes to the source directory structure
  • ๐Ÿ‹๏ธโ€โ™€๏ธ "Steps"
    • All the lab steps you need to follow
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.

If you get stuck running any Nx command, there is a SOLUTION.md file in each lab's folder.

As mentioned, for anything Angular/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.

Slides

Can be found here

The labs

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

Catching up with missed labs

If you fall behind or join late, we provide migrations that would bring your repository up to date with desired lab. To use the migrarions follow the next steps:

  1. Install @nrwl/nx-workshop package as dev dependency (e.g. yarn add -D @nrwl/nx-workshop). If you finished Lab 3.1 - Migrations then you should already have it installed.
  2. Run the generator with one of the following options:
    • Provide lab you want to complete: nx g @nrwl/nx-workshop:complete-labs --lab=5 or
    • Use from range to finish until end: nx g @nrwl/nx-workshop:complete-labs --from=2
    • Use to range to catch up with given lab: nx g @nrwl/nx-workshop:complete-labs --to=5
    • Use from/to range to catch up with several labs in between: nx g @nrwl/nx-workshop:complete-labs --from=2 --from=7
    • Use option to specify if you want track 1 or track 2: nx g @nrwl/nx-workshop:complete-labs --from=19 --option=option2
  3. Finnally, run the the migrations npx nx migrate --run-migrations to have that code generated
Day 1
๐Ÿ‘ฉโ€๐Ÿ’ป Lab 1 - Generate an empty workspace
โš—๏ธ Lab 2 - Generate an Angular app
๐Ÿƒ Lab 3 - Executors
๐Ÿš‚ Lab 3.1 - Migrations
๐Ÿงฉ Lab 4 - Generate a component lib
๐Ÿค Lab 5 - Generate a utility lib
๐Ÿ—บ๏ธ Lab 6 - Generate a route lib
๐Ÿญ Lab 7 - Add a NestJS API
๐ŸŽจ Lab 8 - Displaying a full game in the routed game-detail component
๐Ÿ“ Lab 9 - Generate a type lib that the API and frontend can share
๐Ÿ“– Lab 10 - Generate Storybook stories for the shared ui component
๐Ÿงช Lab 11 - E2E test the shared component
Day 2
๐Ÿ›‘ Lab 12 - Module boundaries
โš™๏ธ Lab 13 - Plugins and Workspace Generators - Intro
๐Ÿงต Lab 14 - Plugins and Workspace Generators - Modifying files
๐Ÿ”Ž Lab 15 - Setting up CI
โ˜๏ธ Lab 16 - Distributed caching
๐Ÿค– Lab 17 - NxCloud GitHub bot
๐ŸŽ๏ธ Lab 18 - Run-Commands and deploying the frontend
Option 1 - React frontends and more custom generators practice Option 2 - Fly.io API deployments
๐Ÿงญ Lab 19 - Creating and deploying a 2nd frontend ๐Ÿš€ Lab 19 - Deploying the API with custom executor
โ›ฑ๏ธ 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

More Repositories

1

nx

Smart Monorepos ยท Fast CI
TypeScript
22,163
star
2

nx-console

Nx Console is the user interface for Nx & Lerna.
TypeScript
1,273
star
3

nx-examples

Example repo for Nx workspace
TypeScript
843
star
4

precise-commits

โœจ Painlessly apply Prettier by only formatting lines you have modified anyway!
TypeScript
470
star
5

webpack-plugin-critical

Webpack wrapper for @addyosmani's critical library.
TypeScript
295
star
6

monorepo.tools

Your defacto guide on monorepos, and in depth feature comparisons of tooling solutions.
TypeScript
271
star
7

nx-recipes

Common recipes to productively use Nx with various technologies and in different setups. Made with โค๏ธ by the Nx Team
TypeScript
213
star
8

nx-set-shas

โœจ A Github Action which sets the base and head SHAs required for `nx affected` commands in CI
TypeScript
141
star
9

nx-labs

A collection of Nx plugins
TypeScript
128
star
10

nx-azure-build

Example of setting up distributed Azure build for Nx workspace
TypeScript
113
star
11

nx-react-native

86
star
12

react-module-federation

Example showing how to use Nx's new module federation support to speed up the builds of React apps
TypeScript
69
star
13

nx-incremental-large-repo

TypeScript
65
star
14

nx-jenkins-build

Example of setting up distributed Jenkins build for Nx workspace
TypeScript
63
star
15

ci

TypeScript
47
star
16

nx-react-workshop

TypeScript
43
star
17

last-successful-commit-action

GitHub action for identifying the last successful commit for a given workflow and branch.
JavaScript
43
star
18

node-microservices

TypeScript
42
star
19

nx-angular-and-react

TypeScript
42
star
20

blog-post-nx-production

TypeScript
36
star
21

nx-apollo-react-example

TypeScript
34
star
22

gatsby

Nx plugin for Gatsby
TypeScript
32
star
23

nx-bazel-example

Python
31
star
24

nx-distributed-cache-example

Nx workspace connected to Nx Cloud's distributed cache
TypeScript
31
star
25

ng-module-federation

Example showing to use new Nx's module federation support to speed up the builds of Angular apps
TypeScript
31
star
26

example-nx-fullstack

TypeScript
29
star
27

nx-example-multirepo

28
star
28

react-nx-example

Example for the blog post
TypeScript
27
star
29

nx-apollo-angular-example

TypeScript
26
star
30

ngrx-workshop-app

NgRx Workshop Example Application based on Shopping Cart from Angular.io docs
TypeScript
25
star
31

ngrx-example

Application Showing How to Use NgRx
TypeScript
22
star
32

add-nx

JavaScript
22
star
33

ts-aoc-starter

TypeScript
22
star
34

nx-cloud-helm

Nx Cloud Helm Charts
Smarty
21
star
35

playbook-angular-v6-elements-example

TypeScript
21
star
36

board-game-hoard

TypeScript
20
star
37

workshop-nx-labs

Lab exercises for the Nx Enterprise workshop(s)
20
star
38

workshop-nx-starter

Starter repo for the Nx Enterprise workshop(s).
TypeScript
20
star
39

nx-orb

โœจ A CircleCI Orb which includes helpful commands for running Nx commands in the CI
JavaScript
19
star
40

nx-expo

Official Expo plugin for Nx (alpha)
19
star
41

ngrx_race_condition

TypeScript
18
star
42

angular-reactive-forms-course

TypeScript
18
star
43

bazel-demo-app

Bazel Demo Application for Blog Post
TypeScript
18
star
44

angular-vscode

Useful VSCode plugins for Angular Development
TypeScript
17
star
45

nx-apollo-example

TypeScript
15
star
46

nx-go-project-graph-plugin

โ„น๏ธ Please take a look at the plugin https://github.com/nx-go/nx-go if you want to use Go and Nx together
Go
15
star
47

nx-tag-successful-ci-run

โœจ A Github Action which tags the repo, intended to be used only when on the main branch of your repo at the end of an Nx powered CI run
13
star
48

full-stack-react-example-app

TypeScript
12
star
49

bazel-rollup

TypeScript
11
star
50

nxcloud-k8s-setup

Example of running Nx Cloud on K8s
10
star
51

cra-to-nx

Tool for converting CRA project to Nx workspace
TypeScript
9
star
52

advent-of-code-starter

TypeScript
9
star
53

nx-cypress-command-sharing

Example repo to showcase how to share Cypress commands within various e2e tests in a Nx monorepo
TypeScript
8
star
54

pokemon-supabase-example

TypeScript
8
star
55

nx-trpc-demo

TypeScript
7
star
56

nx-ecosystem-ci

TypeScript
7
star
57

upgrade-with-elements

TypeScript
7
star
58

nx-shops

TypeScript
6
star
59

nx-custom-layout

TypeScript
6
star
60

bazel-cli-build

JavaScript
6
star
61

nx-migrate-angularjs-example

An example repo demonstrating a migration of an AngularJS application into an Nx workspace
JavaScript
6
star
62

bazel-docker-example

Python
6
star
63

cra-to-nx-migration

TypeScript
6
star
64

tic-tac-toe-playwright

TypeScript
6
star
65

nx-devkit-schematics

An example library that uses Nx Devkit to author Angular Schematics
TypeScript
6
star
66

zack-live-stream

The code base being worked on by Zack's livestream
TypeScript
6
star
67

nxcloud-k8s

Nx Cloud Kubernetes Example
6
star
68

angular-react-node

TypeScript
6
star
69

nx-cloud-workflows

JavaScript
5
star
70

nx-plugin-community-example

TypeScript
5
star
71

trpc-livestream

TypeScript
5
star
72

stackblitz-nx-angular

StackBlitz template for an Nx monorepo with Angular
TypeScript
4
star
73

react-to-solid

TypeScript
4
star
74

large-ts-monorepo

TypeScript
4
star
75

simple-portal-example

TypeScript
4
star
76

workshop-ngconf-18-labs

Lab exercises for the ng-conf 2018 workshop
4
star
77

transfer-state

TypeScript
3
star
78

lazy-spinners

TypeScript
3
star
79

angular-console

3
star
80

nx-incremental

Example showing how to set up incremental builds with Nx
TypeScript
3
star
81

tuskydesign

Sample repository with npm workspaces
CSS
3
star
82

workshop-pwa-fishgoco

Demo project for PWA workshop
TypeScript
3
star
83

nx-example-workspace

TypeScript
3
star
84

count-contributors-sample

Sample Repo for Node CLI exercise
JavaScript
2
star
85

bug-repro-circular

TypeScript
2
star
86

nx-example-sharedlib

TypeScript
2
star
87

hybrid-sample

TypeScript
2
star
88

nrwl-coding-assignment

TypeScript
2
star
89

release-js-and-rust

Example of versioning and publishing JS and Rust code together using nx release
Rust
2
star
90

spring-boot-livestream

TypeScript
2
star
91

stackblitz-nx-react

StackBlitz template for an Nx monorepo with React
TypeScript
2
star
92

using-tsc-b-with-next

TypeScript
2
star
93

angular-module-federation-example

TypeScript
2
star
94

nx-coding-assignment

Coding assignment for JavaScript/TypeScript developers
TypeScript
2
star
95

workshop-upgrade-angular-project

Angular version of TuskDesk demo project for upgrade workshops
TypeScript
2
star
96

nrwl-coding-assignment-angular

TypeScript
2
star
97

named-outlets

TypeScript
2
star
98

workshop-upgrade-angularjs-starter

AngularJS version of TuskDesk demo project for workshops
JavaScript
2
star
99

gatsby-example

Example repository that shows Gatsby and Nx in action
TypeScript
2
star
100

nx-14-5-cypress-10-example

TypeScript
1
star