# Does Openship Have a Build Directory? Understanding the Multi-App Build Architecture

> Explore Openship's multi-app build architecture. Learn how each sub-application uses dedicated build directories for compilation, bundling, and distribution in this monorepo.

- Repository: [oblien/openship](https://github.com/oblien/openship)
- Tags: internals
- Published: 2026-07-31

---

**Yes, Openship contains multiple `build` directories across its monorepo architecture, with each major sub-application maintaining dedicated folders for compilation, bundling, and distribution.**

Openship is organized as a multi-application monorepo where distinct components require separate build pipelines. Unlike repositories with a single output folder, Openship distributes build artifacts across several application-specific directories that handle Electron packaging, CLI staging, and web deployment preparation.

## Desktop Application Build Directory

The **desktop client** maintains its build infrastructure at `apps/desktop/build/`. This directory contains orchestration scripts responsible for Electron packaging and binary creation rather than traditional compiled output folders.

Key files in this directory include:

- **`bundle.mjs`** – Orchestrates the production bundling process for the Electron application
- **`run.mjs`** – Executes the packaged desktop binary during development and testing
- **[`stage.ts`](https://github.com/oblien/openship/blob/main/stage.ts)** – Handles pre-build staging steps for assets and resources before final compilation

These TypeScript and JavaScript modules work together to transform source code into distributable desktop applications for Windows, macOS, and Linux.

## CLI Application Build Directory

The **command-line interface** utilizes `apps/cli/build/` to prepare server and dashboard components for distribution. This directory focuses on staging scripts that bundle the CLI's dependencies and ancillary services.

Critical build files include:

- **[`stage-server.ts`](https://github.com/oblien/openship/blob/main/stage-server.ts)** – Prepares the server-side bundle required for CLI operation
- **[`stage-dashboard.ts`](https://github.com/oblien/openship/blob/main/stage-dashboard.ts)** – Bundles the dashboard components that the CLI can serve locally

These scripts ensure the CLI can function as a standalone tool with embedded web assets, independent of the main repository structure.

## Dashboard Web Application Build References

While the **web dashboard** does not use a static `build/` folder on disk, it implements a dynamic build visualization layer at `apps/dashboard/src/app/(dashboard)/(deployment)/build/[id]/page.tsx`. This Next.js route renders deployment-specific build details within the UI, allowing users to monitor build status and logs through the web interface.

The actual compiled assets for the dashboard are generated in standard Next.js output directories (`.next/` or `dist/`) during the build process, separate from the source-level build route implementation.

## Building Openship Applications

You can generate the contents of these build directories using pnpm workspace commands. Each command invokes the scripts located in the respective `build/` folders:

```bash

# Build the desktop client (populates apps/desktop/build/)

pnpm --filter @openship/desktop run build

# Build the CLI (executes staging in apps/cli/build/)

pnpm --filter @openship/cli run build

# Build the web dashboard (generates static assets)

pnpm --filter @openship/dashboard run build

```

These commands trigger the TypeScript compilation, asset bundling, and packaging workflows defined in each application's build scripts.

## Summary

- **Openship uses multiple build directories** rather than a single centralized location, reflecting its multi-app architecture
- The **desktop application** stores build scripts at `apps/desktop/build/` (including `bundle.mjs`, `run.mjs`, and [`stage.ts`](https://github.com/oblien/openship/blob/main/stage.ts))
- The **CLI application** maintains staging scripts at `apps/cli/build/` (including [`stage-server.ts`](https://github.com/oblien/openship/blob/main/stage-server.ts) and [`stage-dashboard.ts`](https://github.com/oblien/openship/blob/main/stage-dashboard.ts))
- The **dashboard** implements build visualization through a dynamic route at `apps/dashboard/src/app/(dashboard)/(deployment)/build/[id]/page.tsx`
- Build artifacts are generated via pnpm workspace filters targeting `@openship/desktop`, `@openship/cli`, and `@openship/dashboard`

## Frequently Asked Questions

### Where is the main build directory located in Openship?

Openship does not use a single main build directory. Instead, build-related files are distributed across application-specific paths: `apps/desktop/build/` for the Electron client and `apps/cli/build/` for the command-line interface. The web dashboard uses standard Next.js output directories rather than a custom build folder.

### What files are generated in the Openship desktop build folder?

The `apps/desktop/build/` directory contains orchestration scripts rather than generated binaries. Key files include `bundle.mjs` for production packaging, `run.mjs` for executing the packaged app, and [`stage.ts`](https://github.com/oblien/openship/blob/main/stage.ts) for pre-build asset preparation. The actual distributable binaries are created elsewhere in the file system during the Electron packaging process.

### Does Openship use a single build directory for all applications?

No, Openship employs a decentralized build architecture. Each major component (desktop, CLI, dashboard) manages its own build process and output locations. This separation allows independent versioning and packaging of the Electron desktop client, the Node.js CLI, and the Next.js web application without shared build artifacts.

### How do I build the Openship CLI from source?

Execute `pnpm --filter @openship/cli run build` from the repository root. This command triggers the staging scripts in `apps/cli/build/`, specifically [`stage-server.ts`](https://github.com/oblien/openship/blob/main/stage-server.ts) and [`stage-dashboard.ts`](https://github.com/oblien/openship/blob/main/stage-dashboard.ts), which bundle the necessary components for standalone CLI distribution.