# What Is the Purpose of the `src` Directory in oblien/openship?

> Discover the purpose of the src directory in oblien/openship, housing source code for React components, database schemas, and deployment logic. Learn where the core of Openship lives.

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

---

**The `src` directories across the Openship monorepo hold the actual source code for every runnable component, serving as the single source of truth for React components, database schemas, and deployment logic that gets compiled during the build process.**

The oblien/openship repository is organized as a **monorepo** containing multiple applications and shared libraries. Within this architecture, the `src` directories house the uncompiled TypeScript and TSX files that define the platform's public dashboards, internal admin tools, and reusable utilities, making them essential to understanding the purpose of the src directory in oblien/openship.

## Structure of `src` Across the Openship Monorepo

The repository divides source code into two main areas: `apps/` for runnable services and `packages/` for shared libraries. Each contains a `src` folder that stores the raw **TypeScript** files before compilation. According to the oblien/openship source code, these directories contain everything from React components and route handlers to Prisma schema definitions and SSH adapter implementations.

### Public Web Dashboard (`apps/web/src`)

The `apps/web/src` directory implements the public-facing Web dashboard. It contains React components, page routes, styling utilities, and documentation loaders. For example, the entry point for the documentation source loader lives in [`apps/web/src/lib/source.ts`](https://github.com/oblien/openship/blob/main/apps/web/src/lib/source.ts), where it configures Fumadocs to serve content:

```tsx
// apps/web/src/lib/source.ts – loads documentation pages for the web dashboard
import { docs, resources } from "@/.source/server";
import { loader } from "fumadocs-core/source";

export const docsSource = loader({
  baseUrl: "/docs",
  source: docs.toFumadocsSource(),
});

```

Additionally, the landing page hero section is defined in [`apps/web/src/components/landing/hero.tsx`](https://github.com/oblien/openship/blob/main/apps/web/src/components/landing/hero.tsx), demonstrating how UI components are colocated with business logic in the source tree.

### Internal Admin Dashboard (`apps/dashboard/src`)

The `apps/dashboard/src` directory contains the UI and logic for the internal dashboard that administrators use to manage deployments, settings, and resources. Utility functions shared across this admin interface reside here, such as the date-formatting helper in [`apps/dashboard/src/utils/date.ts`](https://github.com/oblien/openship/blob/main/apps/dashboard/src/utils/date.ts):

```tsx
// apps/dashboard/src/utils/date.ts – helper used throughout the dashboard UI
export const formatDate = (date: string | Date, fmt = "yyyy‑MM‑dd") =>
  new Intl.DateTimeFormat("en‑US", { dateStyle: "short" }).format(new Date(date));

```

### Shared Libraries (`packages/*/src`)

Each package under `packages/` exposes reusable functionality via its own `src` directory. As implemented in oblien/openship, these include:

- **Database Layer**: [`packages/db/src/schema/index.ts`](https://github.com/oblien/openship/blob/main/packages/db/src/schema/index.ts) centrally exports all Prisma models for users, sessions, organizations, and invitations.
- **UI Primitives**: [`packages/ui/src/lib/cn.ts`](https://github.com/oblien/openship/blob/main/packages/ui/src/lib/cn.ts) provides class-name utilities for the shared component library.
- **Adapter System**: [`packages/adapters/src/system/ssh-client.ts`](https://github.com/oblien/openship/blob/main/packages/adapters/src/system/ssh-client.ts) implements the SSH client used by the deployment engine.

The database package serves as a critical example, re-exporting schema definitions for consumption across the monorepo:

```ts
// packages/db/src/schema/index.ts – re‑exports all Prisma models for the DB package
export { user, session, account, verification } from "./auth";
export { organization, member, invitation } from "./organization";
// …other model exports

```

## Build Pipeline and Compilation

All **compiled assets**—such as the built JavaScript bundles and type definitions—are generated from these `src` trees during the build step (`pnpm run build`). The source files remain the authoritative versions of the code, while the build process transpiles TypeScript and bundles dependencies for production deployment. This separation ensures that the `src` directories act as the immutable **single source of truth** for application logic, while the output folders contain generated artifacts that should not be manually edited.

## Summary

- The `src` directories contain the uncompiled **source code** for every application and package in the oblien/openship monorepo.
- `apps/web/src` and `apps/dashboard/src` implement the public and admin UIs, respectively, including components in [`apps/web/src/components/landing/hero.tsx`](https://github.com/oblien/openship/blob/main/apps/web/src/components/landing/hero.tsx) and utilities in [`apps/dashboard/src/utils/date.ts`](https://github.com/oblien/openship/blob/main/apps/dashboard/src/utils/date.ts).
- `packages/*/src` provides shared logic, such as Prisma schema exports in [`packages/db/src/schema/index.ts`](https://github.com/oblien/openship/blob/main/packages/db/src/schema/index.ts) and the SSH client in [`packages/adapters/src/system/ssh-client.ts`](https://github.com/oblien/openship/blob/main/packages/adapters/src/system/ssh-client.ts).
- During `pnpm run build`, TypeScript files in `src` are transpiled into production bundles, making these directories the foundation of the platform's **build pipeline**.

## Frequently Asked Questions

### What file types are stored in the `src` directories?

The `src` directories contain TypeScript (`.ts`) and TSX (`.tsx`) files, including **React components**, utility functions, route handlers, and Prisma schema definitions. For example, [`packages/db/src/schema/index.ts`](https://github.com/oblien/openship/blob/main/packages/db/src/schema/index.ts) exports database models, while [`apps/web/src/lib/source.ts`](https://github.com/oblien/openship/blob/main/apps/web/src/lib/source.ts) handles documentation loading logic.

### How does the `src` directory structure differ between apps and packages?

In `apps/`, each `src` folder contains runnable application code specific to that service, such as `apps/dashboard/src` for the admin UI. In `packages/`, the `src` folders contain reusable library code shared across applications, like the class-name utility in [`packages/ui/src/lib/cn.ts`](https://github.com/oblien/openship/blob/main/packages/ui/src/lib/cn.ts) or the SSH adapter in [`packages/adapters/src/system/ssh-client.ts`](https://github.com/oblien/openship/blob/main/packages/adapters/src/system/ssh-client.ts).

### Where are database models defined in the Openship source?

Database entities are defined in [`packages/db/src/schema/index.ts`](https://github.com/oblien/openship/blob/main/packages/db/src/schema/index.ts), which re-exports Prisma models for authentication (users, sessions, accounts) and organizations (members, invitations). This file serves as the centralized interface for database types used throughout the monorepo.

### How is code in the `src` directories compiled for production?

During the build step (`pnpm run build`), the **TypeScript** compiler processes files in each `src` directory and outputs bundled JavaScript to distribution folders. The `src` directories remain the single source of truth, while the compiled assets are generated artifacts that power the deployed Openship platform.