A node.js based, client/server solution showing how to start up a project involving following technologies:
- Express.js to serve web pages,
- Angular 2 framework for client-side Single Page Application,
- Ahead Of Time (AOT) compilation for a quicker application startup
- TypeScript 2 as an alternative to JavaScript to write client code,
- @types to include type definitions of external code
- WebPack 2 module bundler to process and build client source files,
- WebPack Hot Module Replacement to re-compile and reload web page when client source code changes,
- Development, test and production builds
- Karma test runner and Jasmine BDD testing library to unit test client source code.
This project draws from the experience and hints given by other, earlier Angular 2 starter projects. You might want to have a look at those, in case they might better suits your needs. Among the others, there are:
Here are the tools that should be present in your development environment in order to work with this project:
Server side application relies on node.js to run. Client side application relies on JavaScript and TypeScript, but it needs node.js anyway to be built and processed.
- nvm-windows 1.1.0, a node.js version management utility for Windows by Corey Butler
- node.js 4.3.2
- npm 3.8.0
Clone or download this repository:
git clone --depth 1 https://github.com/BrainCrumbz/YANGTSE.git
cd YANGTSE
Install dependencies:
npm install
Serve application in development, with live reload and module replacement enabled:
npm start
Launch browser and go to http://localhost:3000/
.
This project has a number of npm
-based commands in order to build and run both client and server
source code.
Install all dependencies:
npm install
Uninstall all dependencies:
npm uninstall
Build for development:
npm run build # or npm run build-dev
Build for production:
npm run build-prod
Clean build output:
npm run clean
Clean build output and all dependencies:
npm run clean-deep
Before building, output will be automatically cleaned. No need to manually clean.
Serve application in development, with live reload and module replacement enabled:
npm start # or npm run serve, or npm run serve-dev
Serve application in production:
npm run serve-prod
Before serving, application will be automatically rebuilt. No need to manually build.
Test:
npm test # or npm run test
Test with debugging enabled (e.g. breakpoints in browser console):
npm run test-debug
Test in watch mode (keep running tests again when code changes):
npm run test-watch