Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Remove the dead `src/portfolio/` module — it is never imported and duplicates `src/investment/portfolio/`

Open Beginner friendly
#196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
nodejs, typescript
Domain
backend

Research direction

Start with src/portfolio/portfolio.module.ts, src/portfolio/controllers/portfolio.controller.ts and src/portfolio/services/rebalancing.service.ts, and confirm with a grep for src/portfolio/ that nothing outside the directory imports them. Diff the stub's rebalancing.service.ts against src/investment/portfolio/rebalancing.service.ts to check for unique logic, then remove the directory. Done when src/portfolio/ is gone, no references remain, and npx tsc --noEmit, npm test and npm run openapi:export show no changes.

Written by the indexing model from the issue text.

Description

help wanted intermediate refactor

Problem

src/portfolio/ is an orphaned copy of the portfolio feature. It contains:

  • src/portfolio/portfolio.module.ts (9 lines)
  • src/portfolio/controllers/portfolio.controller.ts (34 lines)
  • src/portfolio/services/rebalancing.service.ts (48 lines)

PortfolioModule is exported from src/portfolio/portfolio.module.ts, but it is never imported or registered anywhere. A repo-wide search for src/portfolio/ and PortfolioModule returns only:

src/app.module.ts:32       import { PortfolioModule } from "./investment/portfolio/portfolio.module";
src/app.module.ts:263      PortfolioModule,
src/dashboard.module.ts:4  import { PortfolioModule } from "src/investment/portfolio/portfolio.module";
src/portfolio/portfolio.module.ts:9   export class PortfolioModule {}
src/investment/portfolio/portfolio.module.ts:93  export class PortfolioModule {}

Both files export a class named PortfolioModule, and only the investment/ one is wired up. The real feature lives in src/investment/portfolio/, where portfolio.controller.ts is 434 lines and rebalancing.service.ts is 447 lines, versus the 34- and 48-line stubs here.

Why it matters

This is actively misleading. A contributor searching for "portfolio rebalancing" finds two implementations and has no way to tell that the short one is dead. tsc --noEmit passes because the files compile fine — they are just never instantiated, so nothing catches them. It is also a live footgun: the stub's PortfolioController is annotated @Controller("portfolio"), the same path prefix the real one uses. If someone ever registers it by mistake, the routes collide (see the separate route-collision issue).

There is precedent for this exact cleanup: issue #4 removed orphaned legacy services from src/auth/, and issue #5 flattened a nested directory.

Suggested Direction

Confirm the directory is genuinely unreferenced, then delete it:

  1. Re-run the verification: grep -rn "src/portfolio/" src/ should return nothing outside the directory itself. Also check test/, scripts/, and the docs/*.md files for references.
  2. Before deleting, diff the two rebalancing.service.ts files to confirm the stub has no behaviour the real one lacks. At 48 versus 447 lines it is almost certainly a stub, but read it rather than assume — if it does contain unique logic, port that first.
  3. git rm -r src/portfolio/
  4. Note the removal in CHANGELOG.md.

The same shape of problem exists for src/profiling/ versus src/observability/ (both have a profiling.service.ts and a profiling.controller.ts) — see the separate issue on that.

Constraints

  • src/investment/portfolio/portfolio.module.ts must stay untouched.
  • Verify docs/openapi.json does not change, or explain any difference — these controllers were never mounted, so they should not appear in the spec.
  • Use the src/ path-alias import style (enforced by import/no-relative-parent-imports in .eslintrc.js) for any follow-up references.

Acceptance Criteria

  • src/portfolio/ no longer exists.
  • No reference to src/portfolio/ remains in src/, test/, scripts/, or docs/.
  • Any unique logic from the stub rebalancing.service.ts has been ported or explicitly noted as intentionally dropped.
  • npx tsc --noEmit and npm test pass.
  • npm run openapi:export produces no schema changes.
Dominant language
TypeScript
Stars
7
Forks
55
Avg merge
1d 17h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SourceXXL/alian_structure-api

All issues in SourceXXL/alian_structure-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.