Skip to content

Weather app to see your current city's weather or other countries as well. You can also change the temperature between Fahrenheit and Celsius. Built with JS and Unsplash API and OpenWeatherMap API.

Notifications You must be signed in to change notification settings

jcy2704/weather-app

Repository files navigation

Logo

Weather App

Project created by Steven Jack Chung
Project created using OpenWeatherMap API and Unsplash API

‎ ‎ ‎ ‎

Weather App

Weather App is a dynamic app that shows the current weather of different countries. Used JavaScript with DOM API to render and manipulate HTML. Implemented asynchrous functions and promises to access public APIs; OpenWeatherMap API to render the weather information and Unsplash API to render the background depending on the current weather.

Built With

Live Preview

Weather App

Getting Started

This project was created to understand more about how api worked and how to access it in JavaScript.

To get a local copy up and running follow these simple example steps.

Prerequisites

Computer running Mac OS, Windows, or Linux Ubuntu. Internet browser: Firefox, Google Chrome, Opera...

Install NodeJs

Setup

Download the code or copy the git repository to your computer.

To install dependencies you need to run the following command in your terminal.

  npm install

Usage

Run live server extension in VSCode or run the index.html file in dist folder from the cloned repository.

Environmental Variables

To create your own environmental variable for your API Key create a .env file in your root folder. Add .env to your gitignore as well if not added.

In your .env file create a variable and assign your key to it.

    // .env file

    API_KEY=123Abc456DefG...
    API_KEY2=123Abc456DefG...

To use your API key use process.env and attach your API variable.

    weatherKey = process.env.API_KEY;

Compile and Run

After changing the code you will need to compile your work to be able to run.

Use these scripts to compile your work.

Build to compile once your code.

    npm run build

Watch script to compile everytime you make a change, great combination with live server extension.

    npm run watch

Authors

👤 Steven Jack Chung

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

About

Weather app to see your current city's weather or other countries as well. You can also change the temperature between Fahrenheit and Celsius. Built with JS and Unsplash API and OpenWeatherMap API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published