- 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 NextJS. This is in preparation for the next few labs, where we'll be deploying the two frontends independently in our GitHub Actions based Continuous Deployment setup.
-
We want to build a new Admin UI for out store. But we'll use NextJS as our framework of choice. Generate a new NextJS 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.
-
For simplicity, we want to run it on Surge, so let's export it as static assets for now. Since we added a lot of files, also commit your changes.
⚠️ Look at the available "targets" for your new Next app inproject.json
. Make sure you deploy the "exported" sub-folder.
-
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.
- Commit everything before moving on to the next lab
- BONUS - Add proper scopes for your new apps in
project.json
and run yourupdate-scope-schema
workspace generator you created a few labs ago.
🎓 If you get stuck, check out the solution