Giter Club home page Giter Club logo

react-weather-app's Introduction

React Weather Application

Find the current weather and 5 day forecast of any city on earth with this simple little web app

Live Demo on Heroku

Simple React web application written with jsx that returns the current weather. The app utilizes:


HACKTOBERFEST!

This project was featured during DigitalOcean's 2016 HACKTOBERFEST! Thanks to everyone who contributed in both discussion and coding!


How to run the app locally:

  1. Run npm install to install all needed dependencies.
  2. Navigate to OpenWeatherMap's and get a free API key. Then, create a file named .env in the project root and add the following line: API_KEY=yourkeyhere. This will give you access to API_KEY as a global variable anywhere in the client. It allows you to use your API Key while keeping it secret from everyone else.
  3. Get a key to access the Google Places API.
  • Open index.html and replace this url on line 11: https://maps.googleapis.com/maps/api/js?key=AIzaSyBvieYHDi4AvoL33XpHgCUrYr3tEfOz6kQ&libraries=places with your own version of the link. Your API key should go after the = and before the &. See below: https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places
  1. If you don't have webpack installed on your machine, run npm install webpack -g.
  2. Open up two command prompts. In one, run webpack -w. This lets webpack watch for changes to your files. After any saved changes, webpack automatically runs and updates your bundle.js file.
  3. In the other command prompt run npm start or node server.js. These commands do the same thing: Starting your server to host the web app.
  4. Navigate to localhost:3000 to see the app in action

react-weather-app's People

Contributors

antonioyee avatar avi-jain avatar beatfreaker avatar bmorelli25 avatar brendanbowidas avatar g3org3 avatar jamesmacfie avatar kopijunkie avatar mishakuzma avatar rsm23 avatar schmalzs avatar tetreault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-weather-app's Issues

Tests Fail Due to API_KEY Being Undefined

Right now, the tests fail out-of-the-box because API_KEY will be undefined. In order to make them work, you need to manually set the value of API_KEY in openWeatherMap.jsx while running the tests.

I'd like to fix this so that you don't need to manually set the value of API_KEY and, instead, your API key will be retrieved from the .env file.

Write React / JS / Node / API Tests

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: Testing! Practice your testing skills by writing tests for this web app. There are a number of things that can be tested in this app, including:

  • API data fetch
  • API KEY
  • React Rendering
  • Search in top right box
  • Search in main box
  • Search with blank string / bad characters

Don't hesitate to reach out with questions, or if you need help understanding the code!

If you want to write a test(s), leave a comment specifying what tests you're going to write so others don't end up writing the same tests. Tests should be placed in the /app/tests/ folder. Please see PR #7 for more information on how tests are implemented in this project

If you're not sure where to start, check out my React Todo App. This Web app has a ton (30+) tests and should give you some great ideas for how to write tests.

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Turn API Key into an Environment Variable (process.env.API_KEY)

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: Implement an enviornment variable for the Open Weather Map API_KEY. Currently the API Key is just sitting in the URL, visible for all to see. This is obviously not a best practice. Update openWeatherMap.jsx to utilize the new enviornment variable named API_KEY. Also update the Readme to explain how to use the environment variable.

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Refactor PR #9 code - Background changing based on Weather

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: In #9 @SimonMckeon added in a background changing feature. Based on the current weather conditions, the background of the app will change to match. There is some refactoring that needs to be done to better execute this code. Please see PR #9 for more details on what Simon did. If you'd like to help, comment below, and go for it!

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Weather by Zip Code Not Supported

It doesn't look like the app currently supports retrieving weather by zip code. Looking at the OpenWeatherMap API, this should be a quick enhancement to make.

CSS / SASS Site Re-design (With or without Foundation)

Hello Hacktoberfest!

Are you interested in SASS/CSS and Reactjs? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: A complete site redesign. Currently the web app utilizes Foundation for styling. Feel free to stick with Foundation, or go you're own route. I'm not looking for anything crazy here, but if you can help me make the site look more aesthetically pleasing, I'd greatly appreciate it!

Please feel free to reach out with any questions you have about the code/project - I'm more than willing to help!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Refactor REACT JS code

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

If this issue doesn't interest you, but there are other issues, bugs, enhancements you would like to make, please feel free to open up a new Issue and we can get a discussion started. I want everyone to be able to contribute!

Your task: Refactor WeatherForecastList.jsx. Currently, the component returns a map of WeatherForecastDay.jsx modules:

return newData.map((day) => {
                day.date_text = moment.unix(day.dt).format('dddd, MMM D');
                return <WeatherForecastDay tempType={tempType} key={day.dt} {...day}/>
            });

This works great. However, we also want the following to be returned (just once, at the top):

<h4 className="forecast-title">Forecast for next 5 days</h4>

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

โš ๏ธ Usage of environment variables for the API key ?

Maybe you should use an environment variable for you api_key value @public/index.html and refer to it in this file.
All you have to do are the following steps:

  1. Create an .env file in your root directory
  2. Create an API_KEY variable in this .env file as such: API_KEY = YOUR_API_KEY_NUMBER
  3. Replace your api_key value inside the file index.html by: ${process.env.API_KEY}
  4. Save both files and see the result

Write React / API / JS Tests!

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: Before we can write any tests, this application needs a testing foundation!

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

CSS / SASS Re-design - REACT

Hello Hacktoberfest!

Are you interested in SASS/CSS and Reactjs? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo Please note the live demo is an old version of the site. Download and run it to see the updated version.

Your task: Make it look prettier! Currently on weather load, a background image is displayed to the user. It tiles and looks pretty dated. Maybe a solid color would be better? You tell me. Lets discuss your ideas and go from there. I think simpler and cleaner is better.

Please feel free to reach out with any questions you have about the code/project - I'm more than willing to help!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Utilize OpenWeatherMap's API to return additional weather data

Hello Hacktoberfest!

Are you interested in ReactJS, RESTful APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This issue is pretty open ended as there are so many possible enhancements to be made in terms of data. OpenWeatherMap has a ton of great, free features. Currently this weather app utilizes only the current weather data API and returns the current temperature. Live Demo

Your task: Utilize OpenWeatherMaps API and return even more great data to the user. Possibilities include:

  • Current wind, rain, clouds, etc.
  • Returning an image that changes based on the weather (e.g. a sun when it's hot, a cloud when cloudy, etc.)
  • Changing the background based on current weather
  • Utilizing the 5 day/3 hour API to return the 5 day forecast for the searched city
  • Any other great ideas you can come up with!

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Current Location Temp in Nav Not Tied into Temperature Type

The temperature of your current location in the nav bar is not tied into the temperature type toggle. All other temps can be toggled between degrees F and degrees C, however, the current location temperature in the nav will always remain in degrees F.

React + Webpack Aliases + Testing = Help Fixing a Javascript bug

Hello Hacktoberfest!

Are you interested in React JS, Node JS, APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

If this issue doesn't interest you, but there are other issues, bugs, enhancements you would like to make, please feel free to open up a new Issue and we can get a discussion started. I want everyone to be able to contribute!

Your task: Webpack Aliases are broken in testing. Enhance your React and Webpack knowledge by fixing this bug! The details:

What are Aliases? You can find the aliases in this project in the webpack.config.js file. One example of using an alias would be in Nav.jsx.

Instead of:
var IPInfo = require('../api/ipInfo.jsx');

You simply have to:
var IPInfo = require('ipInfo');

The problem (I believe) lies in the fact that webpack.config.js is not being required prior to tests being run. Thus, none of the aliases that are set up are accessed. In order to allow testing to work again, I have temporarily removed all Aliases from the project in PR #34. Please see the specific code changes for more information.

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

Utilize ipinfo.io's API to guess the users location

Hello Hacktoberfest!

Are you interested in ReactJS, RESTful APIs, HTML, Javascript, Webpack, Express, and/or SASS/CSS? Then you've come to the right project!

This web app allows a user to type in a location, then pulls weather data from OpenWeatherMap's API and returns it to the user. Live Demo

Your task: Utilize IPinfo.io's API to guess the users current location.

If the location can be determined based on IP address, this information should be displayed in the index header and read something like: "It is x degrees in city"

Don't hesitate to reach out with questions, or if you need help understanding the code!

PS: This project utilizes a .editorconfig file. This helps developers define and maintain consistent coding styles between different editors and IDEs. Please ensure your editor is set up to use the .editorconfig file. For more information, check out editorconfig.org.

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.