Skip to main content

Core Principles

This monorepo follows a clean, scalable architecture designed for server-first development using Next.js App Router, TypeScript, XState, and Yup. It establishes standards for:
  • Separation of Concerns: Clearly delineating responsibilities across layers (UI, Actions, Machines, Services) following principles of Layered Architecture.
  • Microfrontend support: Enabling independent development and deployment of distinct business domain applications using a Microfrontend Architecture approach.
  • Code reuse: Maximizing code sharing across applications via centralized packages.
  • Server state orchestration: Utilizing typed XState machines (State Pattern) to manage complex server-side business processes, orchestrating calls to the Service Layer.
  • Structured Service Layer: Employing a domain-driven structure (Strategy Pattern, Factory Method/Service Locator) for defining service abstractions (interfaces, method DTOs) separately from concrete implementations, invoked by state machines.
For a detailed look at the core workflow, see the Core Workflow Guide. For specifics on backend implementation, see the Backend & Core Logic Guide. For frontend details, see the Frontend Development Guide. For Git standards, see the Git Convention Guide.

Monorepo Structure

The project is organized into apps (deployable units/microfrontends) and packages (shared code).
Project Root Structure
Note: UI components are provided by the external mappnext/ds-tw library, installed as a dependency.

Commands & Setup

Standard commands executed from the root of the monorepo:
Common Development Commands

Shared Package Roles (packages/)

Shared functionality is organized into dedicated packages. UI components come from an external library.
Package aliases (@core, @hooks, @config) are configured in the root tsconfig.json under paths. These aliases must be used for importing shared code from packages/. UI components must be imported directly from mappnext/ds-tw/*.

Tech Stack

The core technologies mandated by this architecture: