-
Use the Weatherbit API
-
Select a city in Australia and get the 5-day weather forecast. The detail of the cities is stored under
storage/app/city.json
temporary. If there is a table for setting/config in the database, the data should be stored into the database instead of a file. -
Back-end:
-
You could use the command below to see the output report.
php artisan weather:report [city,city,city]
If the city does not exist, you would get an error message.
-
Implement the WeatherController for API request with request validation.
-
Use Cache to store the forecast data for only one day. Once you send a request to get the forecast data, the data would be cached and the future requests for that data(city) can be served faster.
-
Implement the WeatherService interface, so you could change the weather API by implement the interface.
-
Use TravisCI to run testing and use StyleCI for coding style fixer.
-
Store the icon/pic under the
public/image
directory at this stage. The better way to practice is using AWS services like S3/CloudFront.
-
-
Front-end:
- Use React Hook + Tailwind to build the front end layout.
- Implement RWD.
- Import Momentjs, propTypes.
cp .env.example .env // Need to update the WEATHERBIT_KEY
composer install
php artisan key:generate
npm install
npm run dev
php artisan serve
./vender/bin/phpunit