{"id":21054101,"url":"https://github.com/adamcohenhillel/simple_fastapi_with_firebase","last_synced_at":"2025-04-12T17:20:37.930Z","repository":{"id":106940994,"uuid":"581284904","full_name":"adamcohenhillel/simple_fastapi_with_firebase","owner":"adamcohenhillel","description":"Simple FastAPI App with Firebase Authentication","archived":false,"fork":false,"pushed_at":"2022-12-22T19:42:47.000Z","size":12,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T12:53:50.969Z","etag":null,"topics":["fastapi","firebase","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamcohenhillel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-12-22T19:04:55.000Z","updated_at":"2025-02-05T16:45:59.000Z","dependencies_parsed_at":"2024-04-22T08:02:08.821Z","dependency_job_id":null,"html_url":"https://github.com/adamcohenhillel/simple_fastapi_with_firebase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcohenhillel%2Fsimple_fastapi_with_firebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcohenhillel%2Fsimple_fastapi_with_firebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcohenhillel%2Fsimple_fastapi_with_firebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcohenhillel%2Fsimple_fastapi_with_firebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamcohenhillel","download_url":"https://codeload.github.com/adamcohenhillel/simple_fastapi_with_firebase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602366,"owners_count":21131626,"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":["fastapi","firebase","python"],"created_at":"2024-11-19T16:11:45.696Z","updated_at":"2025-04-12T17:20:37.894Z","avatar_url":"https://github.com/adamcohenhillel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple FastAPI with Firebase Authentication\nI always start my projects with a baseline that includes user management, which I handle using Firebase. This repository contains the most basic FastAPI application that I use as a starting point for new projects.\n\n##### Now:\n- Set up a FastAPI app\n- Basic exception handeling\n- Connected to a Firebase Auth Project (user management)\n- \"Protected\" API Endpoint (which requires user auth)\n\n\n#####  In the Future:\n- basic SQLAlchemy, Redis setups / connectors\n- Simple CI to add tests easily and run them in GitHub actions\n\n\n----------\n### Setup:\nFirst, make sure you have a Firebase project, with Auth app:\n```\nhttps://firebase.google.com/docs/auth\n```\n\nThen, clone the repo:\n```\ngit clone https://github.com/adamcohenhillel/simple_fastapi_with_firebase.git\n```\n\nInstall dependencies:\n```\ncd simple_fastapi_with_firebase\npython3 -m pip install -r requirements.txt\n```\n\nSet environment variables [for Firebase]:\nfor fulle explanation, read: https://firebase.google.com/docs/admin/setup#add-sdk\n```\nexport GOOGLE_APPLICATION_CREDENTIALS=\"/home/user/Downloads/service-account-file.json\"\n```\n\n##### And run:\n```\npython3 run_api.py\n```\n\n### How to test the protected endpoint:\n1. Create a user in your Firebase Auth App\n\n2. Genertae a TokenID\n```\nPOST https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[WEBAPIKEY]\n{\n\t\"email\": \"email@gmail.com\",\n\t\"password\":\"password\",\n\t\"returnSecureToken\":true\n}\n```\n\n3. Send a request to your FastAPI protected endpoint\n```\nGET http://127.0.0.1:8000/api/simple_router/firebase_user\nAuthorization: TokenID\n```\n\n\n### License:\nMIT, enjoy :)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamcohenhillel%2Fsimple_fastapi_with_firebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamcohenhillel%2Fsimple_fastapi_with_firebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamcohenhillel%2Fsimple_fastapi_with_firebase/lists"}