{"id":22850553,"url":"https://github.com/iurysza/firebase-scaffold","last_synced_at":"2026-05-05T07:32:55.339Z","repository":{"id":96900834,"uuid":"291579941","full_name":"iurysza/firebase-scaffold","owner":"iurysza","description":"An opinionated architecture for Firebase Cloud Functions projects.","archived":false,"fork":false,"pushed_at":"2021-02-21T18:07:12.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T06:30:21.956Z","etag":null,"topics":["cloud-functions","firebase","serveless"],"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/iurysza.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":"2020-08-31T00:53:51.000Z","updated_at":"2021-02-21T18:08:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"c809d8f7-de47-43cf-9463-e20e58271118","html_url":"https://github.com/iurysza/firebase-scaffold","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iurysza/firebase-scaffold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ffirebase-scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ffirebase-scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ffirebase-scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ffirebase-scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iurysza","download_url":"https://codeload.github.com/iurysza/firebase-scaffold/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ffirebase-scaffold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cloud-functions","firebase","serveless"],"created_at":"2024-12-13T05:08:03.953Z","updated_at":"2026-05-05T07:32:55.323Z","avatar_url":"https://github.com/iurysza.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An opinionated firebase scaffold\n\n## Features\n\n- **[Improved cold start performance](#improved-cold-start)** - Cold start/boot time is one of the biggest issues many developers and companies come across when using cloud functions. This boilerplate uses the best practices to reduce the cold start time thus improving performance.\n\n- **[Multiple environments (local, dev, prod)](#service-accounts-and-environments)** - A simple convetion enables the same code to run on multiple environments.\n\n- **[Testability](#unit-tests)** - The recomended architecture enables simple unit tests with minimum external dependencies.\n\n- **[Straight foward deployment](#deploying)** - Running the code locally, or deploying to multiple environments should be simple. You run one command and your code is deployed in seconds.\n\n### Integration tests\n- Uses `dev service-account` and a `test schema` \n- The test schema is injected\n- use custom node script to run the tests \n\n#### Service-accounts and environments\nThis project supports two environments.\nOne is meant to be a development environment, `dev` and the other should be a production environment, `prod`.\n- `./firebaserc` defines alias for their firebase project id's\n- `./functions/service-account/` should have the respectives `service-account` [files](https://console.firebase.google.com/project/fir-test-iurysza-dev/settings/serviceaccounts/adminsdk)\n\t- `dev-service-account.json` for dev environment\n\t- `prod-service-account.json` for prod environment \n\n### Deploying \n- `build` runs the `Typescript` compiler\n- `serve` runs `build` and the `firebase` cli with emulators\n- `local` runs a `shell` script that makes sure we're using `dev` credentials\n- `deploy:staging` runs a `shell` script that makes sure we're using `dev` credentials\n- `deploy:prod` runs a `shell` script that makes sure we're using `prod` credentials\n\n\n## Documentation\n\n### Improved cold start performance\n\nCold start (Cold boot) time has been one of the [biggest issues](https://www.youtube.com/watch?v=IOXrwFqR6kY) many developers and companies come across when using cloud functions. This boilerplate uses the best practices to reduce the cold start time thus improving performance.\n\nBy taking advantage of TypeScripts [dynamic 'async' import](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-4.html#dynamic-import-expressions), this ensures unused code and imports and not loaded unncessarily during start time but only when the specific function is invoked.\n\n### Improved readability \u0026 developer experience\n\nUsing only one file, `index.js`, for everything doesn't work for a serious app. It becomes hard to scan through, hard to easily follow up with the code. This scaffold recognizes that and aims to solve that.\n\nThere have been a lot of ways suggested to split cloud functions properly, Firebase also has [suggestions](https://firebase.google.com/docs/functions/organize-functions), but it doesn't take into account the effect on the **cold start time**.\n\n### Express.js\n\nEvery Firebase HTTP function makes use of `express.js` underneath. Explicitly using it in structuring your endpoints has proved to more beneficial, both in structure and maximization of resources.\n\n- All your HTTP requests are now accessed through one Cloud Function. This helps with the \"Number of functions\" limit (which is 1,000), meaning no matter the number of endpoints you have, they would all count as one function.\n- Improves cold start time - Due to the way cloud functions are invoked, having all endpoints accessible through one function enables instances to be reused.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiurysza%2Ffirebase-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiurysza%2Ffirebase-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiurysza%2Ffirebase-scaffold/lists"}