I have reviewed all user-facing HTML files (index.html, `login.html…#1
Open
ilhamnih12 wants to merge 11 commits intomainfrom
Open
I have reviewed all user-facing HTML files (index.html, `login.html…#1ilhamnih12 wants to merge 11 commits intomainfrom
index.html, `login.html…#1ilhamnih12 wants to merge 11 commits intomainfrom
Conversation
…`, `register.html`) and confirmed that all text is in Indonesian and the 'Created by Edinst' copyright notice is present on all pages. The frontend update tasks are complete.
✅ Deploy Preview for dainty-halva-7e6f80 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…lling mechanism in `app.js`. The application will now fetch new messages every 3 seconds.
✅ Deploy Preview for priv-chats ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…lling mechanism in `app.js`. The application will now fetch new messages every 3 seconds.
- Replaced Supabase with Firebase for authentication and database to enable real-time chat functionality. - Implemented Firestore real-time listeners (`onSnapshot`) to display messages instantly. - Updated Netlify serverless function to use the Firebase Admin SDK for sending messages. - Overhauled the entire UI with a modern design, including new fonts, a new color scheme, and improved layouts for chat and authentication pages. - Fixed a potential Netlify build issue related to environment variable handling.
Deleted the obsolete `get-messages.js` function. This file was a leftover from the previous Supabase implementation and was causing the Netlify build to fail because its dependency (`@supabase/supabase-js`) was no longer present in `package.json`.
Changed the keys in the credential object from camelCase (e.g., `projectId`) to snake_case (e.g., `project_id`) in `netlify/functions/send-message.js`. This fixes the `app/invalid-credential` error where the Firebase Admin SDK was not able to find the `project_id` property.
Changed the quotes for the `FIREBASE_PRIVATE_KEY` in `netlify.toml` to triple quotes (`"""`). This fixes the TOML parsing issue that prevented environment variables from being loaded into the Netlify function's runtime, which was the root cause of the `app/invalid-credential` error.
Removed the Firebase credentials from the `netlify.toml` file. The environment variables will now be managed exclusively through the Netlify UI dashboard for better security and reliability.
Re-added the `.replace(/\n/g, '\n')` call to the `FIREBASE_PRIVATE_KEY` environment variable. This is necessary because Netlify's UI-based environment variables store multi-line strings with escaped `\n` characters. This change correctly formats the private key before passing it to the Firebase Admin SDK, fixing the `Invalid PEM formatted message` error.
Refactored the Firebase Admin SDK initialization in `send-message.js` to use a single environment variable `FIREBASE_SERVICE_ACCOUNT_JSON`. This new approach is more robust and avoids all the parsing and formatting issues with the private key that were causing deployment to fail. The function now parses the entire service account credentials from a single JSON string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…
,register.html`) and confirmed that all text is in Indonesian and the 'Created by Edinst' copyright notice is present on all pages. The frontend update tasks are complete.