A Progressive Web Application to fetch Top News in Hong Kong. News results are from News API.
To cache third party responses and image assets, workbox-build
was useed to override the default service worker generated by create-react-app
, which will be run when building for production environment. In other words, service worker does not work in development mode. Please build the project to test.
- A simple PHP wrapper is written to secure the API key from frontend
- The PHP wrapper can be found inside
public/api
folder - You will need to register a News API key and add it to
.env
file'sNEWS_API_KEY
variable
- Developed using Node.js 12.16
npm start
npm run build
- Background sync
- Notification when there is update after background sync (Reference)
- Detect for device offline and inform user they are reading cached results
- Bookmark function (i.e. Local Storage)