Skip to content

refactor: consolidate identity modules in api and web - #27

Merged
pramodnarayana merged 2 commits into
developmentfrom
refactor/identity-directory-structure
Jan 24, 2026
Merged

pramodnarayana merged 2 commits into
developmentfrom
refactor/identity-directory-structure

Conversation

@pramodnarayana

@pramodnarayana pramodnarayana commented Jan 24, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor

    • Project modules and frontend pages reorganized under a consolidated identity structure to improve code organization and maintainability.
  • Documentation

    • Added documentation describing the directory consolidation plan, implementation steps, and acceptance criteria.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 24, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Consolidated identity-related backend modules under modules/identity/, moved frontend auth pages into pages/auth/, and updated numerous relative import paths across API and web apps to match the new directory layout. No runtime logic or exported API signatures were changed.

Changes

Cohort / File(s) Summary
Backend: App wiring & identity modules
apps/api/src/app.module.ts, apps/api/src/modules/identity/...
AppModule imports now reference modules under modules/identity/; internal module identifiers unchanged.
Backend: Auth module & guards
apps/api/src/modules/identity/auth/auth.module.ts, apps/api/src/modules/identity/auth/platform.guard.ts, apps/api/src/modules/identity/auth/auth.controller.ts
Updated relative import paths for EmailModule, DbModule, and shared utils (e.g., ../../ → ../../../) to reflect deeper nesting.
Backend: Tenants & Users modules and tests
apps/api/src/modules/identity/tenants/*, apps/api/src/modules/identity/users/*, apps/api/src/modules/identity/system-admin/*
Adjusted relative imports for DRIZZLE_DB, schema, and DbModule across modules and tests (path depth increased). Minor ESLint disables added in one spec.
Frontend: Auth pages and tests
apps/web/src/pages/auth/LoginPage.tsx, apps/web/src/pages/auth/LoginPage.spec.tsx, apps/web/src/pages/auth/SignupPage.tsx, apps/web/src/pages/auth/SignupPage.spec.tsx
Moved Login/Signup pages to pages/auth/ and updated internal imports/mocks (../ → ../../).
Frontend: Routes & admin pages
apps/web/src/App.tsx, apps/web/src/routes/AdminRoutes.tsx, apps/web/src/routes/TenantRoutes.tsx, apps/web/src/pages/admin/tenants/TenantListPage.tsx
Updated imports to identity-scoped paths (modules/users → modules/identity/users, modules/tenants → modules/identity/tenants) and Login/Signup page paths.
Documentation
docs/refactor/modules/identity/task/01b_consolidate_directory_structure.md
Added task doc describing consolidation steps and acceptance criteria for the identity directory restructure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hop, hop, folders align and gleam,

Identity nests snug as a dream.
Imports bounce to their new home,
Clean paths now let the code roam.
I nibble bugs and cheer, "Hooray!" 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: consolidating identity-related modules under a unified directory structure in both API and web applications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/api/src/modules/identity/system-admin/system-admin.controller.spec.ts`:
- Line 1: Replace the file-wide directive "/* eslint-disable
`@typescript-eslint/no-unsafe-assignment`, `@typescript-eslint/no-unsafe-call`,
`@typescript-eslint/no-unsafe-return` */" with a scoped disable around only the
specific mock/setup statements that require it (for example wrap the mock
declarations or the beforeEach/setup block in the
system-admin.controller.spec.ts with /* eslint-disable ... */ and close with /*
eslint-enable ... */ immediately after), so only the minimal lines (the mocked
variables/functions or setup code) have the rules disabled.

In `@docs/refactor/modules/identity/task/01b_consolidate_directory_structure.md`:
- Around line 3-6: Update the tracking state in this document by changing the
"Status: Ready to Start" label and the unchecked task checkboxes to reflect
actual progress for this PR; locate and update the "Status: Ready to Start"
string and any markdown task lists (unchecked items) in this file (also ensure
the corresponding blocks referenced around the other task sections that mirror
lines 22-43 and 46-51 are updated) so the status and checkboxes accurately
represent current execution (e.g., set status to In Progress or Done and tick
completed items).

Comment thread apps/api/src/modules/identity/system-admin/system-admin.controller.spec.ts Outdated
Comment on lines +3 to +6
**Priority:** HIGH
**Estimated Time:** 2 hours
**Assignee:** Coder
**Status:** Ready to Start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider updating status/checkboxes if this doc is used for tracking execution.
Right now it reads “Ready to Start” with unchecked items, which may be stale after this PR.

Also applies to: 22-43, 46-51

🤖 Prompt for AI Agents
In `@docs/refactor/modules/identity/task/01b_consolidate_directory_structure.md`
around lines 3 - 6, Update the tracking state in this document by changing the
"Status: Ready to Start" label and the unchecked task checkboxes to reflect
actual progress for this PR; locate and update the "Status: Ready to Start"
string and any markdown task lists (unchecked items) in this file (also ensure
the corresponding blocks referenced around the other task sections that mirror
lines 22-43 and 46-51 are updated) so the status and checkboxes accurately
represent current execution (e.g., set status to In Progress or Done and tick
completed items).

@pramodnarayana
pramodnarayana merged commit 4eecd33 into development Jan 24, 2026
2 checks passed
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