Get an overview of the demo project used for this course and find out how to install dependencies and get it running.
- [Instructor] The demo project we'll be working on is a stock market simulation that trades in pizza slices. This web application is built entirely in node with the back end calculating the new quotes. For now, let's go ahead and get the demo project running on your local machine. First, you need to have node and npm installed. This may be a little redundant for you, but I didn't want to leave anyone behind, so we'll go ahead and walk through installing it. Node and npm come together in a package from the node website found here at nodejs.org. On the front page, there will be some download links.
We want to be the version six LTS release line for this course. As of this recording, the version is version 6.9.5. So, click that button to download the installer. Once it's finished downloading, open it up and follow the installation instructions. One thing that's important is adding node and npm to your path. This is so that we can execute both executables from the command line.
Windows users take special note because if the installer doesn't add node and npm to your path, you will need to do it manually later. Once the installation is complete, let's go ahead and confirm that node is installed correctly. Open your command line and basically from anywhere, execute the command node, space, dash, v. This should output the version of node that you just installed and you can see that mine is version 6.9.5. We can also check that npm has installed correctly, so, run the command npm, space, dash, v, and here my version of npm is 3.10.10.
Now that we have both executables installed correctly, let's install our dependencies for our demo application. First, navigate to the location where you've downloaded and extracted the exercise files from this course. Mine are located on my desktop, and although we won't start working on this code until next video, I'll be demonstrating installing dependencies in the 01_01, start directory. Once you're there, you can install all the dependencies for the course via the command, npm install, which will take a look at the package.JSON file that's included and install all the dependencies.
This may take some time as npm is downloading all the dependencies from the internet. Remember that you will need to install these dependencies every time if you are moving around the directories in the exercise files. I'm not going to give you a full walkthrough of the existing application, but I highly recommend you take a few minutes to familiarize yourself with the code before continuing on to the next chapters. Now, with the dependencies completely installed, we can run our application with the command, npm start. Once you see a connected message like this one, you can open up a browser and navigate to local host colon 3000 where our server is listening.
Your browser should render the site looking something like this. Our demo app is called Pizza Market, and basically here's what the front end looks like. You can open and close the market, which begins generating some random daily stock numbers for different types of pizza slices. This chart is the aggregate of all the pizza slices daily. You can click on individual pizza slices and see the data.
And, all of these quotes are generated on the back end by our node application. You can click close market to stop the simulation and open market to start it again. Pizza Market is now all set up, so you're ready to move on to learning ES6. Again, I'd recommend taking some time to look at the code before we dive in and begin making modifications.
- Using arrow functions
- Using default parameters
- Reviewing the class structure in ES6
- Assigning variables with let and const
- Array destructuring and object destructuring
- Replacing callbacks with promises
- Keeping values unique with Set
- Dropping the prototype with Map
- Working with generators
- Using yield with arguments