Monorepo

Hype Stack uses pnpm workspaces for package management and Nx for task orchestration. This gives you fast installs, shared dependencies, and intelligent build caching.

Workspace structure

Defined in pnpm-workspace.yaml:

packages:
  - "apps/*"
  - "packages/*"

Each app and package has its own package.json with a scoped name (@hype-stack/backend, @hype-stack/frontend).

Nx task orchestration

Nx knows the dependency graph between your apps and packages. When you run pnpm build, it builds dependencies first, then dependents. Unchanged projects are skipped via computation caching.

The nx.json file configures:

Adding a package

  1. Create a new folder in packages/:

    mkdir packages/my-lib
    cd packages/my-lib
    pnpm init
    
  2. Set the package name in package.json:

    {
      "name": "@hype-stack/my-lib"
    }
    
  3. Import it from any app:

    pnpm --filter @hype-stack/backend add @hype-stack/my-lib
    

Nx picks up the new package automatically.

Why not just one big app?

The monorepo split pays off when: