chore: add production environment config, resolve NestJS DI warnings, and prune legacy dependencies#638
Merged
TarunyaProgrammer merged 1 commit intoJun 6, 2026
Conversation
…nd NestJS module fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements critical cleanups, configuration fixes, and dependency pruning identified in the pre-development codebase audit. These changes optimize package sizes, standardize NestJS dependency injection patterns, consolidate duplicate API endpoints, and prepare the frontend for production build environments.
Closes #637
Problems Addressed & Decisions Made
1. Hardcoded Environment URLs
environment.ts), which hardcoded the API base URL tohttp://localhost:5050. This blocked production-ready static builds (e.g., for GitHub Pages deployment).webiu-ui/src/environments/environment.prod.tspointing to the production server. Modifiedangular.jsonto configure thefileReplacementsutility under theproductionbuild block so that environment configurations are swapped dynamically at build time.2. Implicit NestJS DI in
UserModule& Test Suite IsolationUserServiceinjectedGithubService, butUserModuledid not explicitly importGithubModule. While NestJS resolved this globally in the application context, it caused compilation failures in standalone integration tests (specificallyuser.validation.spec.ts) because the dependencies ofGithubModule(likeCacheServiceandConfigService) were missing.GithubModuleinUserModuleto guarantee correct dependency resolution.user.validation.spec.tsby compiling only theUserControllerand providing a mockUserService. Since this test suite only verifies query/body validation pipes, isolating the controller bypasses compiling the entire module tree, removing dependency leakage and allowing tests to run instantly.3. API Endpoint Duplication
UserControllerandContributorControllerexposed identical HTTP endpoints to fetch followers and following metrics fromGithubService.UserController(/api/v1/user/followersAndFollowing/:username). Removed the redundant endpoint and service wrapper from theContributormodule to maintain a single source of truth.4. Package Dependency Bloat & Duplication
webiu-uihad redundant dependencies:axios(unused, since the frontend uses Angular's nativeHttpClient),@types/jest(unused, since Jasmine/Karma is used), andhusky(duplicated). The backend also had a duplicatehuskydeclaration.package.jsonfiles and updatedpackage-lock.jsonlockfiles. Pre-commit hooks are now correctly handled exclusively at the monorepo root level.Verification & Build Log
npm run lintandnpm run format. All files pass cleanly with zero warnings or errors.npm run test(103/103 Jest tests passing).ng test(36/36 Jasmine tests passing in ChromeHeadless).webiu-uiandwebiu-server.