Skip to content

Conversation

@DeveloperAmrit
Copy link
Contributor

@DeveloperAmrit DeveloperAmrit commented Dec 29, 2025

…reverse command

Closes #137

📝 Description

🔧 Changes Made

📷 Screenshots or Visual Changes (if applicable)

🤝 Collaboration

Collaborated with: @username (optional)

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Chores

    • Switched development API endpoint to use localhost for consistent local testing.
    • Enabled HTTP/cleartext traffic on Android to allow dev app communication.
    • Centralized environment URL usage across frontend services to remove duplication.
  • Documentation

    • Added a setup step describing how to forward the device port (adb reverse) and troubleshooting steps to reconnect the frontend to the local backend.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

Standardizes frontend API host usage by importing BASE_URL in ConversationContext.js, updates Frontend/.env to http://localhost:5000, enables cleartext HTTP in the Android manifest, and adds adb reverse instructions to Setup.md for connecting the Android emulator to the local backend.

Changes

Cohort / File(s) Summary
Environment Configuration
Frontend/.env
Updated BASE_URL from http://192.168.1.4:5000 to http://localhost:5000.
Android Manifest
Frontend/android/app/src/main/AndroidManifest.xml
Added android:usesCleartextTraffic="true" to the <application> element to allow cleartext (HTTP) traffic.
Service Layer
Frontend/src/services/ConversationContext.js
Added import { BASE_URL } from '@env' and replaced local inline BASE_URL literals with the imported BASE_URL for fetch calls.
Docs / Setup
Setup.md
Added step instructing adb reverse tcp:5000 tcp:5000 and troubleshooting notes to reconnect the emulator to the local backend and reset the RN cache.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped across the env and seam,

Replaced the host, then cleared the stream.
I opened ports and set the route,
Now emulator chats without a doubt.
🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions changing backend URL to localhost:5000 and updating docs for adb reverse, which aligns with the main changes in the PR.
Linked Issues check ✅ Passed All coding objectives from #137 are met: BASE_URL standardized across services, .env updated to localhost:5000, and ConversationContext.js imports from @env.
Out of Scope Changes check ✅ Passed All changes directly address issue #137: environment config updates, AndroidManifest cleartext traffic enable, centralized BASE_URL import, and adb reverse documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4d5927 and ab492d2.

📒 Files selected for processing (1)
  • Setup.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • Setup.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2d9f82 and 44f99bd.

📒 Files selected for processing (5)
  • Backend/chroma_db/chroma.sqlite3
  • Backend/my_chroma_db/chroma.sqlite3
  • Frontend/.env
  • Frontend/android/app/src/main/AndroidManifest.xml
  • Frontend/src/services/ConversationContext.js
🔇 Additional comments (3)
Frontend/src/services/ConversationContext.js (3)

318-320: LGTM: Consistent use of centralized BASE_URL.

The delete operation correctly uses the imported BASE_URL, eliminating the hardcoded endpoint that caused the original network failure.


355-359: LGTM: Consistent use of centralized BASE_URL.

The update operation correctly uses the imported BASE_URL, maintaining consistency with the centralized configuration approach.


6-7: Good: BASE_URL centralization is comprehensive across the codebase.

Importing BASE_URL from environment variables is consistently applied throughout the Frontend—no hardcoded endpoints remain, and all 21 component and service files follow the standardized pattern. This aligns with the PR objective of addressing issue #137.

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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44f99bd and c4d5927.

📒 Files selected for processing (1)
  • Setup.md

Added instructions for starting the API and adb reverse command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Network Error on Android & Inconsistent BASE_URL Configuration

1 participant