Practice writing a weather card with React.js and tailwind CSS
The weather APP example refers to the reference book: 從 Hooks 開始,讓你的網頁 React 起來
Before running project, you should need to apply a authentication token
from https://opendata.cwb.gov.tw/
to fetch weather data
- Display current moment according the sunrise and sunset in that day
- Display current time
- Display current weather (wet, wind, temperature, description)
- Change theme based on moment
- Change weather icon according weather
- Functional components
- React hooks
- useState
- useEffect
- useCallback
- useMemo
- Custom hooks
- Tailwind CSS + Module css
- Light/Dark mode
- PWA supported
TODO list:
- Alias of import path
- css -> scss
- enums
- Detect user's location through user's browser
- Redux
Data source: https://opendata.cwb.gov.tw/dataset/astronomy?page=1
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.