Sahilll94/Travel-Book

Refactor API Calls into a Centralized `src/services` Directory

Open

#90 opened on Jan 23, 2026

View on GitHub
 (4 comments) (0 reactions) (1 assignee)JavaScript (46 forks)auto 404
ECWoC26documentationgood first issue

Repository metrics

Stars
 (9 stars)
PR merge metrics
 (PR metrics pending)

Description

Documentation Type

Other

Current Issue

Currently, API fetch logic appears to be directly embedded within various components, leading to potential duplication and tightly coupled code.

Proposed Improvement

To improve maintainability, reusability, and separation of concerns, all API related calls should be extracted from components into a dedicated src/services directory. This pattern centralizes API logic, making it easier to manage, mock for testing, and update backend endpoints or authentication headers.

Affected Sections

authService.js, travelService.js, otpverification, travel card and app...

Target Audience

New contributors

Additional Context

@Sahilll94 I would like to be assigned to this Issue, I have read Codeof Conduct and I m under ECWoC 26.

Implementation

  • I can write the documentation changes myself
  • I can provide review and feedback
  • I prefer to let others handle the implementation

Confirmation

  • I have checked that this improvement isn't already covered elsewhere
  • I have searched for existing documentation issues before creating this one

Contributor guide