§6.2.

A shopping list application

In this workbook, I will gradually develop a shopping list application.

I have written a first version of the application using Express.js. I include a full source code listing below.

You can download the complete code and package.json from the chapter06_shopping_base project in the workbook’s git repository. You can use the following commands to run the application:

$ git clone http://www.github.com/benatuts/aipjs/
...
$ cd aipjs/chapter06_shopping_base/
$ npm install
...
$ npm start
The shopping list is running on http://localhost:3000/
Exercise: Design improvements

After starting the application, spend a moment reading the code in index.js and try to understand what it does. You can stop or restart the server by pressing Control+C.

In your notes, write down a critique of the design of the system. What is good about the design? More importantly, what problems does it have?

The code has the potential for improvement. Keep your notes about the design: this chapter will include a discussion of possible design improvements.