Giter Site home page Giter Site logo

arasgungore / react-weather-app Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 4.0 189 KB

A simple weather app built with React.js and OpenWeatherMap API.

License: MIT License

HTML 24.18% CSS 13.07% JavaScript 62.75%
react reactjs weather-api weather-app weather-data weather-forecast weather-information weatherapp openweather openweather-api

react-weather-app's Introduction

react-weather-app

A simple weather app built with React.js and OpenWeatherMap API. It allows users to check the current weather for a specific city, view the current date, and access meteorological predictions.

Table of Contents

Features

  • Weather Information: Displays the current temperature and weather conditions for a given city.
  • Calendar: Shows the current date.
  • Meteorological Predictions: Provides meteorological predictions for the week (simulated).

Getting Started

  1. Navigate to the project directory:
cd weather-app
  1. Install dependencies:
npm install

Project Structure

The project follows the following structure:

weather-app/
|-- public/
|   |-- index.html
|-- src/
|   |-- components/
|   |   |-- WeatherCard.js
|   |   |-- Calendar.js
|   |   |-- MeteorologicalPredictions.js
|   |-- services/
|   |   |-- WeatherService.js
|   |-- App.js
|   |-- index.js
|-- .env
|-- .gitignore
|-- README.md
  • public/: Contains the HTML file for the app.
  • src/: Contains the source code.
    • components/: React components for WeatherCard, Calendar, and MeteorologicalPredictions.
    • services/: Weather service for fetching data from the OpenWeatherMap API.
    • App.js: Main component that ties everything together.
  • .env: Environment file for storing the OpenWeatherMap API key (not included in the repository).
  • .gitignore: Specifies files and directories to be ignored by Git.
  • package.json: Contains project metadata and dependencies.

Technologies Used

  • React: JavaScript library for building user interfaces.
  • Axios: Promise-based HTTP client for making API requests.
  • Styled-components: CSS-in-JS library for styling React components.

API Key

This project requires an API key from OpenWeatherMap to fetch weather data. Follow these steps to obtain a key:

  1. Sign up for a free account on the OpenWeatherMap website.
  2. Once logged in, navigate to the API keys section and generate a new key.
  3. Create a .env file in the root of the project and add your API key:
REACT_APP_API_KEY=your_api_key_here

Usage

  1. Run the app:
npm start
  1. Open your browser and navigate to http://localhost:3000.

  2. Enter a city in the input field and click the "Search" button to see the weather information, current date, and meteorological predictions.

Contributing

Feel free to contribute to this project. Fork the repository, make changes, and submit a pull request.

License

This project is licensed under the MIT License.

Author

👤 Aras Güngöre

react-weather-app's People

Contributors

arasgungore avatar

Stargazers

 avatar  avatar

Watchers

 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.