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

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, where it configures Fumadocs to serve content:

// 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, 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:

// 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:

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

// 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

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 exports database models, while 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 or the SSH adapter in 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, 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.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →