- Recap what you've learned about generating apps and creating custom executors with "run-commands"
In this lab, we'll practice generating a 2nd frontend, using React. This is in preparation for the next few labs, where we'll deploying the two frontends independently in our GitHub Actions based Continous Deployment setup.
-
We want to build a new Admin UI for out store. But we'll use React as our framework of choice. Generate a new React app called "admin-ui" You can use any configuration options you want.
⚠️ There will be fewer hints in this lab, but you can always use the solution as a last resort.
-
We won't make any changes to it. Let's serve it to see if it looks okay locally.
-
Now let's build it for production. Since we added a lot of files, also commit our changes.
-
Following the same steps as Lab 18, add a
"deploy"
target to it.⚠️ BONUS POINTS: Create a custom workspace generator that adds a"deploy"
target for a frontend project, so that we don't have to manually re-do the steps in Lab 18 each time.⚠️ Hint: You can have a.local.env
at the root of your workspace as well, for any variables that need to be shared. You can move yourSURGE_TOKEN
variable to the root, so it can be shared among your projects. READ MORE
-
Try to deploy both apps and check if they still work.
⚠️ BONUS: Use a single NX command to tell it to deploy all projects in parallel.
-
BONUS - Add proper scopes for your new app in
nx.json
and run yourupdate-scope-schema
workspace generator you created a few labs ago. -
Commit everything before moving on to the next lab
🎓If you get stuck, check out the solution