This project has been deprecated and archived. This means that no issues, PRs or other maintenance actions will be performed on it.
An Angular/Node.js project for providing latest game scores and audible announcements of scoring events.
Generated from HotTowel Angular
TODO:
- Highlight game that just had a score change
- Make it easier to modify/generate the test data
- Write some unit tests yo! so you don't have to manually test anymore
Opinionated Angular style guide for teams by @john_papa
More details about the styles and patterns used in this app can be found in my Angular Style Guide and my Angular Patterns: Clean Code course at Pluralsight and working in teams.
- Install Node.js
- on OSX use homebrew
brew install node
- on Windows use chocolatey
choco install nodejs
-
Install these NPM packages globally
npm install -g bower gulp nodemon
Refer to these instructions on how to not require sudo
- Run code analysis using
gulp vet
. This runs jshint, jscs, and plato.
- Run the unit tests using
gulp test
(via karma, mocha, sinon).
-
Choose whether you want to use the test data or live data (this is off by default right now)
- To toggle whether test or live data is used edit variable
useTestData
in the filesrc/server/scores-service.js
on line 29.
When using live data you should be aware of the interval at which you're pulling that data from the source. By default the data will be requested every 30 seconds.
- To toggle whether test or live data is used edit variable
-
Run the project with
gulp serve-dev
-
This opens the web app in a browser and updates the browser with any files changes.
- Build the optimized project using
gulp build
- This create the optimized code for the project and puts it in the build folder
- Run the optimize project from the build folder with
gulp serve-build
- Open
src/server/app.js
and change the value ofintervalInSeconds
on line 35.
When using live data you should be aware of the interval at which you're pulling that data from the source. By default the data will be requested every 30 seconds.
- Open
src/server/test-helpers/test-data-bottomline.json
and you'll see annfl
property with a long string as its value.- In the string you should see all mock NFL games for one week in a url-encoded format. This is the format used in the source system that the data is retrieved from.
- Find a game you want to change in the url-encoded string.
- Change a team's score by modifying the value between the
%20
just after the team's name.
-
gulp help
Displays all of the available gulp tasks.
-
gulp vet
Performs static code analysis on all javascript files. Runs jshint and jscs.
-
gulp vet --verbose
Displays all files affected and extended information about the code analysis.
-
gulp plato
Performs code analysis using plato on all javascript files. Plato generates a report in the reports folder.
-
gulp serve-specs
Serves and browses to the spec runner html page and runs the unit tests in it. Injects any changes on the fly and re runs the tests. Quick and easy view of tests as an alternative to terminal via
gulp test
. -
gulp test
Runs all unit tests using karma runner, mocha, chai and sinon with phantomjs. Depends on vet task, for code analysis.
-
gulp test --startServers
Runs all unit tests and midway tests. Cranks up a second node process to run a server for the midway tests to hit a web api.
-
gulp autotest
Runs a watch to run all unit tests.
-
gulp autotest --startServers
Runs a watch to run all unit tests and midway tests. Cranks up a second node process to run a server for the midway tests to hit a web api.
-
gulp clean
Remove all files from the build and temp folders
-
gulp clean-images
Remove all images from the build folder
-
gulp clean-code
Remove all javascript and html from the build folder
-
gulp clean-fonts
Remove all fonts from the build folder
-
gulp clean-styles
Remove all styles from the build folder
-
gulp fonts
Copy all fonts from source to the build folder
-
gulp images
Copy all images from source to the build folder
-
gulp styles
Compile less files to CSS, add vendor prefixes, and copy to the build folder
-
gulp wiredep
Looks up all bower components' main files and JavaScript source code, then adds them to the
index.html
.The
.bowerrc
file also runs this as a postinstall task wheneverbower install
is run.
-
gulp templatecache
Create an Angular module that adds all HTML templates to Angular's $templateCache. This pre-fetches all HTML templates saving XHR calls for the HTML.
-
gulp templatecache --verbose
Displays all files affected by the task.
-
gulp serve-dev
Serves the development code and launches it in a browser. The goal of building for development is to do it as fast as possible, to keep development moving efficiently. This task serves all code from the source folders and compiles less to css in a temp folder.
-
gulp serve-dev --nosync
Serves the development code without launching the browser.
-
gulp serve-dev --debug
Launch debugger with node-inspector.
-
gulp serve-dev --debug-brk
Launch debugger and break on 1st line with node-inspector.
-
gulp optimize
Optimize all javascript and styles, move to a build folder, and inject them into the new index.html
-
gulp build
Copies all fonts, copies images and runs
gulp optimize
to build the production code to the build folder.
-
gulp serve-build
Serve the optimized code from the build folder and launch it in a browser.
-
gulp serve-build --nosync
Serve the optimized code from the build folder and manually launch the browser.
-
gulp serve-build --debug
Launch debugger with node-inspector.
-
gulp serve-build --debug-brk
Launch debugger and break on 1st line with node-inspector.
-
gulp bump
Bump the minor version using semver. --type=patch // default --type=minor --type=major --type=pre --ver=1.2.3 // specific version
MIT