Skip to content

fix: route Modi script OCR upload to FastAPI NLP Orchestrator (port 8…#693

Open
Kritika200520 wants to merge 1 commit into
viru0909-dev:mainfrom
Kritika200520:main
Open

fix: route Modi script OCR upload to FastAPI NLP Orchestrator (port 8…#693
Kritika200520 wants to merge 1 commit into
viru0909-dev:mainfrom
Kritika200520:main

Conversation

@Kritika200520
Copy link
Copy Markdown

Description

When attempting to upload a Modi script document for OCR scanning, the frontend incorrectly sent the upload request to the Spring Boot backend server (port 8080) instead of the FastAPI NLP Orchestrator service (port 8001), resulting in an immediate 404 Not Found error.

This PR introduces NLP_BASE_URL in the frontend API configuration to cleanly target port 8001 for machine learning & OCR microservices, and updates the OCR scanner component to utilize it.

Changes:

  • apiConfig.js: Added and exported NLP_BASE_URL pointing to the FastAPI NLP Orchestrator (port 8001 locally, with fallback/production configuration support).
  • VakilFriendPage.jsx: Imported NLP_BASE_URL and updated the /ocr/modi POST endpoint call in handleOCRUpload to route to the correct FastAPI ML orchestrator service.

Fixes: Modi script OCR 404 Not Found error.

Type of change

  • 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
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

…001)

The handleOCRUpload function in VakilFriendPage.jsx was incorrectly
posting to \/ocr/modi (Spring Boot, port 8080), which
does not expose that endpoint, causing a 404 Not Found error.

Changes:
- apiConfig.js: export NLP_BASE_URL pointing to the FastAPI NLP
  Orchestrator (localhost:8001 locally, configurable via
  VITE_NLP_BASE_URL env var for production).
- VakilFriendPage.jsx: import NLP_BASE_URL and use it for the
  /ocr/modi POST request so TrOCR-based Modi script transcription
  is handled by the correct service.

Fixes: Modi script OCR 404 Not Found error in Vakil Friend chat.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

Someone is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant