{"id":16969427,"url":"https://github.com/webmasterdevlin/nextjs-pwa-firebase-js","last_synced_at":"2025-03-21T18:46:43.741Z","repository":{"id":38762640,"uuid":"303331817","full_name":"webmasterdevlin/nextjs-pwa-firebase-js","owner":"webmasterdevlin","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T15:14:41.000Z","size":2189,"stargazers_count":0,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T13:41:57.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"nextjs-pwa-firebase-demo.vercel.app","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterdevlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-12T08:48:49.000Z","updated_at":"2020-10-12T15:42:59.000Z","dependencies_parsed_at":"2022-08-27T07:51:07.300Z","dependency_job_id":null,"html_url":"https://github.com/webmasterdevlin/nextjs-pwa-firebase-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"tomsoderlund/nextjs-pwa-firebase-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fnextjs-pwa-firebase-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fnextjs-pwa-firebase-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fnextjs-pwa-firebase-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fnextjs-pwa-firebase-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterdevlin","download_url":"https://codeload.github.com/webmasterdevlin/nextjs-pwa-firebase-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852322,"owners_count":20521151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-14T00:25:11.303Z","updated_at":"2025-03-21T18:46:43.720Z","avatar_url":"https://github.com/webmasterdevlin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js serverless PWA with Firebase and React Hooks\n\n![nextjs-pwa-firebase-boilerplate demo on phone](docs/github_preview.jpg)\n\n_Note: this is my v4 boilerplate for React web apps. See also [nextjs-pwa-graphql-sql-boilerplate](https://github.com/tomsoderlund/nextjs-pwa-graphql-sql-boilerplate), [nextjs-sql-rest-api-boilerplate](https://github.com/tomsoderlund/nextjs-sql-rest-api-boilerplate) and [nextjs-express-mongoose-crudify-boilerplate](https://github.com/tomsoderlund/nextjs-express-mongoose-crudify-boilerplate)._\n\n\n## Why is this awesome?\n\nThis is a great template for a any project where you want **React (with Hooks)** (with server-side rendering, powered by [Next.js](https://github.com/zeit/next.js)) as frontend and **Firebase** as backend.\n_Lightning fast, all JavaScript._\n\n* Great starting point for a [PWA (Progressive Web App)](https://en.wikipedia.org/wiki/Progressive_web_applications), which you can add to your Home Screen and use as a full-screen app.\n* PWA features such as `manifest.json` and offline support (`next-offline`).\n* Can be deployed as [serverless functions on Vercel/Zeit Now](#deploying-serverless-on-vercelzeit-now).\n* The new Firebase database, [Cloud Firestore](https://firebase.google.com/docs/firestore), as database.\n* Login/Signup with Firebase Authentication.\n* React Hooks for business logic.\n* Free-form database model. No GraphQL or REST API, just add React Hooks and modify `[page].getServerSideProps` (for server-side rendering, SSR) when changing/adding database tables.\n* Easy to style the visual theme using CSS (e.g. using [Design Profile Generator](https://tomsoderlund.github.io/design-profile-generator/)).\n* `sitemap.xml` and `robots.txt` support.\n* Google Analytics and `google-site-verification` support (see `config/config.js`).\n* Flexible configuration with `config/config.js` and `.env.local` file.\n* Code linting and formatting with StandardJS (`yarn lint`/`yarn fix`).\n* Unit testing with Jasmine (`yarn unit`, not yet included).\n* Great page speed, see [Lighthouse](https://developers.google.com/web/tools/lighthouse) score:\n\n![Lighthouse score](docs/lighthouse_score.png)\n\n## Demo\n\nSee [**nextjs-pwa-firebase-boilerplate** running on Vercel/Zeit Now here](https://nextjs-pwa-firebase-boilerplate.vercel.app/).\n\n![nextjs-pwa-firebase-boilerplate demo on phone](docs/demo.jpg)\n\n## Deploying\n\nSetup and deploy your own project using this template with [Vercel](https://vercel.com). All you'll need is your Firebase Public API Key.\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Ftomsoderlund%2Fnextjs-pwa-firebase-boilerplate\u0026env=NEXT_PUBLIC_FIREBASE_API_KEY\u0026envDescription=Enter%20your%20public%20Firebase%20API%20Key\u0026envLink=https://github.com/tomsoderlund/nextjs-pwa-firebase-boilerplate#deploying-with-vercel)\n\n## How to use\n\n\u003e Note: If you set up your project using the Deploy button above, you only need to clone your own repo instead of this repository.\n\nClone this repository:\n\n    git clone https://github.com/tomsoderlund/nextjs-pwa-firebase-boilerplate.git [MY_APP]\n\nRemove the .git folder since you want to create a new repository\n\n    rm -rf .git\n\nInstall dependencies:\n\n    cd [MY_APP]\n    yarn  # or npm install\n\nSet up the database:\n\nConfigure the `.env.local` file.\n\nStart it by doing the following:\n\n    yarn dev  # or 'yarn vercel' to run with Vercel/Zeit Now serverless\n\nIn production:\n\n    yarn build\n    yarn start\n\nIf you navigate to `http://localhost:3004/` you will see a web page with a list of articles (or an empty list if you haven’t added one).\n\n## Modifying the app to your needs\n\n### Change app name\n\nDo search/replace for “nextjs-pwa-firebase-boilerplate” to something else.\n\nChange name in `public/manifest.json`\n\n### Renaming “Article” to something else\n\nThe database item is called “Article”, but you probably want something else in your app.\n\nRename the files:\n\n    mv hooks/articles.js hooks/{newName}s.js\n\n    mkdir -p components/{newName}s\n    mv components/articles/ArticleList.js components/{newName}s/{NewName}List.js\n    mv components/articles/ArticleListItem.js components/{newName}s/{NewName}ListItem.js\n    mv components/articles/ArticleDetails.js components/{newName}s/{NewName}Details.js\n    rm -r components/articles\n\n    mkdir pages/{newName}s\n    mv \"pages/articles/[article].js\" \"pages/{newName}s/[{newName}].js\"\n    rm -r pages/articles\n\nThen, do search/replace inside the files for different casing: `article`, `Article`, `ARTICLE`.\n\n### Change port number\n\nDo search/replace for “3004” to something else.\n\n### How to remove/replace database\n\nDelete `lib/firebase.js` and modify `hooks/articles.js`.\n\n### Change visual theme (CSS)\n\n1. Change colors in `public/manifest.json`\n2. Change CSS in `public/app.css`\n3. Change font(s) in `PageHead.js`\n\n### Login/Signup with Firebase Authentication\n\nYou need to enable Email/Password authentication in https://console.firebase.google.com/u/0/project/MYAPP/authentication/providers\n\nTODO: add SSR support: https://github.com/vercel/next.js/tree/canary/examples/with-firebase-authentication\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Fnextjs-pwa-firebase-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterdevlin%2Fnextjs-pwa-firebase-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Fnextjs-pwa-firebase-js/lists"}