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.
First you need to set up local development
npm install
Rename .env-sample
to .env
. Then run the app.
npm run dev
Then open https://localhost:3000.
Command line
npm run dev && npm run test
Interactive
npm run dev && npm run test:i
To make a new component you’ll need to make three files: the source code, the test, and the storybook demo.
- Source file. This goes in
src/components/New.js
, and should export astyled-component
withexport default New
at the end and the component’spropTypes
defined.
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.
- Action type. This goes in
src/stores/actionTypes.js
and should export the action type with value. - 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 constexport const actionFunction
. Every action should be exported fromsrc/stores/actions/index.js
as well. - 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 tosrc/stores/index.js
.