Skip to content

valgeirb/magic-mirror

Repository files navigation

Magic Mirror

This project is built using the Aurelia platform. It includes a simple white-on-black interface that currently displays the time and date along with forecast information.

magic mirror screenshot

Prerequisites

Before getting started with the app, you must first configure some things.

  1. Get yourself a Forecast API key from their website.
  2. Create a mirror-config.js, using mirror-config-example.js as a template.
  3. Replace the example values in the file with your API key, preferred units and language.
  4. The date.js class uses Moment with the Icelandic language, you can edit that like you want.
  5. Pull requests are encouraged =)

Running The App

To run the app, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:
npm install
  1. Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulp

Note: Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.

  1. Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspm

Note: jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.

Note: jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing jspm registry config github and following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHub Settings > Personal Access Tokens), public_repo access for the token is required.

  1. Install the client-side dependencies with jspm:
jspm install -y

Note: Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing npm install -g unzip and then re-running jspm install.

  1. To run the app, execute the following command:
gulp watch
  1. Browse to http://localhost:9000 to see the app. You can make changes in the code found under src and the browser should auto-refresh itself as you save files.

The app uses BrowserSync for automated page refreshes on code/markup changes concurrently across multiple browsers. If you prefer to disable the mirroring feature set the ghostMode option to false

Running The App under Electron

To run the app under Electron, follow these steps.

  1. Install Electron
npm install electron-prebuilt -g
  1. To start the app, execute the following command:
electron index.js

Note: If you use electron every time or are packaging and so-forth, Then change this line in package.json from "main": "dist/main.js", to "main": "index.js", Build the app (this will give you a dist directory)

gulp build

To start the app, execute the following command:

   electron .

Bundling

Bundling is performed by Aurelia Bundler. A gulp task is already configured for that. Use the following command to bundle the app:

  gulp bundle

You can also unbundle using the command bellow:

gulp unbundle

Configuration

The configuration is done by bundles.json file.

Optional

Under options of dist/aurelia add rev: true to add bundle file revision/version.

Exporting bundled production version

A gulp task is already configured for that. Use the following command to export the app:

  gulp export

The app will be exported into export directory preserving the directory structure.

Configuration

The configuration is done by bundles.json file. In addition, export.json file is available for including individual files.

About

My version of the popular magic mirror project - built with Aurelia.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published