Git Product home page Git Product logo

intro-to-react-workshop's Introduction

Intro

Here is the project for Pyladies Bratislava meetup. The purpose of the project is to provide an understanding of the basics of React.js.

There are two folders:

  • final
  • starter

Starter

starter folder consists of the code to start the project for the workshop. All the code was generated by create-react-app and a few steps to clean the code has been done:

  • removed css files,
  • removed unneeded code in the App.js,
  • added .prettier file,
  • added eslint file,
  • added random background png image to the public/images
  1. In the terminal, go to the starter folder:
cd starter
  1. Install dependencies:
npm i
  1. Run the project:
npm start

The application runs on http://localhost:3000

  1. Add the key for the Open Map

We will be using the free Air Pollution API from openweathermap. API Documentation can be found here: https://openweathermap.org/api/air-pollution.

To get a key:

The generated personal key can be used and the best practice is to use it as environmental variable:

  • create .env file inside of the starter folder
  • assign the key to REACT_APP_OPEN_WEATHER_API_KEY as follows:
REACT_APP_OPEN_WEATHER_API_KEY=your-key-is-here

Now the key can be accessed in any part of the project as process.env.REACT_APP_OPEN_WEATHER_API_KEY

IMPORTANT: the .env file should not be committed, that's why it was added in .gitignore file.


Stories

We will implement step by step following user stories:

  1. As user I want to see the air quality for Bratislava.
  1. As user I want to type the name of the city in the input, click the "Show" button and the air quality index for the relevant city is displayed.
  1. As user I want to see interpretation of the air quality index as good/fair/moderate/poor/very poor

Final

final folder consists of the final version of the project. If you want to see the result, you can follow the same steps as above to run the code.

The final result looks as follows:

image


Resources

Main concepts of React.js:

A re-introduction to JS:

intro-to-react-workshop's People

Contributors

irina-baeva avatar

Watchers

 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.