{"id":18834575,"url":"https://github.com/controlplane-com/firebase-chat-demo","last_synced_at":"2026-01-26T12:30:17.708Z","repository":{"id":73206279,"uuid":"460582036","full_name":"controlplane-com/firebase-chat-demo","owner":"controlplane-com","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-27T22:14:58.000Z","size":21,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-30T07:42:28.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/controlplane-com.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":"2022-02-17T19:40:38.000Z","updated_at":"2022-02-17T19:56:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f6439b2-20e7-420b-a563-0decc26d5d56","html_url":"https://github.com/controlplane-com/firebase-chat-demo","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/controlplane-com%2Ffirebase-chat-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Ffirebase-chat-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Ffirebase-chat-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Ffirebase-chat-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/controlplane-com","download_url":"https://codeload.github.com/controlplane-com/firebase-chat-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768931,"owners_count":19693765,"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":[],"created_at":"2024-11-08T02:13:18.991Z","updated_at":"2026-01-26T12:30:17.667Z","avatar_url":"https://github.com/controlplane-com.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Control Plane - Firebase Demo\n\nThis project demonstrates the ability to deploy an application to Control Plane that utilizes:\n\n- Firebase Authentication\n- Firestore\n- reCAPTCHA v3\n\n## Prerequisites\n\n1. Existing Control Plane Org and GVC.\n2. Control Plane CLI: https://docs.controlplane.com/reference/cli\n3. Firebase Account: https://firebase.google.com/\n   \n## Steps to Deploy\n\n1. Clone current repository.\n2. Follow Step 1 in this guide to create a Firebase project and register your app: \n   1. https://firebase.google.com/docs/web/setup\n3. Using the `firebaseConfig` from the registration step, update the `initializeApp` method in the file `./src/app/firebase.js`.\n4. To configure Firebase authentication using Google:\n   1. Click `Authentication` in the left menu.\n   2. Click the `Get started` button.\n   3. Click the `Google` button.\n   4. Toggle the `Enable` button. Enter a project name and email (if required). Click `Save`.\n5. To configure a new Firestore database:\n   1. Click `Firestore Database` in the left menu.\n   2. Click the `Create Database` button.\n   3. Select `Start in test mode` and click `Next`.\n   4. Select a location and click `Enable`. It will take a few minutes to create.\n   5. Select `Rules` at the top menu and update the rule with the following and click `Publish`:\n        ```\n        rules_version = '2';\n        service cloud.firestore {\n        match /databases/{database}/documents {\n            match /messages/{message} {\n            allow read: if request.auth.uid != null;\n            allow write: if request.auth.uid != null;\n            }\n          }\n        }\n        ```   \n6. To configure reCAPTCHA v3:\n   1. Browse to: https://www.google.com/recaptcha/admin\n   2. The `Register a new site` page will be displayed or click the `+` button.\n   3. Enter the following:\n      1. Any name for the `Label`.\n      2. Select `reCAPTCHA v3`.\n      3. Enter `example.com` temporarily for the `Domains`. We'll add the real domain after creating the workload.\n      4. Accept the `Terms of Service` and `Send alerts..` and click `Submit`.\n      5. Save the `Site Key` and `Secret Key`.\n   4. Update the `active` method on Line 19 with the `Site Key`.\n   5. Return to the Firebase console for the project and select the gear icon to the right of the `Project Overview` and click `Project settings`.\n   6. Select `App Check` on the top menu bar.\n   7. Click the name of your `Web App`, click `reCAPTCHA`, enter the `Secret Key` and click `Save`.\n7. To deploy to Control Plane:\n   1. If necessary, authenticate using: `cpln login`.\n   2. Containerize the application and push the image to the org's private image repository using the command (substitute ORG_NAME with the target Org):\n      1. `cpln image build --name firebase-demo:1 --push --org ORG_NAME`\n   3. Create a workload using the command (substitute ORG_NAME with the target Org and GVC_NAME with the target GVC):\n      1. `cpln workload create --name firebase-demo --image //image/firebase-demo:1 --public --gvc GVC_NAME`\n      2. Take note of the `ENDPOINT` URL.\n8. Using the endpoint URL, the Firebase authentication's authorized domains must be updated.\n   1. Return to the Firebase console and click `Authentication` in the left menu.\n   2. Select `Sign-in method` from the top menu.\n   3. Click `Add domain`. Enter the endpoint URL and click `Add`.\n9. Using the endpoint URL, the reCAPTCHA v3 domain must be updated.\n   1.  Return to: https://www.google.com/recaptcha/admin\n   2.  Click the gear icon.\n   3.  In the `Domains` section, to the right of the `+`, enter the endpoint URL and press enter.\n   4.  Delete the `example.com` by clicking the `X` to the left of that domain.\n   5.  Scroll to the bottom and click `Save`.\n\n**The application has now been fully configured and ready to serve traffic.**\n\n- Browse to the endpoint URL and the application will be displayed. \n- Click the `Sign In` button to log in using your Google credentials. \n- Once logged in, you can enter a chat message. Those messages are persisted using Firestore and are pushed to other users logged into the chat application.\n- The header displays your name and the cloud provider that served the request.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplane-com%2Ffirebase-chat-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontrolplane-com%2Ffirebase-chat-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplane-com%2Ffirebase-chat-demo/lists"}