Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update local environment setup guide #3224

Merged
merged 4 commits into from
Dec 14, 2024

Conversation

ild0tt0re
Copy link
Contributor

Description

I updated the local setup guide to clarify that the "Firebase name" refers to the Firebase project ID and removed references to old branches since the repository is now aligned with the master branch.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

coderabbitai bot commented Dec 14, 2024

Walkthrough

The pull request introduces modifications to the environment configuration and local setup documentation. The .env.example file has been updated with Firebase-related environment variables, adding VITE_FIREBASE_AUTH_EMULATOR_HOST, VITE_FIREBASE_AUTHDOMAIN, VITE_FIREBASE_MESSAGINGSENDERID, and VITE_FIREBASE_PROJECTID, while removing VITE_FIREBASE_APIKEY. The LOCAL_ENVIRONMENT_SETUP.md documentation has been revised to provide more detailed instructions for local environment setup, including updates to OpenJDK version, repository cloning, and Firebase emulator configuration.

Changes

File Change Summary
.env.example - Added VITE_FIREBASE_AUTH_EMULATOR_HOST environment variable
- Added VITE_FIREBASE_AUTHDOMAIN environment variable
- Added VITE_FIREBASE_MESSAGINGSENDERID environment variable
- Added VITE_FIREBASE_PROJECTID environment variable
- Removed VITE_FIREBASE_APIKEY environment variable
LOCAL_ENVIRONMENT_SETUP.md - Updated OpenJDK version from 21 to 23
- Added direct repository links for API and frontend projects
- Refined Firebase project ID setup instructions
- Expanded Firebase emulator setup guidance
- Clarified environment variable configuration process

The changes primarily focus on improving the local development environment setup and Firebase configuration documentation.

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Dec 14, 2024

Deploy Preview for staging-organized failed.

Name Link
🔨 Latest commit 82537c8
🔍 Latest deploy log https://app.netlify.com/sites/staging-organized/deploys/675d7fdf205418000861f888

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
LOCAL_ENVIRONMENT_SETUP.md (2)

75-77: Improve clarity and grammar in cloning instructions

The current text has some grammatical issues and could be more concise.

-3. The next step is to clone each of these projects using the `git clone` command. Using the direct GitHub repository URL from the [sws2apps organization](https://github.com/sws2apps), or you can also clone from your own fork if you already have one.
-4. Let's start by cloning the [API project](https://github.com/sws2apps/sws2apps-api). This should be a quick process as the **sws2apps-api** repository is relatively small.
-5. With the API project cloned, let's move on to the [frontend project](https://github.com/sws2apps/organized-app), the **Organized app** itself. Please note that this repository is quite large so the cloning process may take more time.
+3. Clone each project using the `git clone` command. You can use either the direct GitHub repository URL from the [sws2apps organization](https://github.com/sws2apps) or your own fork if you have one.
+4. First, clone the [API project](https://github.com/sws2apps/sws2apps-api). This is a relatively small repository.
+5. Next, clone the [frontend project](https://github.com/sws2apps/organized-app), the **Organized app** itself. Note that this repository is larger, so the cloning process will take longer.
🧰 Tools
🪛 LanguageTool

[style] ~77-~77: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...lf. Please note that this repository is quite large so the cloning process may take more ti...

(EN_WEAK_ADJECTIVE)


[uncategorized] ~77-~77: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...note that this repository is quite large so the cloning process may take more time....

(COMMA_COMPOUND_SENTENCE_2)


138-138: Clarify Firebase project ID instructions

The explanation about finding the Firebase project ID could be more structured.

-4. Let's move on to the Firebase environment variables. For **FIREBASE_APP_NAME,** use the project id assigned to your firebase project. You can get it from the URL (ie: `organized-app-47c7u` from `https://console.firebase.google.com/u/1/project/organized-app-47c7u/overview`). Alternatively, you can go to **Settings,** then **General,** and find the `Project ID`.
+4. For the **FIREBASE_APP_NAME** variable, use your Firebase project ID. You can find it in two ways:
+   - From the Firebase Console URL: Example - `organized-app-47c7u` from `https://console.firebase.google.com/u/1/project/organized-app-47c7u/overview`
+   - From Firebase Console: Navigate to **Settings** > **General** > **Project ID**
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a8161d and c10fa3c.

📒 Files selected for processing (2)
  • .env.example (1 hunks)
  • LOCAL_ENVIRONMENT_SETUP.md (7 hunks)
🧰 Additional context used
🪛 LanguageTool
LOCAL_ENVIRONMENT_SETUP.md

[style] ~77-~77: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...lf. Please note that this repository is quite large so the cloning process may take more ti...

(EN_WEAK_ADJECTIVE)


[uncategorized] ~77-~77: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...note that this repository is quite large so the cloning process may take more time....

(COMMA_COMPOUND_SENTENCE_2)

Comment on lines +54 to +55
1. Go to the [OpenJDK download page](https://www.oracle.com/java/technologies/downloads/) and select the version you prefer. As of now, versions 23 and 21 are available. We'll choose version 23 in this guide, but version 21 will work equally well, as Firebase Emulators need at least version 11.
2. Now, proceed to download OpenJDK, version 23.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update OpenJDK version information

The text mentions "versions 23 and 21 are available" but presents it as a current state. To make this documentation more maintainable, consider:

-1. Go to the [OpenJDK download page](https://www.oracle.com/java/technologies/downloads/) and select the version you prefer. As of now, versions 23 and 21 are available. We'll choose version 23 in this guide, but version 21 will work equally well, as Firebase Emulators need at least version 11.
+1. Go to the [OpenJDK download page](https://www.oracle.com/java/technologies/downloads/) and select any version 11 or higher (Firebase Emulators requirement). This guide uses version 23, but newer versions should work equally well.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Go to the [OpenJDK download page](https://www.oracle.com/java/technologies/downloads/) and select the version you prefer. As of now, versions 23 and 21 are available. We'll choose version 23 in this guide, but version 21 will work equally well, as Firebase Emulators need at least version 11.
2. Now, proceed to download OpenJDK, version 23.
1. Go to the [OpenJDK download page](https://www.oracle.com/java/technologies/downloads/) and select any version 11 or higher (Firebase Emulators requirement). This guide uses version 23, but newer versions should work equally well.
2. Now, proceed to download OpenJDK, version 23.

@@ -212,7 +209,7 @@ Let’s proceed on this journey as if we were a new user:
3. Great, the authentication for your account is now complete.
4. Now, let’s create a congregation. Enter a fictitious first and last name.
5. Let’s select a country for our testing. Then, find a congregation using a congregation name or number and click ‘Create congregation’.
6. Now, you’ll be prompted to create an encryption code. Remember, in this new version, the encryption code is required after creating your congregation account. This feature doesn’t exist in the older ‘Congregation Program for Everyone’ version, but in ‘Organized’, it’s an important step to start using the app.
6. Now, you’ll be prompted to create an encryption code. Remember, in this new version, **the encryption code is required** after creating your congregation account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Highlight encryption code requirement

The encryption code requirement is a critical security feature that deserves more emphasis.

-6. Now, you'll be prompted to create an encryption code. Remember, in this new version, **the encryption code is required** after creating your congregation account.
+6. You'll be prompted to create an encryption code. This is a critical security feature:
+   - The encryption code is mandatory in this version
+   - It protects your congregation's sensitive data
+   - Store this code securely as it cannot be recovered if lost
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
6. Now, you’ll be prompted to create an encryption code. Remember, in this new version, **the encryption code is required** after creating your congregation account.
6. You'll be prompted to create an encryption code. This is a critical security feature:
- The encryption code is mandatory in this version
- It protects your congregation's sensitive data
- Store this code securely as it cannot be recovered if lost

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
LOCAL_ENVIRONMENT_SETUP.md (3)

75-77: Improve clarity of repository cloning instructions

The sentence structure could be clearer, and there's a missing article.

Apply these changes:

-3. The next step is to clone each of these projects using the `git clone` command. Using the direct GitHub repository URL from the [sws2apps organization](https://github.com/sws2apps), or you can also clone from your own fork if you already have one.
+3. The next step is to clone each of these projects using the `git clone` command. You can use either the direct GitHub repository URL from the [sws2apps organization](https://github.com/sws2apps) or clone from your own fork if you already have one.
-4. Let's start by cloning the [API project](https://github.com/sws2apps/sws2apps-api). This should be a quick process as the **sws2apps-api** repository is relatively small.
+4. Let's start by cloning the [API project](https://github.com/sws2apps/sws2apps-api). This should be a quick process, as the **sws2apps-api** repository is relatively small.
🧰 Tools
🪛 LanguageTool

[style] ~77-~77: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...lf. Please note that this repository is quite large so the cloning process may take more ti...

(EN_WEAK_ADJECTIVE)


[uncategorized] ~77-~77: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...note that this repository is quite large so the cloning process may take more time....

(COMMA_COMPOUND_SENTENCE_2)


138-144: Enhance Firebase configuration instructions

The Firebase setup instructions are improved but could be more structured.

Consider reorganizing this section:

-4. Let's move on to the Firebase environment variables. For **FIREBASE_APP_NAME,** use the project id assigned to your firebase project. You can get it from the URL (ie: `organized-app-47c7u` from `https://console.firebase.google.com/u/1/project/organized-app-47c7u/overview`). Alternatively, you can go to **Settings,** then **General,** and find the `Project ID`.
+4. For the Firebase environment variables:
+   a. Set **FIREBASE_APP_NAME** to your Firebase project ID, which you can find:
+      - In the project URL: e.g., `organized-app-47c7u` from `https://console.firebase.google.com/u/1/project/organized-app-47c7u/overview`
+      - Or in **Project Settings** > **General** > **Project ID**
+
+5. For **GOOGLE_CONFIG_BASE64**, follow these steps to securely convert your private key:
+   a. Open Node.js in your terminal by typing `node`
+   b. Create a variable with your private key JSON contents:
+      ```javascript
+      const firebaseConfig = // Paste your JSON here
+      ```
+   c. Convert to base64:
+      ```javascript
+      Buffer.from(JSON.stringify(firebaseConfig)).toString('base64')
+      ```
+   d. Copy the output to **GOOGLE_CONFIG_BASE64**

168-170: Consolidate frontend setup steps

The frontend setup instructions are fragmented.

Suggest combining these steps:

-1. Open the frontend project folder (`organized-app` repo) in VS Code and open a new Terminal.
-2. Install the dependencies by typing `npm i`.
-3. After a while, installation is complete.
+1. Set up the frontend project:
+   a. Open the `organized-app` folder in VS Code
+   b. Open a new Terminal
+   c. Install dependencies with `npm i`
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c10fa3c and 640e6e0.

📒 Files selected for processing (2)
  • .env.example (1 hunks)
  • LOCAL_ENVIRONMENT_SETUP.md (6 hunks)
🧰 Additional context used
🪛 LanguageTool
LOCAL_ENVIRONMENT_SETUP.md

[style] ~77-~77: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...lf. Please note that this repository is quite large so the cloning process may take more ti...

(EN_WEAK_ADJECTIVE)


[uncategorized] ~77-~77: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...note that this repository is quite large so the cloning process may take more time....

(COMMA_COMPOUND_SENTENCE_2)

🔇 Additional comments (3)
.env.example (1)

3-7: LGTM! Improved Firebase configuration structure

The changes improve security and clarity by:

  • Removing the API key from example file (good security practice)
  • Adding essential Firebase configuration variables
  • Including emulator host configuration for local development
LOCAL_ENVIRONMENT_SETUP.md (2)

54-55: OpenJDK version information needs maintenance-friendly update

The current text about OpenJDK versions will become outdated quickly.


202-202: Enhance encryption code requirement explanation

The encryption code requirement needs more emphasis on its importance.

Copy link

sonarcloud bot commented Dec 14, 2024

@rhahao rhahao merged commit 5890163 into sws2apps:main Dec 14, 2024
10 of 14 checks passed
Copy link

cypress bot commented Dec 14, 2024

organized-app    Run #1809

Run Properties:  status check passed Passed #1809  •  git commit 5890163b96: docs: update local environment setup guide
Project organized-app
Branch Review main
Run status status check passed Passed #1809
Run duration 00m 05s
Commit git commit 5890163b96: docs: update local environment setup guide
Committer Angelo Annunziata
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 1
View all changes introduced in this branch ↗︎

@rhahao
Copy link
Member

rhahao commented Dec 15, 2024

🎉 This PR is included in version 3.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants