Module Boundaries

Understanding the package structure and dependencies in the admin panel.

🔗 Dependency Graph

Key Principle: Dependencies flow in one direction - no circular dependencies.

Package Responsibilities

@monorepo/solid-pkg-core

Location: admin/packages/core/ Exports:
  • api - REST API client
  • auth - Better Auth integration
  • hooks - TanStack Query hooks
  • config - Environment configuration
  • utils - Utility functions (cn, etc.)
Example Imports:

@monorepo/solid-pkg-ui

Location: admin/packages/ui/ Exports:
  • GlassCard - Card component with glassmorphism
  • GlassButton - Button component with variants
  • ProtectedRoute - Auth guard wrapper
  • AuthGuard - Conditional auth rendering
Example Imports:

@monorepo/solid-admin-panel

Location: admin/apps/panel/ Purpose: Main application that composes features Contents:
  • Routes and pages
  • App-specific components
  • Feature composition
  • Layout components

Import Rules

✅ Allowed

❌ Not Allowed


Benefits

Clear Separation

  • Business logic separate from UI
  • UI separate from app logic
  • No circular dependencies

Reusability

  • Core can be used by other apps
  • UI can be used by other admin apps
  • Easy to share code

Type Safety

  • TypeScript types work across packages
  • Full IntelliSense support
  • Compile-time error checking