Giter Site home page Giter Site logo

next-weather's Introduction

NEXT WEATHER

NextJS App for checking current weather in certain area. It will Use current IP Address as default geolocation provider using https://ip4.seeip.org. Browser's geolocation API is optional.

Development

First you need to set up local development

Install dependencies

npm install

Setup on local

Rename .env-sample to .env. Then run the app.

Running on local machine

npm run dev

Then open https://localhost:3000.


Testing

Command line

npm run dev && npm run test

Interactive

npm run dev && npm run test:i

Creating a New Component

To make a new component you’ll need to make three files: the source code, the test, and the storybook demo.

  1. Source file. This goes in src/components/New.js, and should export a styled-component with export default New at the end and the component’s propTypes defined.

State Management

This web use Redux as the state management in order to spread data used by application to all component and page. Redux is described in 2 part, action and reducer, in order to create new state management for some pages or components you'll need to create: action type, action, and reducer.

  1. Action type. This goes in src/stores/actionTypes.js and should export the action type with value.
  2. Action. Action is used by page or component when page or component wants to do something with the state management store. It should be located at src/stores/actions/newAction.js with camelCase. Every action function should be a exported const export const actionFunction. Every action should be exported from src/stores/actions/index.js as well.
  3. Reducer. Reducer is part of store which contain the state in application. This goes in src/stores/reducers/index.js. After create new object property in reducer initialState, you should add the new object property again to src/stores/index.js.

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.