First, we have to setup the project. The difference with the previous chapter is that we now have to build two applications—the client side and the server side. This causes some differences with the previous setup.
We will again place our TypeScript sources in the lib
directory. In that directory, we will create four subdirectories: client
, server
, shared
, and typings
. The lib/client
directory will contain the client-side application and the lib/server
directory will contain the server code. Codes that can be used by both the server and the client will go in lib/shared
. Last but not least, lib/typings
will contain type definitions for some dependencies, including NodeJS.