Skip to content

BE12 – Mobile Application Backend and Refactor Mobile Layer#203

Merged
datnq2001 merged 10 commits into
masterfrom
be12-mobile-api-support
May 4, 2026
Merged

BE12 – Mobile Application Backend and Refactor Mobile Layer#203
datnq2001 merged 10 commits into
masterfrom
be12-mobile-api-support

Conversation

@TienNguyen3711
Copy link
Copy Markdown
Collaborator

@TienNguyen3711 TienNguyen3711 commented Mar 30, 2026

Summary
This branch removes the separate mobile API layer and shifts the backend toward reusing existing shared APIs for both web and mobile clients. Instead of maintaining /api/mobile/*, the work standardizes existing routes where needed, improves response consistency, keeps the auth/session flow usable for mobile, and updates the OpenAPI spec to match the real backend behavior more closely. It also includes a merge from master with conflicts resolved so the branch is up to date.

What Main File Change

  • Removed the mobile-only API surface:

    • deleted routes/mobile.js
    • deleted controller/mobileController.js
    • deleted mobile-only services and repositories under services/mobile/*, repositories/mobile/*
    • removed mobile-only tests
  • Refactored shared existing routes for frontend/mobile compatibility:

    • controller/authController.js
    • services/authService.js
    • repositories/authRepository.js
    • controller/notificationController.js
    • controller/mealplanController.js
    • controller/recommendationController.js
    • services/recommendationService.js
    • repositories/recommendationRepository.js
    • controller/userProfileController.js
    • services/apiResponseService.js
    • services/serviceError.js
  • Updated routing behavior to support shared client usage:

    • routes/index.js
    • routes/notifications.js
    • routes/mealplan.js
  • Updated documentation/spec:

    • index.yaml
    • README.md
  • Merged latest master into be12-mobile-api-support and resolved conflicts in:

    • README.md
    • controller/authController.js
    • controller/notificationController.js
    • controller/userProfileController.js
    • index.yaml
    • services/authService.js
    • services/recommendationService.js
    • services/serviceError.js
    • test/recommendationService.test.js

Validation

  • Removed /api/mobile and kept shared existing APIs as the integration path.

  • Verified index.yaml parses successfully.

  • Verified merged JS files with node --check.

  • Ran targeted tests for auth/recommendation flows:

    • test/recommendationService.test.js
    • test/recommendationController.test.js
    • test/authService.mobileSessions.test.js
    • test/authService.refreshRotation.test.js
    • test/authenticateToken.test.js
  • Result:

    • auth/recommendation-related tests mostly passed
    • one remaining test issue came from merged master logging dependency usage (winston) in authenticateToken test environment, which looks like an environment/dependency install state issue rather than a merge-conflict logic issue

@TienNguyen3711 TienNguyen3711 force-pushed the be12-mobile-api-support branch from 7375f51 to a7fb473 Compare March 30, 2026 13:36
@TienNguyen3711 TienNguyen3711 changed the title BE12 – Mobile Application Backend Support BE12 – Mobile Application Backend and Refactor Mobile Layer Apr 1, 2026
@Vedant1515 Vedant1515 added the enhancement New feature or request label Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@nethmiWee nethmiWee left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts in files

routes/index.js
‎services/authService.js‎
services/recommendationService.js
test/recommendationService.test.js
dbConnection.js
index.yaml

@TienNguyen3711
Copy link
Copy Markdown
Collaborator Author

Please resolve conflicts in files

routes/index.js ‎services/authService.js‎ services/recommendationService.js test/recommendationService.test.js dbConnection.js index.yaml

The BE12 and B13 branches contain features developed after Sprint 2. Therefore, additional conflicts may arise if they are not merged immediately. I will revise everything before the end of Sprint 2 to ensure there are no more conflicts.

Copy link
Copy Markdown
Collaborator

@datnq2001 datnq2001 left a comment

Choose a reason for hiding this comment

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

I have reviewed and tested the changes. Everything is working well on my side, and I did not find any issues during the check. Good work!

@datnq2001 datnq2001 merged commit 126ea7f into master May 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants