Code Monkey home page Code Monkey logo

nhl-recap's Introduction

nhl-recap

A web app playing back the goal information from the latest NHL games. I made this to have a more exciting way of checking the scores while I brush my teeth in the morning, as the games are usually played at night time in Finland.

The app is running at GitHub pages. Add it to your home screen on an Android or iOS device for a more app-like, chromeless experience.

Built with Cycle.js and npm scripts. Uses nhl-score-api as its backed.

YouCut_20240610_205522012.mp4

Running the app

To run the app and re-build on file changes:

npm start

The app is available at http://localhost:8008/nhl-recap/, and the command should open a browser automatically.

Running a production build

To create a production build and preview it locally:

npm run start:production

Running the app with local API server

To run the app connecting to a local nhl-score-api server on port 8080:

npm run start:local

Instead of a real nhl-score-api server, you can also start a mock json-server API server that returns a static response from the server/db.json file:

npm run start:server

Then you can run the app connecting to the local server with npm run start:local as described above.

Component gallery

This project has its own poor person’s component gallery that currently just shows the game component in all its possible states, so that you don’t need to play back games in different states to see them.

The gallery is available at http://localhost:8008/nhl-recap/gallery/ when running the development server locally. (Note that the trailing slash is required.)

Formatting with Prettier

JavaScript is formatted using Prettier. Prettier is the most convenient to run via your IDE, but it is also run as part of the linting tasks:

npm run lint:format

Linting JavaScript

One-time lint run:

npm run lint:js

Lint on file changes:

npm run watch:lint:js

Linting SASS

I'm trying out the BEM (Block-Element-Modifier) naming convention in this project.

The lint scripts have a css suffix (instead of sass that you might expect) for uniformity with the other CSS related scripts.

One-time lint run:

npm run lint:css

Lint on file changes:

npm run watch:lint:css

Testing

Lint SASS, lint JavaScript, run Prettier and run unit tests:

npm test

Run only unit tests, including coverage:

npm run spec

Run only unit tests in watch mode:

npm run spec:watch

Building

Build the app to the public directory:

npm run build

Deployment

The deploy script will build the app, clone the gh-pages branch to the dist directory, copy the build there, create a commit, and push the commit to the gh-pages branch in origin.

Usual deployment process:

# Bump version
npm version <major|minor|patch>
# Deploy to GitHub Pages
npm run deploy
# Push to Git
git push origin master --tags

License

MIT

Acknowledgements

This project has been a grateful recipient of the Futurice Open Source sponsorship program.

nhl-recap's People

Contributors

peruukki avatar dependabot[bot] avatar

Stargazers

Garret Benoit avatar Ryan Omasta avatar  avatar Kevin Weatherwalks avatar Gyasik Núñez avatar Alexey Shamrin avatar Claude Gagné avatar Nate Smith avatar Miro Nieminen avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.