Starter app for TEN stack: TypeScript + Express + Node.js
- Node.JS + Cluster
How to install
npm install -g gulp
Start application in development mode
npm run start
Start application in production mode
npm run start-prod
Run all tests:
npm run test-all
Run client tests:
npm run test-client
Run server tests:
npm run test-server
Client tests configuration is in
Create development dependencies
Create minimised production dependencies
Watch TypeScript and SCSS changes
Transpile client TypeScript and all SCSS
Style and scripts imports
Put all imports you want to use in
gulpfile.js. Then simply run
gulp dev or
In development mode you will get all your imports as separate entries so they will be easy to debug.
In production mode all your imports will be put together and minified to single .js and .css file so that they are as small as possible and fast to load.
Both client and server consist of modular structure.
That means certain folder order:
src/ ├── client/ │ ├── app/ │ └── elements/ │ └── server/ ├── app/ └── elements/
app - Consist of main application, server or client. It basically wires all elements together.
elements - Independent elements. It means that they don't depend on any other elements or application source code or assets. They can only depend on libraries used by project. It makes them independent from this project, which means they can be reused in other applications easily.