How awkdevs/monorepo works
Main Components
• Monorepo Orchestration: At the root level, files such as package.json and turbo.json govern script orchestration and workspace management.
• SPA Applications (located in the apps folder):
• Landing-AWKDEV
• coffe-shop
• proxy (which includes specialized middleware and custom configurations, hinting at how it might intercept or manage API calls or routing)
• web (which is structured as a Next.js application with a dedicated app directory including layout and global styling)
• Shared Library (located in packages/ui): This package comprises reusable UI components (e.g., Card components, NotFound component) and acts as a design system shared among one or more SPAs.
• (Possible) Git Submodules: Act as an integration mechanism for external repositories when adding a new SPA.
Relationships and Interactions
• The Monorepo Orchestration layer ties everything together by managing dependencies, dev scripts (including launching all or specific apps via npm run dev), and workspace configurations.
• Each SPA within the apps folder is an independent single-page application, each with its own build configuration (e.g., next.config.ts, tsconfig.json) but sharing common UI components from packages/ui.
• The shared UI package is imported by the various SPAs, so there is a dependency from each SPA to the UI library.
• The proxy app’s middleware and configuration indicate that it might serve routing, authentication, or API proxying purposes, acting as an intermediary for other services or apps.
• Git submodules are used when adding new SPAs, meaning that new components can be integrated into the monorepo without disturbing the existing structure.
Architectural Patterns and Technologies
• This is a multi-SPA architecture orchestrated via a monorepo approach, and a pattern that closely resembles microfrontend architecture, where each SPA is self-contained but coexists and shares resources with others.
• The use of Next.js in several apps (evidenced by Next configuration and page structure) suggests a React-based frontend framework.
• Turborepo (or a similar tool based on turbo.json) is used for dependency and script management across the workspaces.
• The shared UI component library encourages a modular, reusable design system.
• The middleware in the proxy app indicates use of layered middleware for handling HTTP requests and possibly API routing.
b. Inside this container, split out the “Apps” section. Create individual blocks for each SPA:
• "Landing-AWKDEV"
• "coffe-shop"
• "proxy" (emphasize its middleware and Next.js configuration)
• "web" (include components like app directory, global styles, layout, and pages)
d. Dependency paths:
• Connections from SPAs to the shared UI library.