{"id":27743482,"url":"https://github.com/mithatakbulut/firebase-express-sdk","last_synced_at":"2026-04-01T22:03:38.375Z","repository":{"id":186571127,"uuid":"675316072","full_name":"mithatakbulut/firebase-express-sdk","owner":"mithatakbulut","description":"Firestore Power for Your Express.js Apps","archived":false,"fork":false,"pushed_at":"2023-08-06T22:26:43.000Z","size":55,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T13:35:21.924Z","etag":null,"topics":["crud","express","firebase"],"latest_commit_sha":null,"homepage":"https://firebase-express-sdk.vercel.app/","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/mithatakbulut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-08-06T14:18:15.000Z","updated_at":"2023-08-08T11:41:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"254cafc5-b51a-4897-8677-4bb0c36db7bf","html_url":"https://github.com/mithatakbulut/firebase-express-sdk","commit_stats":null,"previous_names":["w1that/firebase-express-sdk","mithatakbulut/firebase-express-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mithatakbulut/firebase-express-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithatakbulut%2Ffirebase-express-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithatakbulut%2Ffirebase-express-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithatakbulut%2Ffirebase-express-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithatakbulut%2Ffirebase-express-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mithatakbulut","download_url":"https://codeload.github.com/mithatakbulut/firebase-express-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithatakbulut%2Ffirebase-express-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"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":["crud","express","firebase"],"created_at":"2025-04-28T17:44:06.284Z","updated_at":"2026-04-01T22:03:38.346Z","avatar_url":"https://github.com/mithatakbulut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase Express SDK \n\n[![https://nodei.co/npm/firebase-express-sdk.png?downloads=true\u0026downloadRank=true\u0026stars=true](https://nodei.co/npm/firebase-express-sdk.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/firebase-express-sdk)\n\n\nSimplify interaction with Firebase Firestore by using this SDK to easily set up and manage CRUD operations for collections, handle API endpoints, and streamline data retrieval and manipulation in your Express.js projects.\n\n![Uygulama Ekran Görüntüsü](https://i.ibb.co/dckKhNG/hero-image-2-2.png)\n\n\n## Quick Start\n\n### Set up an Express server\n\n```bash\nmkdir firebase-express-tutorial\ncd firebase-express-tutorial\n```\n\n```bash\nnpm init -y\n```\n\nInstall the dependencies\n\n```bash\nnpm install express cors body-parser\nnpm install -D nodemon\n```\n\nInstall the **Firebase Express SDK**:\n\n```bash\nnpm install firebase-express-sdk\n```\nCreate a new file named index.js and add the following code:\n  \n```js\nconst express = require(\"express\");\nconst cors = require(\"cors\");\nconst bodyParser = require(\"body-parser\");\nconst { FirebaseExpressSdk } = require(\"firebase-express-sdk\");\n\n// We will be back to this later\n```\n\n### Create a Firebase project\n\nGo to the [Firebase console](https://console.firebase.google.com/) and create a new project.\n\nAdd [Cloud Firestore](https://console.firebase.google.com/project/_/firestore) to your project.\n\n**For more details about setting up Cloud Firestore, check out the [official documentation](https://firebase.google.com/docs/firestore/quickstart).**\n\n### Generate a service account\n\nGo to the [service accounts page](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk) and generate a new private key.\n\nSave the file in your project directory and name it `serviceAccount.json`.\n\nThe project directory should look like this:\n\n```bash\n.\n├── node_modules\n├── serviceAccount.json\n├── index.js\n├── package.json\n└── package-lock.json\n```\n\n### Initialize the Firebase Express SDK\n\nAdd the following code to the `index.js` file:\n\n```js\nconst express = require(\"express\");\nconst cors = require(\"cors\");\nconst bodyParser = require(\"body-parser\");\nconst { FirebaseExpressSdk } = require(\"firebase-express-sdk\");\nconst serviceAccountFile = require(\"./serviceAccount.json\");\n\nconst app = express();\nconst port = 3001;\n\napp.use(cors());\napp.use(bodyParser.json());\n\nconst collections = {\n  users: {\n    documentAttributes: [\"name\", \"age\", \"email\"],\n  },\n};\n\nconst firebaseExpressSdk = new FirebaseExpressSdk({\n  app, // Express app\n  serviceAccountFile, // Firebase service account file\n  collections, // Collections to expose,\n  port, // Port to listen to (default: 3000)\n});\n\nfirebaseExpressSdk.addActions([\n  {\n    collection: \"users\",\n    endpoint: \"/api/getUsers\",\n    request: {\n      type: \"GET\",\n    },\n  },\n  {\n    collection: \"users\",\n    endpoint: \"/api/addUser\",\n    request: {\n      type: \"POST\",\n    },\n  },\n]);\n```\n\n### Start the server\n\nAdd the following script to the `package.json` file:\n\n```json\n\"scripts\": {\n  \"start\": \"nodemon index.js\"\n}\n```\n\nStart the server:\n\n```bash\nnpm start\n```\n\n### Test the endpoints and enjoy!\n\nMake a `GET` request to `http://localhost:3000/api/getUsers` and you should get an empty array.\n\nMake a `POST` request to `http://localhost:3000/api/addUser` with the following body:\n\n```json\n{\n  \"name\": \"John Doe\",\n  \"age\": 25,\n  \"email\": \"johndoe@john.com\"\n}\n``` \n\nMake a `GET` request to `http://localhost:3000/api/getUsers` and you should get the following response:\n\n```json\n{\n  \"status\": \"success\",\n  \"data\": [\n    {\n      \"name\": \"John Doe\",\n      \"age\": 25,\n      \"email\": \"johndoe@john.com\"\n    }\n  ]\n}\n```\n\nWe encourage you to explore the [Documents section](https://firebase-express-sdk.vercel.app/) for a deeper dive into the various features and functionalities of Firebase Express SDK.\n\n## Contributing\n\nWe value your contributions and look forward to working with you to enhance Firebase Express SDK.\n\nTo start contributing, take a look at [Contributing guide](https://github.com/w1that/firebase-express-sdk/blob/main/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithatakbulut%2Ffirebase-express-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmithatakbulut%2Ffirebase-express-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithatakbulut%2Ffirebase-express-sdk/lists"}