{"id":13481956,"url":"https://github.com/alexpods/angular2-universal-starter","last_synced_at":"2026-03-27T03:51:21.448Z","repository":{"id":57179781,"uuid":"49333086","full_name":"alexpods/angular2-universal-starter","owner":"alexpods","description":"Enjoy Server Side rendering and Web Workers in your Angular2 Application","archived":false,"fork":false,"pushed_at":"2017-04-19T13:44:28.000Z","size":198,"stargazers_count":224,"open_issues_count":22,"forks_count":50,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-10T18:11:38.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpods.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-09T17:04:37.000Z","updated_at":"2024-07-20T18:44:35.000Z","dependencies_parsed_at":"2022-09-26T16:51:11.908Z","dependency_job_id":null,"html_url":"https://github.com/alexpods/angular2-universal-starter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpods%2Fangular2-universal-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpods%2Fangular2-universal-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpods%2Fangular2-universal-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpods%2Fangular2-universal-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpods","download_url":"https://codeload.github.com/alexpods/angular2-universal-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245845085,"owners_count":20681831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:57.762Z","updated_at":"2025-12-15T23:44:52.777Z","avatar_url":"https://github.com/alexpods.png","language":"JavaScript","readme":"# Angular2 Universal Starter Kit\n\n[![Build Status](https://travis-ci.org/alexpods/angular2-universal-starter.svg?branch=master)](https://travis-ci.org/alexpods/angular2-universal-starter)\n[![Dependency Status](https://david-dm.org/alexpods/angular2-universal-starter.svg)](https://david-dm.org/alexpods/angular2-universal-starter)\n[![devDependency Status](https://david-dm.org/alexpods/angular2-universal-starter/dev-status.svg)](https://david-dm.org/alexpods/angular2-universal-starter#info=devDependencies)\n[![Issue Stats](http://issuestats.com/github/alexpods/angular2-universal-starter/badge/pr?style=flat-square)](http://issuestats.com/github/alexpods/angular2-universal-starter)\n[![Issue Stats](http://issuestats.com/github/alexpods/angular2-universal-starter/badge/issue?style=flat-square)](http://issuestats.com/github/alexpods/angular2-universal-starter)\n[![Join the chat at https://gitter.im/alexpods/angular2-universal-starter](https://badges.gitter.im/alexpods/angular2-universal-starter.svg)](https://gitter.im/alexpods/angular2-universal-starter?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\n#What we've got here\n\n- [Server Side rendering](https://angularu.com/VideoSession/2015sf/angular-2-server-rendering) for instant page loading\n- Entire Angular2 application is running in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) (UI always will be smooth)\n- [Preboot](https://www.npmjs.com/package/preboot) to catch browser events before Angular2 is ready to work (you can experiment with its options [here](https://github.com/alexpods/angular2-universal-starter/blob/master/constants.js#L25))\n- [Webpack](https://webpack.github.io/) and its awesome [Code Splitting](https://webpack.github.io/docs/code-splitting.html) feature which allows us to lazy load parts of an application.\n- Live Reloading, a browser will be reloaded on any change in server or browser code. It works well for both a main thread and web workers.\n- [Typescript](http://www.typescriptlang.org/) with [Typings](https://github.com/typings/typings)\n- [PostCSS](https://github.com/postcss/postcss) with [CSSNext](http://cssnext.io/)\n- Linting with [TSLint](http://palantir.github.io/tslint/)\n- [Express](http://expressjs.com/) - de facto standard for Node.js web apps.\n- [PM2](http://pm2.keymetrics.io/) - most advanced Node.js process manager\n- Unit testing with [Karma](http://karma-runner.github.io/)\n- End-to-End testing with [Protractor](https://angular.github.io/protractor)\n\n##Requirements\n\n- **`node`** \u003e= **4.2.0**\n- **`npm`** \u003e= **3.0.0**\n\n#Quick start\n```bash\n# clone the repo without git history\ngit clone --depth 1 https://github.com/alexpods/angular2-universal-starter.git\n\n# change current directory to angular2-universal-starter\ncd angular2-universal-starter\n\n# install dependencies\nnpm install\n\n# run the production server\nnpm start\n```\nGo to [http://localhost:3000](http://localhost:3000) in your browser.\n\nYou may want to stop or restart the production server:\n```bash\n# stop the production server\nnpm stop\n\n# restart the production server\nnpm restart\n```\n\n## Development with Live Reloading\n```bash\n# make sure that the production server is not running\nnpm stop\n\n# run the development server with live reloading support\nnpm run dev\n```\n\nThe development server will watch for any changes, make rebuilds and reload a browser. All built code will be kept in \nmemory, so `dist` folder will not be generated (**all** means code for **both** **client** and **server** sides).\n\n##Turning server side rendering and web workers on/off\nYou can optionally turn server side rendering or web workers suport on/off. You just need\nto change `HAS_SS` and `HAS_WW` in `constants.js` [here](https://github.com/alexpods/angular2-universal-starter/blob/master/constants.js#L14):\n\n```js\n// ...\n\n// Server side rendering. Set it to `false` to turn it of.\nexports.HAS_SS = 'NG2_SS' in process.env ? process.env.NG2_SS === 'true' : true;\n// For example:\n// exports.HAS_SS = false;\n\n// Web workers support. Set it to `false` to turn it of.\nexports.HAS_WW = 'NG2_WW' in process.env ? process.env.NG2_WW === 'true' : true;\n// For example:\n// exports.HAS_WW = 'NG2_WW' in process.env ? process.env.NG2_WW === 'true' : false;\n\n//...\n```\nThen you need to restart the server to apply the changes:\n```bash\n# for production server\nnpm restart\n\n# for development server - stop its process and run it again\nnpm run dev\n```\n\n#Building\n```bash\n# build the project\nnpm run build\n\n# build the project and start watching for its changes\nnpm run build:watch\n```\n\n#Linting\n```bash\n# check the project (source files)\nnpm run lint\n\n# check the project and start watching for its changes\nnpm run lint:watch\n```\nIf you're not agree with the default rules ([`tslint.json`](https://github.com/alexpods/angular2-universal-starter/blob/master/tslint.json)), feel free to tell me about it.\n\n#Testing\nThe next command will run both unit and end-to-end tests.\n\nFor end-to-end tests you need to start Selenium Server first (see [End-to-End Testing](#end-to-end-testing)).\n```bash\n# run all tests (single run)\nnpm test\n```\n\n##Unit Testing\n```bash\n# run unit tests (single run)\nnpm run unit\n\n# run unit tests and start watch for changes\nnpm run unit:watch\n\n# run unit tests for specified directory (path must be relative to root directory)\n# currently you can specify paths only for \"src\" directory\nnpm run unit src/app\n\n# run unit tests for specified file and start watch for changes\nnpm run unit:watch src/app/home.spec.ts\n```\n\n##End-to-End Testing\nFor end-to-end tests you nedd to start Selenium Server (webdriver) first.\n```bash\n# start Selenium Server (webdriver)\nnpm run webdriver:start\n\n# run end-to-end test (single run)\nnpm run e2e\n```\n\n#Cleaning\n```bash\n# remove \"dist\" and \"logs\" folders\nnpm run clean\n\n# remove \"dist\" folder\nnpm run clean:dist\n\n# remove \"logs\" folder\nnpm run clean:logs\n```\n\n#License\nThe MIT License (MIT)\n\nCopyright (c) 2016 Aleksey Podskrebyshev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpods%2Fangular2-universal-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpods%2Fangular2-universal-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpods%2Fangular2-universal-starter/lists"}