engineering docs

Microservices - Detailed Component Mapping

Version: 1.0 Date: August 4, 2026 Purpose: Complete component-to-service mapping with dependencies


πŸ“Š Current Monorepo Component Inventory

πŸ“ apps/

apps/app (Next.js Application)

Type: Frontend Application (Server-Side Rendered)
Purpose: Admin dashboard & management portal
Size: Large
Dependencies: All shared packages, Auth, Permissions, DB client
 
Structure:
β”œβ”€β”€ app/                          # Next.js app router
β”‚   β”œβ”€β”€ [lang]/                   # Language routing
β”‚   β”‚   β”œβ”€β”€ (routes)/
β”‚   β”‚   β”‚   β”œβ”€β”€ (root)/
β”‚   β”‚   β”‚   β”‚   └── page.tsx      # Home/login page
β”‚   β”‚   β”‚   └── (site)/
β”‚   β”‚   β”‚       β”œβ”€β”€ [workspace]/
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ analytics/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ history/
β”‚   β”‚   β”‚       β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ product/  # Product management CRUD
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ order/    # Order management
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ members/  # Team member management
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ manage/   # Workspace settings
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ faq/
β”‚   β”‚   β”‚       β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ subscription/
β”‚   β”‚   β”‚       β”‚   └── layout.tsx
β”‚   β”‚   β”‚       β”œβ”€β”€ user/         # User management
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [refId]/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ controls/
β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”œβ”€β”€ media/
β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚       β”‚   β”‚   └── layout.tsx
β”‚   β”‚   β”‚       β”‚   └── dev/      # Developer tools
β”‚   β”‚   β”‚       β”‚       └── tools/
β”‚   β”‚   β”‚       β”‚           └── client/
β”‚   β”‚   β”‚       β”‚               └── api/
β”‚   β”‚   β”‚       └── layout.tsx
β”‚   β”œβ”€β”€ auth/                     # Auth-related pages
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”œβ”€β”€ context/                  # Context providers
β”‚   β”œβ”€β”€ config/                   # Configuration
β”‚   β”œβ”€β”€ db/                       # Database queries/utilities
β”‚   β”œβ”€β”€ hooks/                    # Custom hooks
β”‚   β”œβ”€β”€ lib/                      # Library utilities
β”‚   β”œβ”€β”€ prisma/                   # Prisma schema (copy)
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ schemas/                  # Validation schemas
β”‚   β”œβ”€β”€ types/                    # TypeScript types
β”‚   └── validator/                # Custom validators
 
Exports:
- None (final application)
 
Pages/Routes:
- /[lang]/ (root/home)
- /[lang]/(site)/[workspace]/dashboard/analytics
- /[lang]/(site)/[workspace]/dashboard/history
- /[lang]/(site)/[workspace]/product (list/create/edit)
- /[lang]/(site)/[workspace]/order
- /[lang]/(site)/[workspace]/members/manage
- /[lang]/(site)/[workspace]/members/register
- /[lang]/(site)/[workspace]/manage
- /[lang]/(site)/[workspace]/settings/faq
- /[lang]/(site)/[workspace]/subscription
- /[lang]/(site)/user/[refId]/controls/media
 
Key Components:
- Analytics components (rest-bar, rest-line, rest-pie)
- Product management forms
- Member management UI
- Dashboard layouts
- Settings panels

Migration Plan:

  • Extract as Admin Module (MFE - Port 3107)
  • Keep existing pages but connect to microservices APIs
  • Replace direct DB queries with API calls
  • Update api/ folder to use API Gateway

apps/app/ (Next.js Application)

Type: Frontend Application (Public/User-facing)
Purpose: Main e-commerce/store application
Size: Large
Dependencies: All shared packages, Auth, DB client
 
Structure:
β”œβ”€β”€ store/                        # E-commerce store frontend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ [lang]/
β”‚   β”‚   β”‚   β”œβ”€β”€ (routes)/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx      # Homepage
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ products/
β”‚   β”‚   β”‚   β”‚   β”‚   └── [slug]/
β”‚   β”‚   β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ cart/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ checkout/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ account/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ orders/
β”‚   β”‚   β”‚   β”‚   β”‚   └── settings/
β”‚   β”‚   β”‚   β”‚   └── search/
β”‚   β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚   └── layout.tsx
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── utils/
β”‚   └── package.json
β”‚
└── warehouse/                    # Inventory/warehouse management
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ [lang]/
    β”‚   β”‚   β”œβ”€β”€ (routes)/
    β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx
    β”‚   β”‚   β”‚   β”œβ”€β”€ inventory/
    β”‚   β”‚   β”‚   β”œβ”€β”€ orders/
    β”‚   β”‚   β”‚   β”œβ”€β”€ transfers/
    β”‚   β”‚   β”‚   └── reports/
    β”‚   β”‚   └── layout.tsx
    β”‚   β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ hooks/
    β”‚   β”œβ”€β”€ lib/
    β”‚   └── public/
    └── package.json
 
Exports:
- None (final applications)
 
Key Pages:
- / (homepage with featured products)
- /products (product listing & search)
- /products/[slug] (product detail)
- /cart (shopping cart)
- /checkout (order creation)
- /account/profile (user profile)
- /account/orders (order history)
- /account/orders/[id] (order detail)
- /account/settings (user settings)
- /warehouse/inventory (warehouse staff view)
- /warehouse/orders (warehouse order management)
- /warehouse/transfers (inventory transfers)
 
Key Components:
- Product card
- Product grid
- Cart summary
- Checkout form
- Order summary
- Payment form
- Inventory display

Migration Plan:

  • Store β†’ Product Module (MFE - Port 3104) + Order Module (MFE - Port 3105)
  • Warehouse β†’ Separate warehouse app or warehouse-module (MFE - Port 3110)
  • Replace DB queries with API Gateway calls
  • Implement client-side caching with SWR

apps/app/mobile (React Native/Expo)

Type: Mobile Application
Purpose: Native mobile experience for e-commerce
Size: Medium
Dependencies: Shared packages, Auth, HTTP client
 
Structure:
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   β”œβ”€β”€ login.tsx
β”‚   β”‚   β”œβ”€β”€ register.tsx
β”‚   β”‚   └── reset-password.tsx
β”‚   β”œβ”€β”€ (app)/
β”‚   β”‚   β”œβ”€β”€ home.tsx
β”‚   β”‚   β”œβ”€β”€ products.tsx
β”‚   β”‚   β”œβ”€β”€ products/[id].tsx
β”‚   β”‚   β”œβ”€β”€ cart.tsx
β”‚   β”‚   β”œβ”€β”€ checkout.tsx
β”‚   β”‚   β”œβ”€β”€ orders.tsx
β”‚   β”‚   β”œβ”€β”€ account.tsx
β”‚   β”‚   β”œβ”€β”€ settings.tsx
β”‚   β”‚   └── layout.tsx
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ types/
β”‚   └── utils/
└── package.json
 
Services:
- Auth service (login, logout, token management)
- Product service (fetch products, search)
- Order service (create orders, fetch history)
- User service (profile, settings)
 
Key Components:
- Product list (FlatList)
- Product detail screen
- Cart management
- Checkout form
- Order history
- Login/Register screens

Migration Plan:

  • Update API endpoints to point to API Gateway
  • Keep existing client-side logic
  • Implement offline support with AsyncStorage
  • Add push notifications from Notification Service

apps/api (Backend API)

Type: Backend Node.js/Prisma API
Purpose: Current monolithic API serving all frontends
Size: Large
Dependencies: Prisma, MongoDB, HTTP client, crypto
 
Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ users.ts
β”‚   β”‚   β”œβ”€β”€ products.ts
β”‚   β”‚   β”œβ”€β”€ orders.ts
β”‚   β”‚   β”œβ”€β”€ organizations.ts
β”‚   β”‚   β”œβ”€β”€ analytics.ts
β”‚   β”‚   β”œβ”€β”€ settings.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ cors.ts
β”‚   β”‚   β”œβ”€β”€ error-handler.ts
β”‚   β”‚   └── rate-limit.ts
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ auth.service.ts
β”‚   β”‚   β”œβ”€β”€ user.service.ts
β”‚   β”‚   β”œβ”€β”€ product.service.ts
β”‚   β”‚   β”œβ”€β”€ order.service.ts
β”‚   β”‚   β”œβ”€β”€ email.service.ts
β”‚   β”‚   └── payment.service.ts
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ crypto.ts
β”‚   β”‚   β”œβ”€β”€ jwt.ts
β”‚   β”‚   β”œβ”€β”€ validators.ts
β”‚   β”‚   └── helpers.ts
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── index.ts
β”‚   └── index.ts (main server entry)
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma
β”‚   β”œβ”€β”€ seed.ts
β”‚   └── migrations/
β”œβ”€β”€ package.json
└── tsconfig.json
 
REST Endpoints (to be decomposed):
- POST   /auth/register
- POST   /auth/login
- POST   /auth/refresh
- GET    /users/:id
- PUT    /users/:id
- DELETE /users/:id
- GET    /products
- POST   /products
- GET    /products/:id
- PUT    /products/:id
- DELETE /products/:id
- GET    /orders
- POST   /orders
- GET    /orders/:id
- PUT    /orders/:id/status
- GET    /organizations/:id
- POST   /organizations
- GET    /analytics/dashboard
- GET    /settings
- PUT    /settings
 
Exports:
- ./types

Migration Plan:

  • DECOMMISSION this monolithic API
  • Split into: Auth, User, Product, Order, Organization, Analytics, Settings services
  • Each service owns its own endpoints
  • API Gateway routes requests to appropriate service
  • Remove in Phase 5

apps/docs (Documentation)

Type: Next.js Documentation Site
Purpose: Technical documentation
Size: Small
Dependencies: MDX, UI components
 
Structure:
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (home)/
β”‚   β”‚   └── page.tsx
β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   β”œβ”€β”€ [slug]/
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   └── layout.tsx
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── search/
β”‚   β”‚       └── route.ts
β”‚   β”œβ”€β”€ layout.tsx
β”‚   └── error.tsx
β”œβ”€β”€ content/              # MDX files
β”œβ”€β”€ components/
β”œβ”€β”€ lib/
β”œβ”€β”€ public/
└── package.json
 
Exports:
- None (final application)

Migration Plan:

  • KEEP AS IS - Separate documentation site
  • Update with API reference for new microservices
  • Add deployment guides for new architecture

πŸ“¦ packages/

@repo/db

Type: Database/ORM Package
Purpose: Prisma client, database schema, seed utilities
Size: Large
Exports:
- Prisma client
- Database seed functions
- Type definitions
- Database utilities
 
Structure:
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma     # Full database schema
β”‚   β”œβ”€β”€ seed.ts           # Seed script
β”‚   └── migrations/       # Migration files
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # Exports prisma client
β”‚   β”œβ”€β”€ client.ts         # Prisma client setup
β”‚   β”œβ”€β”€ seed/
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ users.ts
β”‚   β”‚   β”œβ”€β”€ products.ts
β”‚   β”‚   └── orders.ts
β”‚   └── utils.ts
β”œβ”€β”€ generated/
β”‚   β”œβ”€β”€ prisma/           # Generated Prisma client
β”‚   └── types/
β”œβ”€β”€ plugin/
β”‚   └── address/          # Address plugin
β”œβ”€β”€ scripts/
β”‚   └── generate-types-prisma.ts
β”œβ”€β”€ package.json
└── README.md
 
Current Database:
- MongoDB with Prisma as ORM
- Single database containing all tables
- Tables include: User, Account, Organization, Product, Order, Analytics, etc.
 
Exports:
- .         β†’ prisma client & seed
- ./seed/*  β†’ individual seed functions
- ./types   β†’ TypeScript definitions
- ./plugin/address β†’ address utilities

Migration Plan:

  • DECOMPOSE into service-specific schemas
  • Create separate Prisma instances:
    • @repo/db-auth β†’ Auth DB schema
    • @repo/db-users β†’ Users DB schema
    • @repo/db-products β†’ Products DB schema
    • @repo/db-orders β†’ Orders DB schema
    • etc.
  • Move schema files to respective services
  • Keep utilities as shared package
  • Migrate seed functions to service-specific seeds

@repo/auth

Type: Shared Library
Purpose: Authentication utilities (currently mostly empty/shell)
Size: Small
Exports:
- None currently (shell package)
 
Current Structure:
β”œβ”€β”€ src/
β”‚   └── index.ts          # Empty or minimal exports
β”œβ”€β”€ package.json
└── README.md
 
Peerq Dependencies:
- react

Migration Plan:

  • EXPAND & REPURPOSE as Auth Utilities Package
  • Add:
    • JWT token generation/validation utilities
    • Password hashing helpers (bcrypt)
    • Session management utilities
    • 2FA helpers
    • Permission checking utilities
  • Keep as shared package for all services to use
  • Or move into Auth Service

@repo/core

Type: Shared Utilities Package
Purpose: Core validators, time utilities, business logic
Size: Medium
Exports:
- .         β†’ main index
- ./validator
- ./time
- ./time/client
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ validator/
β”‚   β”‚   β”œβ”€β”€ Validator.ts  # Email, password, phone validators
β”‚   β”‚   β”œβ”€β”€ SourceImage.ts
β”‚   β”‚   β”œβ”€β”€ Comparison.ts # Data comparison utilities
β”‚   β”‚   β”œβ”€β”€ DomainService.ts
β”‚   β”‚   β”œβ”€β”€ Safeguard.ts
β”‚   β”‚   β”œβ”€β”€ ArrayValidator.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ time/
β”‚   β”‚   β”œβ”€β”€ index.ts      # Time utilities
β”‚   β”‚   └── client/
β”‚   β”‚       └── index.ts
β”‚   └── helpers/          # Various helpers
β”œβ”€β”€ package.json
└── README.md
 
Peer Dependencies:
- react
- xuxi

Migration Plan:

  • KEEP AS SHARED PACKAGE for all services
  • Add validators specific to services:
    • Product validators
    • Order validators
    • Organization validators
  • Replicate validators in each service for independence
  • Or keep centralized and call as dependency

@repo/permissions

Type: Shared RBAC Package
Purpose: Role-based access control
Size: Small
Exports:
- Hooks for permission checking
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useRole.ts
β”‚   β”‚   β”œβ”€β”€ usePermission.ts
β”‚   β”‚   └── useGuard.ts
β”‚   └── utils/
β”‚       └── checkPermission.ts
β”œβ”€β”€ package.json
└── README.md

Migration Plan:

  • MOVE TO Auth Service as core component
  • Update to use microservice-based auth
  • Create permissions API endpoint
  • Keep light client-side checking for UX
  • Centralize permission checking on backend

@repo/helpers

Type: Shared Utilities Package
Purpose: Helper functions (transformers, debounce, etc.)
Size: Small
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ transformer.ts
β”‚   β”œβ”€β”€ debounce.ts
β”‚   β”œβ”€β”€ insert-element.ts
β”‚   β”œβ”€β”€ cookie-store.ts
β”‚   └── ... other helpers
β”œβ”€β”€ package.json
└── README.md

Migration Plan:

  • KEEP AS SHARED PACKAGE
  • Used by both backend services and frontend modules
  • Add more helpers as services are extracted

@repo/hooks

Type: React Hooks Library
Purpose: Custom React hooks (useAuth, useFetch, etc.)
Size: Medium
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ useAuth.ts       # Authentication hook
β”‚   β”œβ”€β”€ useUser.ts       # User data hook
β”‚   β”œβ”€β”€ useFetch.ts      # Data fetching hook
β”‚   β”œβ”€β”€ useForm.ts       # Form handling hook
β”‚   β”œβ”€β”€ useLocalStorage.ts
β”‚   β”œβ”€β”€ useDebounce.ts
β”‚   └── ... other hooks
β”œβ”€β”€ package.json
└── README.md

Migration Plan:

  • DISTRIBUTE TO MFE MODULES
  • Create hooks in shell module
  • Create hooks in respective feature modules
  • Or keep as shared package with updated hooks:
    • useAuth() β†’ calls Auth Module API
    • useUser() β†’ calls User Service API
    • useProduct() β†’ calls Product Service API
    • useOrder() β†’ calls Order Service API

@repo/http-client

Type: HTTP Client Library
Purpose: Axios wrapper for API calls
Size: Small
 
Current Structure:
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ axios.ts          # Axios instance configuration
β”‚   β”œβ”€β”€ interceptors.ts   # Request/response interceptors
β”‚   └── retry.ts          # Retry logic
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ client.ts         # HTTP client wrapper
β”‚   β”œβ”€β”€ types.ts
β”‚   └── utils.ts
β”œβ”€β”€ package.json
└── README.md
 
Features:
- Centralized axios configuration
- Request/response interceptors
- Automatic token refresh
- Retry logic
- Error handling

Migration Plan:

  • KEEP AS SHARED PACKAGE
  • All services and MFE modules use this
  • Update to:
    • Use API Gateway URL
    • Add service-to-service communication features
    • Add circuit breaker support
    • Add logging/tracing

@repo/i18n

Type: Internationalization Package
Purpose: Multi-language support
Size: Medium
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ locales/
β”‚   β”‚   β”œβ”€β”€ en.ts
β”‚   β”‚   β”œβ”€β”€ id.ts
β”‚   β”‚   └── ... other locales
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useI18n.ts
β”‚   β”‚   └── useTranslate.ts
β”‚   └── utils/
β”‚       └── load-messages.ts
β”œβ”€β”€ messages/             # Message files
β”œβ”€β”€ raw/                  # Raw message data
β”œβ”€β”€ script/               # i18n scripts
└── package.json
 
Features:
- Multi-language support
- Message loading
- Translation hooks
- Locale management

Migration Plan:

  • KEEP AS SHARED PACKAGE
  • Used by shell and all MFE modules
  • Backend services don't need this (API responses in English)
  • Add service-level translations if needed

@repo/components & @repo/ui

Type: UI Component Libraries
Purpose: Reusable React components, design system
Size: Large
 
Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/       # Reusable components
β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   β”œβ”€β”€ Form.tsx
β”‚   β”‚   β”œβ”€β”€ Modal.tsx
β”‚   β”‚   β”œβ”€β”€ Table.tsx
β”‚   β”‚   β”œβ”€β”€ Card.tsx
β”‚   β”‚   └── ... many more
β”‚   β”œβ”€β”€ styles.css        # Tailwind styles
β”‚   β”œβ”€β”€ index.ts
β”‚   └── types.ts
β”œβ”€β”€ dist/                 # Built components
β”œβ”€β”€ package.json
└── README.md
 
Design System:
- Tailwind CSS based
- Radix UI components
- Custom styled components

Migration Plan:

  • MOVE TO SHELL MODULE
  • Shell application becomes design system host
  • MFE modules import design system from shell
  • Or distribute to each MFE:
    • Core UI components in shell
    • Feature-specific components in modules

@repo/icons

Type: Icon Library
Purpose: SVG icons
Size: Small
 
Current Structure:
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ icons/
β”‚   β”‚   β”œβ”€β”€ ArrowIcon.tsx
β”‚   β”‚   β”œβ”€β”€ CloseIcon.tsx
β”‚   β”‚   β”œβ”€β”€ ... many more
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ src/
β”‚   └── package.json

Migration Plan:

  • MOVE TO SHELL MODULE
  • Or distribute across MFE modules
  • Keep as shared package with imports

@repo/configs/

Type: Configuration Packages
Purpose: Shared configuration (ESLint, TypeScript, CSS, tests)
Size: Small
 
Includes:
- @repo/configs-eslint
- @repo/configs-typescript
- @repo/configs-css
- @repo/configs-test
- @repo/configs-global-types
 
Current Structure:
β”œβ”€β”€ eslint/
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ next.js
β”‚   └── base.js
β”œβ”€β”€ typescript/
β”‚   β”œβ”€β”€ base.json
β”‚   └── nextjs.json
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ tailwind.config.ts
β”‚   └── postcss.config.js
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ jest.config.js
β”‚   └── setup.ts
└── global-types/
    β”œβ”€β”€ index.ts
    └── ... type definitions

Migration Plan:

  • KEEP AS SHARED PACKAGES
  • Each service and MFE inherits configuration
  • Centralize best practices
  • Easy updates across all services

@repo/engines

Type: Business Logic Package
Purpose: Domain-specific business engines
Size: Medium
 
Current Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ ProductEngine.ts  # Product domain logic
β”‚   β”œβ”€β”€ OrderEngine.ts    # Order domain logic
β”‚   β”œβ”€β”€ AnalyticsEngine.ts
β”‚   β”œβ”€β”€ PricingEngine.ts
β”‚   └── ... other engines
└── package.json

Migration Plan:

  • DISTRIBUTE TO SERVICES
  • Move ProductEngine to Product Service
  • Move OrderEngine to Order Service
  • Move AnalyticsEngine to Analytics Service
  • Keep general-purpose engines as shared

πŸ—‚οΈ tools/

tools/cli

Type: Command-line tool
Purpose: Development utilities (dev server orchestration)
Size: Small
 
Structure:
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/
β”‚   β”‚   β”œβ”€β”€ dev.ts
β”‚   β”‚   β”œβ”€β”€ build.ts
β”‚   β”‚   └── ... other commands
β”‚   └── core/
β”‚       β”œβ”€β”€ cli.ts
β”‚       └── utils.ts
β”œβ”€β”€ _test/
β”œβ”€β”€ package.json
└── tsconfig.json
 
Main Commands:
- dev          β†’ Start development environment
- build        β†’ Build all packages
- lint         β†’ Lint codebase
- type-check   β†’ Type checking
- ... more

Migration Plan:

  • EXPAND CLI TOOL
  • Add service-specific commands:
    • dev:services β†’ Start all microservices
    • dev:frontend β†’ Start all MFE modules
    • service:logs <name> β†’ View service logs
    • service:restart <name> β†’ Restart specific service
    • db:migrate β†’ Run migrations
    • docker:up β†’ Start Docker Compose
    • docker:down β†’ Stop Docker Compose

tools/scripts

Type: Automation scripts
Purpose: Generate exports, migrate data, etc.
Size: Small
 
Current Scripts:
- generate-exports.ts
- generate-indonesia-regions.ts
- parse-and-split-indonesia-regions.ts
- generate-locale-merge.ts

Migration Plan:

  • ADD NEW SCRIPTS
  • Data migration scripts for each service
  • Service setup scripts
  • Database seeding scripts

πŸ“Š data/

Type: Data package
Purpose: Shared datasets (seed data)
Size: Small
 
Current Structure:
β”œβ”€β”€ src/
β”‚   └── seed-indonesia-regions/
β”œβ”€β”€ package.json
└── tsconfig.json
 
Content:
- Indonesia regions SQL/TypeScript data
- Used for location/address fields

Migration Plan:

  • KEEP AS IS
  • Reference in services that need location data
  • Or move to Settings Service

πŸ”— Dependency Graph (Current State)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Frontend Apps                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚   main       β”‚  β”‚     app      β”‚ app/mobile   β”‚
β”‚  β”‚ (Next.js)    β”‚  β”‚  (Next.js)   β”‚(React Native)β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚         β”‚                 β”‚                      β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                      β”‚
β”‚                   β”‚                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚    Shared Packages    β”‚
        β”‚                       β”‚
        β”‚  β”œβ”€ @repo/ui          β”‚
        β”‚  β”œβ”€ @repo/components  β”‚
        β”‚  β”œβ”€ @repo/hooks       β”‚
        β”‚  β”œβ”€ @repo/i18n        β”‚
        β”‚  β”œβ”€ @repo/helpers     β”‚
        β”‚  β”œβ”€ @repo/http-client β”‚
        β”‚  β”œβ”€ @repo/core        β”‚
        β”‚  β”œβ”€ @repo/auth        β”‚
        β”‚  β”œβ”€ @repo/permissions β”‚
        β”‚  └─ @repo/configs/*   β”‚
        β”‚                       β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Backend + Database  β”‚
        β”‚                       β”‚
        β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
        β”‚  β”‚  apps/api      β”‚   β”‚
        β”‚  β”‚  (Monolithic)  β”‚   β”‚
        β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
        β”‚           β”‚           β”‚
        β”‚           β–Ό           β”‚
        β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
        β”‚  β”‚ @repo/db         β”‚ β”‚
        β”‚  β”‚ (Prisma + MongoDB) β”‚
        β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
        β”‚                       β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”— Dependency Graph (Target State - Post-Migration)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Frontend - Micro-Frontends             β”‚
β”‚                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚           Shell (Port 3100)                    β”‚  β”‚
β”‚  β”‚  β”œβ”€ Layout orchestration                       β”‚  β”‚
β”‚  β”‚  β”œβ”€ Module loader                              β”‚  β”‚
β”‚  β”‚  β”œβ”€ Global state                               β”‚  β”‚
β”‚  β”‚  └─ Design system / Icons / Styles             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚               β”‚                                      β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚       β”‚                           β”‚            β”‚     β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”  β”‚
β”‚  β”‚Auth      β”‚  β”‚Product   β”‚  β”‚Order    β”‚  β”‚Admin  β”‚  β”‚
β”‚  β”‚Module    β”‚  β”‚Module    β”‚  β”‚Module   β”‚  β”‚Module β”‚  β”‚
β”‚  β”‚(3101)    β”‚  β”‚(3104)    β”‚  β”‚(3105)   β”‚  β”‚(3107) β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚       β”‚                             β”‚                β”‚
β”‚       β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚       β”‚    β”‚           β”‚                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β–Όβ”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚User Module  β”‚  β”‚Analytics   β”‚  β”‚Org Module  β”‚     β”‚
β”‚  β”‚(3102)       β”‚  β”‚Module      β”‚  β”‚(3103)      β”‚     β”‚
β”‚  β”‚             β”‚  β”‚(3106)      β”‚  β”‚            β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   API Gateway             β”‚
        β”‚   (Port 3000)             β”‚
        β”‚   β”œβ”€ Routing              β”‚
        β”‚   β”œβ”€ Auth validation      β”‚
        β”‚   β”œβ”€ Rate limiting        β”‚
        β”‚   └─ Circuit breakers     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚             β”‚             β”‚            β”‚
         β–Ό             β–Ό             β–Ό            β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚Auth Serviceβ”‚ β”‚User Svc  β”‚ β”‚Org Svc  β”‚ β”‚Product   β”‚
    β”‚(3001)      β”‚ β”‚(3002)    β”‚ β”‚(3003)   β”‚ β”‚Service   β”‚
    β”‚            β”‚ β”‚          β”‚ β”‚         β”‚ β”‚(3004)    β”‚
    β”‚auth_db     β”‚ β”‚users_db  β”‚ β”‚orgs_db  β”‚ β”‚products_ β”‚
    β”‚            β”‚ β”‚          β”‚ β”‚         β”‚ β”‚db        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό             β–Ό            β–Ό            β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚Order       β”‚ β”‚Analytics β”‚ β”‚Settings β”‚ β”‚Notify    β”‚
    β”‚Service     β”‚ β”‚Service   β”‚ β”‚Service  β”‚ β”‚Service   β”‚
    β”‚(3005)      β”‚ β”‚(3006)    β”‚ β”‚(3007)   β”‚ β”‚(3008)    β”‚
    β”‚            β”‚ β”‚          β”‚ β”‚         β”‚ β”‚          β”‚
    β”‚orders_db   β”‚ β”‚analytics β”‚ β”‚settings β”‚ β”‚(external)β”‚
    β”‚            β”‚ β”‚_db       β”‚ β”‚_db      β”‚ β”‚          β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β–²
                       β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                       β”‚
            β–Ό                       β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Event Bus / Message  β”‚  β”‚  Redis Cacheβ”‚
    β”‚ Broker               β”‚  β”‚  (sessions, β”‚
    β”‚ (Redis/Kafka)        β”‚  β”‚   rate-limit)
    β”‚                      β”‚  β”‚             β”‚
    β”‚ - order-created      β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚ - order-updated      β”‚
    β”‚ - product-viewed     β”‚
    β”‚ - user-registered    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Service-to-Service Dependencies

Auth Service (3001)

Depends On:
  - None (independent)
 
Used By:
  - API Gateway (token validation)
  - User Service (token validation)
  - Organization Service (token validation)
  - Product Service (token validation)
  - Order Service (token validation)
  - Analytics Service (token validation)
  - Settings Service (token validation)
  - All MFE modules (indirectly via API Gateway)
 
Provides:
  - Token generation & validation
  - User authentication
  - 2FA functionality
  - Password management

User Service (3002)

Depends On:
  - Auth Service (token validation)
 
Used By:
  - Organization Service (get user info)
  - Order Service (get user info)
  - Analytics Service (user metadata)
  - User Module MFE
 
Provides:
  - User profiles
  - User settings
  - User metadata

Organization Service (3003)

Depends On:
  - Auth Service (token validation)
  - User Service (user info, membership)
 
Used By:
  - API Gateway (workspace context)
  - Product Service (org membership check)
  - Order Service (org context)
  - Settings Service (org settings)
  - Org Module MFE
 
Provides:
  - Organization management
  - Member management
  - Invitations
  - Workspace data

Product Service (3004)

Depends On:
  - Auth Service (token validation)
  - Organization Service (org context)
 
Used By:
  - API Gateway
  - Order Service (product info, pricing)
  - Analytics Service (product views)
  - Product Module MFE
  - Order Module MFE
 
Provides:
  - Product catalog
  - Inventory management
  - Product search
  - Categories
  - Pricing

Order Service (3005)

Depends On:
  - Auth Service (token validation)
  - User Service (user info)
  - Product Service (product info, inventory)
 
Used By:
  - API Gateway
  - Analytics Service (order events)
  - Notification Service (order notifications)
  - Order Module MFE
 
Provides:
  - Order creation
  - Order management
  - Order history
  - Order tracking

Analytics Service (3006)

Depends On:
  - Event Bus (message stream)
  - Auth Service (token validation)
 
Used By:
  - API Gateway
  - Analytics Module MFE
  - Admin Module MFE
 
Provides:
  - Dashboard metrics
  - Reports
  - Analytics data

Settings Service (3007)

Depends On:
  - Auth Service (token validation)
  - Organization Service (org context)
 
Used By:
  - API Gateway
  - Admin Module MFE
  - All services (feature flags)
 
Provides:
  - System settings
  - FAQ management
  - Subscription data
  - Feature flags

Notification Service (3008)

Depends On:
  - Event Bus (message stream)
  - External services (SendGrid, Twilio)
 
Used By:
  - Order Service (async notifications)
  - User Service (async notifications)
  - Auth Service (email confirmations)
 
Provides:
  - Email notifications
  - SMS notifications
  - Push notifications

πŸ”„ Data Flow Patterns

Pattern 1: Synchronous Request (User fetches product)

User (Frontend)
  ↓ Click "View Product"
  β–Ό
Product Module MFE
  ↓ Fetch /api/products/123
  β–Ό
API Gateway (Port 3000)
  β”œβ”€ Validate token from Auth Service
  β–Ό
Product Service (Port 3004)
  β”œβ”€ Check org membership via Organization Service
  β”œβ”€ Query products_db
  β–Ό
Response JSON
  ↓
MFE displays product

Pattern 2: Asynchronous Event (User creates order)

User (Frontend)
  β–Ό Click "Place Order"
  β–Ό
Order Module MFE
  β”œβ”€ POST /api/orders
  β–Ό
API Gateway
  β–Ό
Order Service (Port 3005)
  β”œβ”€ Validate: Product exists? (call Product Service)
  β”œβ”€ Validate: Inventory available? (call Product Service)
  β”œβ”€ Create order in orders_db
  β”œβ”€ Emit "order-created" event to Redis
  β”œβ”€ Return 201 Created
  β–Ό
Event Bus (Redis) receives "order-created"
  β”œβ”€ Analytics Service subscribes β†’ Update metrics
  β”œβ”€ Notification Service subscribes β†’ Send email
  β”œβ”€ Inventory System subscribes β†’ Reserve stock
  β–Ό
Analytics updated in real-time
Email sent to user
Inventory reserved

Pattern 3: Cross-Service Lookup (Order processing)

Order Service processing order
  β”œβ”€ GET /api/users/user123 from User Service
  β”‚   β”œβ”€ Validate token
  β”‚   β”œβ”€ Call User Service
  β”‚   β”œβ”€ Get user info
  β”‚   └─ Cache in Redis
  β”‚
  β”œβ”€ GET /api/products/prod456 from Product Service
  β”‚   β”œβ”€ Validate token
  β”‚   β”œβ”€ Call Product Service
  β”‚   β”œβ”€ Check inventory
  β”‚   └─ Cache in Redis
  β”‚
  β”œβ”€ Combine data
  β”œβ”€ Create order
  └─ Return complete order

πŸ“¦ Migration Package Dependencies

Step 1: Extract Shared Core

Dependencies to create first:
  βœ“ @repo/configs/*        (no dependencies)
  βœ“ @repo/helpers          (no dependencies)
  βœ“ @repo/http-client      (minimal dependencies)
  βœ“ @repo/core             (helpers, validators)
  βœ“ @repo/i18n             (locales, utilities)
  βœ“ @repo/permissions      (helpers)
  βœ“ @repo/auth             (core, helpers)

Step 2: Services Foundation

  βœ“ API Gateway             (http-client, helpers)
  βœ“ Auth Service            (auth, core, helpers, http-client)
  βœ“ User Service            (http-client, helpers, core)
  βœ“ Organization Service    (http-client, helpers, core)

Step 3: Business Services

  βœ“ Product Service         (http-client, helpers, core, auth)
  βœ“ Order Service           (http-client, helpers, core, product, user)
  βœ“ Analytics Service       (http-client, helpers)

Step 4: Support Services

  βœ“ Settings Service        (http-client, helpers, core)
  βœ“ Notification Service    (http-client, helpers)

Step 5: Micro-Frontends

  βœ“ Shell                   (ui, components, icons, i18n, helpers, hooks, http-client)
  βœ“ Auth Module             (shell, http-client, hooks, auth)
  βœ“ Product Module          (shell, http-client, hooks)
  βœ“ Order Module            (shell, http-client, hooks)
  βœ“ User Module             (shell, http-client, hooks)
  βœ“ Organization Module     (shell, http-client, hooks)
  βœ“ Analytics Module        (shell, http-client, hooks)
  βœ“ Admin Module            (shell, http-client, hooks, permissions)

Summary

This mapping document provides:

  1. Complete Component Inventory - All current code organized by type and location
  2. Export Analysis - What each package/app exports
  3. Dependency Graph - Current vs. target state
  4. Data Flow Patterns - How components interact
  5. Migration Sequencing - Order to extract services
  6. Service Distribution - Where code should live post-migration

The blueprint and this mapping work together to guide a systematic, low-risk migration from monorepo to microservices + micro-frontend architecture.


Document Version: 1.0 Last Updated: August 4, 2026 Audience: Development team, architects, tech leads