{"id":13798860,"url":"https://github.com/martyan/nextbase","last_synced_at":"2025-05-13T06:31:44.283Z","repository":{"id":38806994,"uuid":"189029370","full_name":"martyan/nextbase","owner":"martyan","description":"Minimalistic serverless boilerplate based on NextJS and Firebase 🔥","archived":true,"fork":false,"pushed_at":"2023-01-07T05:52:36.000Z","size":4558,"stargazers_count":15,"open_issues_count":20,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-04T00:03:31.759Z","etag":null,"topics":["authentication","boilerplate","firebase","full-stack","minimalistic","nextjs","react","serverless"],"latest_commit_sha":null,"homepage":"https://nextbase-e74ee.firebaseapp.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-28T13:01:54.000Z","updated_at":"2023-11-11T12:20:15.000Z","dependencies_parsed_at":"2022-09-18T09:12:45.225Z","dependency_job_id":null,"html_url":"https://github.com/martyan/nextbase","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martyan%2Fnextbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martyan%2Fnextbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martyan%2Fnextbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martyan%2Fnextbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martyan","download_url":"https://codeload.github.com/martyan/nextbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225183779,"owners_count":17434176,"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":["authentication","boilerplate","firebase","full-stack","minimalistic","nextjs","react","serverless"],"created_at":"2024-08-04T00:00:55.478Z","updated_at":"2024-11-18T13:31:37.614Z","avatar_url":"https://github.com/martyan.png","language":"JavaScript","funding_links":[],"categories":["웹"],"sub_categories":[],"readme":"# :policeman: Notice: Due to long cold-start times of Firebase functions I switched to deploy NextJS apps on Vercel. Therefore this repo is not about to be maintained anymore.\n\n### \u003ca href=\"https://nextbase-e74ee.firebaseapp.com/\"\u003eDemo\u003c/a\u003e\n\n### Boilerplate for React developers who wants to quick start a project in NextJS and Firebase\n\n\u003c!--Set-up, build and deploy in 10 minutes--\u003e\n\u003c!--Deploy this app in 5 minutes and start developing--\u003e\n\nBuild and deploy this boilerplate and start developing your project without need to build the whole infrastructure from scratch\n\nGreat for front-end developers, shipped with authentication and basic profile management out of the box\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Features\n- **Server Side Rendering** and **code splitting** out of the box\n- **Authentication** - email/password, social sign-in providers, basic profile management\n- **To-do list example**\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Stack\n- **Firebase** - Build apps fast, without managing infrastructure (database, storage, hosting, server)\n- **NextJS** - A minimalistic framework for universal server-rendered React applications\n- **Redux** - A predictable state container for JavaScript\n\nKeeping it minimal so you can choose your tech stack\n\nThanks to Firebase and NextJS you can scale up as your product grows\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Firebase set-up\n 1. Create a Firebase project using the [Firebase Console](https://console.firebase.google.com).\n 2. Add **web** app to project (don't set up hosting).\n 3. Copy Firebase config keys\n 4. Create `.env` file in the root dir with following content (replacing \u003cyour-key\u003e with copied values):\n ```\n FIREBASE_API_KEY=\u003cyour-key\u003e\n FIREBASE_AUTH_DOMAIN=\u003cyour-key\u003e\n FIREBASE_DATABASE_URL=\u003cyour-key\u003e\n FIREBASE_PROJECT_ID=\u003cyour-key\u003e\n FIREBASE_STORAGE_BUCKET=\u003cyour-key\u003e\n FIREBASE_MESSAGING_SENDER_ID=\u003cyour-key\u003e\n FIREBASE_APP_ID=\u003cyour-key\u003e\n GOOGLE_ANALYTICS_ID=\u003cyour-key\u003e\n ```\n 5. Create Firebase database in test mode\n 6. Create Firebase storage\n 7. In auth section set up email/password sign-in method (for more methods see below)\n 8. Allow [unauthenticated function invocation](https://cloud.google.com/functions/docs/securing/managing-access-iam#allowing_unauthenticated_function_invocation)\n \n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## In terminal\n 1. Clone or fork this repository.\n 1. Install deps `npm install`.\n 1. Install Firebase tools `npm install -g firebase-tools`\n 1. Login to Firebase `firebase login`\n 1. Add Firebase project `firebase use --add` and select your project\n 1. Deploy the app `npm run deploy` to Firebase hosting\n 1. `npm run dev` to run locally on http://localhost:3000 (Firebase functions must be deployed)\n\n### You're all set - now you can focus on actual coding of your project\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Social platform sign-in providers\nYou can add support for social platform sign-in providers easily.\n\nSet it in **Firebase Console** -\u003e **Authentication** -\u003e **Sign-in method**\n\n- [Set up Google sign-in method](https://firebase.google.com/docs/auth/web/google-signin)\n- [Set up Facebook sign-in method](https://firebase.google.com/docs/auth/web/facebook-login)\n\n\n\u003c!--## Sending emails via Gmail--\u003e\n\u003c!--To be able to send emails with your Gmail account--\u003e\n\u003c!--- enable access to **[Less Secure Apps](https://myaccount.google.com/lesssecureapps)** and **[Display Unlock Captcha](https://accounts.google.com/b/0/DisplayUnlockCaptcha)**--\u003e\n\u003c!--- for accounts with 2-step verification enabled **[Generate an App Password](https://support.google.com/accounts/answer/185833)**--\u003e\n\u003c!--- set account credentials in terminal:--\u003e\n\u003c!--```--\u003e\n\u003c!--firebase functions:config:set gmail.email=\"your@gmail.com\" gmail.password=\"youpassword\"--\u003e\n\u003c!--```--\u003e\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## Security rules\nGuard your data with rules that define who has access to it and how it is structured\n\n### Database (Firestore)\nhttps://firebase.google.com/docs/firestore/security/get-started\n\n### Storage\nhttps://firebase.google.com/docs/storage/security/start\n\nUse rules below to allow only images up to 3 MB\n```\nservice firebase.storage {\n  match /b/{bucket}/o {\n    match /{allPaths=**} {\n      allow read, write: if request.auth != null;\n    }\n\n    match /images/{imageId} {\n      // Only allow uploads of any image file that's less than 3MB\n      allow write: if request.resource.size \u003c 3 * 1024 * 1024\n                   \u0026\u0026 request.resource.contentType.matches('image/.*');\n    }\n  }\n}\n```\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n## More read\n- [Firebase](https://firebase.google.com/docs/web/setup)\n- [NextJS](https://nextjs.org/learn/basics/getting-started)\n\n\nNextbase was inspired by [this example](https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartyan%2Fnextbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartyan%2Fnextbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartyan%2Fnextbase/lists"}