{"id":21644123,"url":"https://github.com/blaur/firebase-full-stack-starter","last_synced_at":"2026-04-12T06:34:42.461Z","repository":{"id":98606095,"uuid":"352776209","full_name":"blaur/firebase-full-stack-starter","owner":"blaur","description":"Simple Firebase Full-Stack Starter Template using Firebase Functions with NestJS and a React frontend.","archived":false,"fork":false,"pushed_at":"2021-07-20T13:23:44.000Z","size":396,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T12:41:46.070Z","etag":null,"topics":["firebase","nestjs","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/blaur.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-29T20:29:39.000Z","updated_at":"2022-07-29T07:32:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5f97804-1632-4d71-ae56-cc113a8e075b","html_url":"https://github.com/blaur/firebase-full-stack-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blaur/firebase-full-stack-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaur%2Ffirebase-full-stack-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaur%2Ffirebase-full-stack-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaur%2Ffirebase-full-stack-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaur%2Ffirebase-full-stack-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaur","download_url":"https://codeload.github.com/blaur/firebase-full-stack-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaur%2Ffirebase-full-stack-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31706765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["firebase","nestjs","reactjs","typescript"],"created_at":"2024-11-25T05:38:09.771Z","updated_at":"2026-04-12T06:34:42.442Z","avatar_url":"https://github.com/blaur.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\n\u003c/p\u003e\n\n\n  \u003cp align=\"center\"\u003eA simple Firebase Full-Stack Starter template with firebase functions as backend with NestJS. As frontend it has a simple react template that is deployable to Firebase Hosting. All in the same project to get you off the ground quickly.\u003c/p\u003e\n\n\n## Description\n\nThis is a simple Full-Stack Template that is using NestJS with Firebase Functions. It is configured as a monorepo (https://docs.nestjs.com/cli/monorepo) so that it is easily extenable with more apps (look at Adding Apps to see how to).\nFurthermore, the template has a react frontend that is also configured to be easily deploable to Firebase Hosting (https://firebase.google.com/docs/hosting).\nIn both the above, it has been configured to use eslint and prettifer and it also has a pre-commit hook using husky to ensure that linting is run on each commit.\n\nTest the api here: https://europe-west1-firebase-full-stack-starter.cloudfunctions.net/appDomainApi/\n\n## Folder Structure\n\n    .\n    ├── functions                    # NestJS backend for Firebase functions\n    │   ├── src                      # All source code\n    │       ├── apps                 # All NestJS app modules\n            ├── config               # Configuration for the backend\n            ├── libs                 # All NestJS libs\n            └── ...                  # etc.\n    └── react-frontend\n\n# NestJS Backend\n\n\n## Adding Apps and Libs\nSince this is just a NestJS project one can simply use the Nest CLI to generate new libs and apps according to the NestJS Docs. \n\nAdding a library can be done with:\n```bash\n$ cd functions/src\n$ nest g library my-library\n```\n\nTo add a new module then simply rujn the following:\n\n```bash\n$ cd functions/src\n$ nest generate app my-app-domain\n```\n\n## Configure Firebase Functions\nIn this project, there are three examples of firebase functions. \n1) Https On Request (hosting the NestJS api)\n2) Pubsub Topic On Publish Listener\n3) Pubsub Cloud Scheduler\n\n### On Request Function\n\nTo then wire it up with firebase use (look at apps/firebase-full-stack-starter/src/index.ts):\n\n```javascript\nconst expressServer = express();\n\nconst createFunction = async (expressInstance): Promise\u003cvoid\u003e =\u003e {\n  const app = await NestFactory.create(\n    AppDomainModule,\n    new ExpressAdapter(expressInstance),\n  );\n\n  await app.init();\n};\n\nexport const appDomainApi = functions\n  .region('europe-west1')\n  .https.onRequest(async (request, response) =\u003e {\n    await createFunction(expressServer);\n    expressServer(request, response);\n  });\n```\n\n### Pubsub Topic Handler\nUse the PubsubEventsService to register your topic. Provide the topic to listener for and then also the domain from where it should find the actual handler. The Pubsub Service will look for classes decorated with OnMessage with the topic: \n\n```javascript\n// Pubsub listening on 'my-event'\nexport const onMyEvent = PubsubEventsService.topic('my-event', AppDomainModule);\n\n......\n\n@Injectable()\nexport class MyEventListener {\n  constructor(private readonly logging: FirebaseLoggingService) {}\n\n  @OnMessage({\n    topic: 'my-event',\n  })\n  async onMyEventMessage(message: Message): Promise\u003cvoid\u003e {\n    this.logging.log(\n      `Handling my event and received message ${JSON.stringify(message)}`,\n    );\n  }\n}\n\n```\n\n\n\n### Pubsub Cloud Scheduler\nTo initiate the cloud schedule then first create a class with the PubsubScheduleInterface interface and instantiate it as seen here:\n\n```javascript\n// Pubsub scheduler\nexport const mySchedule = PubsubEventsService.schedule(\n  `every monday 06:00`,\n  AppDomainModule,\n  MyScheduleScheduler,\n);\n\n......\n\n@Injectable()\nexport class MyScheduleScheduler implements PubsubScheduleInterface {\n  constructor(private readonly logging: FirebaseLoggingService) {}\n\n  schedule(context: EventContext): Promise\u003cany\u003e {\n    this.logging.log(`We are now handling stuff in ${MyScheduleScheduler}`);\n\n    return null;\n  }\n}\n\n```\n\n\n## Installation\n\n```bash\n$ npm run install-all\n$ npm run build\n```\n\n## Deployment\nRemember to fetch your own service account for firebase admin and add it to to a dev-config.ts. Then you can run the following command which also injects it correctly to the config.ts\n\n```bash\n$ npm run deploy:dev\n```\n\n## Running the app\n\n```bash\n# development\n$ npm run start\n\n# watch mode\n$ npm run start:dev\n\n# production mode\n$ npm run start:prod\n```\n\n## Test\n\n```bash\n# unit tests\n$ npm run test\n\n# e2e tests (it runs only for one domain so add more if needed)\n$ test:app-domain::e2e\n\n# test coverage\n$ npm run test:cov\n```\n\n# React Frontend\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) template.\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\u003cbr /\u003e\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\u003cbr /\u003e\nYou will also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\u003cbr /\u003e\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\u003cbr /\u003e\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\u003cbr /\u003e\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Deployment\n\n```bash\n# Run linting on the react frontend\n$ npm run lint-react\n\n# Build and deploy\n$ npm run deploy:react-frontend:dev\n```\n\n# Stay in touch\n\n- Author - [Brian Bak Laursen](https://github.com/blaur/)\n\n# License\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaur%2Ffirebase-full-stack-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaur%2Ffirebase-full-stack-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaur%2Ffirebase-full-stack-starter/lists"}