Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

⭐ Set up the Weather 10kb environment

Julian Norton edited this page Dec 3, 2018 · 3 revisions

Overview of steps

  1. Set up your development environment
  2. Sign up for a couple API keys, which will provide weather and location data.
  3. Run it locally
  4. If you're interested in hosting weather-10kb on your website, please see deploying.

Run weather-10kb locally

  1. Install node.js
    • if you have homebrew, brew install node
  2. clone repo via terminal: git clone https://github.com/JulianNorton/weather-10kb.git
  3. cd into the weather-10kb folder: cd weather-10kb
  4. install required packages: npm install or yarn
  5. Sign up for a dark sky API key
  6. Turn on local version: DARK_SKY_API_KEY=<key> npm start
    • Replace <key> with whatever your API key is
    • † Google api key will increase rate limit for the npm package node-geocoder see: https://github.com/JulianNorton/weather-10kb/issues/62 if you have issues.
    • DARK_SKY_API_KEY=<key> GOOGLE_API_KEY=<key> npm start (or yarn start) to run it locally with the google key
  7. go to http://localhost:5000
    • It should show an error when loaded "Error: Unable to determine location based on IP address.", that's normal!

Modify & Compile CSS

  • styles-compiler.scss compiles into main.css using node-sass
  • npm run watch-css Automatically compiles css whenever there's a change to the .scss
  • npm run build-css If you want to compile css once
  • npm rebuild node-sass if you're switching branches a lot this can fix node-sass crashes.

Need help?

If you get stuck, let us know so we can help!