{"id":28271836,"url":"https://github.com/pedrochamberlain/pwa-example","last_synced_at":"2026-02-16T11:04:41.788Z","repository":{"id":123099597,"uuid":"337480962","full_name":"pedrochamberlain/pwa-example","owner":"pedrochamberlain","description":"Build a Progressive Web Application from scratch.","archived":false,"fork":false,"pushed_at":"2021-02-10T04:06:35.000Z","size":1029,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T11:39:41.668Z","etag":null,"topics":["pwa","tutorial"],"latest_commit_sha":null,"homepage":"https://youtu.be/sFsRylCQblw","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrochamberlain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-09T17:22:48.000Z","updated_at":"2021-02-22T13:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"257c023b-ac61-414f-9c67-5c5360c3e251","html_url":"https://github.com/pedrochamberlain/pwa-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedrochamberlain/pwa-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrochamberlain%2Fpwa-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrochamberlain%2Fpwa-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrochamberlain%2Fpwa-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrochamberlain%2Fpwa-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrochamberlain","download_url":"https://codeload.github.com/pedrochamberlain/pwa-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrochamberlain%2Fpwa-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pwa","tutorial"],"created_at":"2025-05-20T18:22:50.088Z","updated_at":"2026-02-16T11:04:41.782Z","avatar_url":"https://github.com/pedrochamberlain.png","language":"HTML","readme":"# Building a Progressive Web Application from Scratch \n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"500px\" src=\"https://user-images.githubusercontent.com/3104648/28351989-7f68389e-6c4b-11e7-9bf2-e9fcd4977e7a.png\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://www.youtube.com/watch?v=sFsRylCQblw\"\u003eBased on a Fireship tutorial\u003c/a\u003e\n  \n## What is a PWA?\n- PWAs are browser based web applications (HTML5 / CSS / JavaScript). By using the latest browser features, they implement native app-typical capabilities and features, including all listed above. Running in a separate browser window without address bar, they are visually and functionally near-indistinguishable to apps. \n- \"Progressive\" means: A PWA must be designed to maintain basic functionality even if run offline and/or on a browser that does not support some features. \n- PWAs don’t install in the classical sense. An icon is added to the screen and advanced browser caching is used. The browser provides a secure execution environment to which PWAs are ‘installed’.\n- Service workers are a huge aspect of PWAs. They cache pages in order to view them offline. [Learn more on Service Workers \u0026 Caching here.](https://www.youtube.com/watch?v=ksXwaWHCW6k)\n\n## How to build a PWA\n1. Create the following files: `index.html`, `manifest.json`, `service-worker.js`. Download a logo for your PWA. [You can use mine.](https://github.com/pedrochamberlain/pwa-example/blob/main/logo.png)\n2. Reference `manifest.json` on `index.html`:\n```html\n\u003clink rel=\"manifest\" href=\"manifest.json\"\u003e\n```\n3. Load the service worker on `index.html`:\n```html\n\u003cbody\u003e\n  [...]\n  \u003cscript\u003e \n      if ('serviceWorker' in navigator) {\n          navigator.serviceWorker.register('/service-worker.js')\n      }\n  \u003c/script\u003e\n\u003c/body\u003e\n```\n4. Add some self-explanatory info to the app in your `manifest.json`. Here's an example:\n```json\n{\n    \"name\": \"PWA Example\",\n    \"short_name\": \"PWA Example\",\n    \"start_url\": \"/?home=true\",\n    \"icons\": [],\n    \"theme_color\": \"#000000\",\n    \"background_color\": \"#FFFFFF\",\n    \"display\": \"fullscreen\",\n    \"orientation\": \"portrait\"\n}\n```\nYou may question why `icons` has no values. Creating assets for a PWA can be quite a hassle because we have to resize the same icon for different devices. To facilitate our process, we'll use the [`pwa-asset-generator`](https://github.com/onderceylan/pwa-asset-generator) library. \n\nInstall the library and run the following command in your project's folder:\n```zsh\nnpx pwa-asset-generator logo.png icons\n```\n5. In `service-worker.js`, use Workbox, Google's PWA library, via CDN:\n```javascript\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/6.0.2/workbox-sw.js');\n\nworkbox.routing.registerRoute(\n  ({request}) =\u003e request.destination === 'image',\n  new workbox.strategies.CacheFirst()\n);\n```\n\nYour PWA is now ready to use!\n\nRun `npx serve` in your command line to test it up.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"450px\" src=\"https://imgur.com/gHpJ7iI.jpg\"\u003e\n\u003c/div\u003e\n\n\n## Browser Support\nBrowser|Windows|macOS|Android|iOS|\n-------|-------|-----|-------|---|\nChrome|Yes|Yes|Yes|Yes|\nFirefox|No|No|Partial|No|\nSafari|N/A|Yes|N/A|iOS 11.3+|\n\n*Last updated February 9th, 2021.*\n \n## Documentation\n- [Workbox – JavaScript library for PWAs](https://developers.google.com/web/tools/workbox/modules/workbox-sw)\n- [PWA Asset Generator - Automates asset generation and image declaration](https://github.com/onderceylan/pwa-asset-generator)\n- [PWA Tutorial – Fireship](https://www.youtube.com/watch?v=sFsRylCQblw)\n- [Intro To Service Workers \u0026 Caching - Traversy Media](https://www.youtube.com/watch?v=ksXwaWHCW6k)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrochamberlain%2Fpwa-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrochamberlain%2Fpwa-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrochamberlain%2Fpwa-example/lists"}