Skip to content

Fix #137 Chnaged backend url to localhost:5000 and updated docs to metion adb …#145

Open
DeveloperAmrit wants to merge 3 commits intoAOSSIE-Org:mainfrom
DeveloperAmrit:fix-issue-137-clean-2
Open

Fix #137 Chnaged backend url to localhost:5000 and updated docs to metion adb …#145
DeveloperAmrit wants to merge 3 commits intoAOSSIE-Org:mainfrom
DeveloperAmrit:fix-issue-137-clean-2

Conversation

@DeveloperAmrit
Copy link
Contributor

@DeveloperAmrit DeveloperAmrit commented Dec 29, 2025

…reverse command

Closes #137

📝 Description

Updated frontend .env file

  • Updated baseurl to use localhost instead of hardcoded ip

Updated Frontend/src/services/ConversationContext.js

  • Corrected the way to import environment variables
  • Replaced BASE_URL = ... by import import { BASE_URL } from '@env';

Updated Frontend/android/app/src/main/AndroidManifest.xml

  • Added android:usesCleartextTraffic="true" to allow use of localhost

Updated documentation

  • Tell user to do adb reverse tcp:5000 tcp:5000 when doing setup
  • Tell user to clear cache if he is encountering same networking error even after doing adb reverse

🔧 Changes Made

📷 Screenshots or Visual Changes (if applicable)

image

🤝 Collaboration

Collaborated with: @username (optional)

✅ Checklist

  • [ y] I have read the contributing guidelines.
  • [y ] I have added tests that prove my fix is effective or that my feature works.
  • [ y] I have added necessary documentation (if applicable).
  • [ y] 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 | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.
@Naren456
Copy link
Contributor

Naren456 commented Jan 14, 2026

Hi @DeveloperAmrit
Thanks for it.
but these are setup issue , not app related one.

tip :
if you want to solve real issue
work on backend .

@DeveloperAmrit
Copy link
Contributor Author

@Naren456 This PR is to solve a critical issue which prevents frontend from talking to backend. I am also working on the backend.

@Naren456
Copy link
Contributor

@DeveloperAmrit
ok,
Add a demo video with explaination of code which you have changed.

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

2 participants