Skip to content

Project

reference
3 min readUpdated

Kind: Database Model

Source: atloria-monorepo/libs/database/prisma/schema.prisma

Project represents a repository-backed project owned by an organization. It stores project identity, repository connection details, theme selection, and flexible JSON settings used to configure project-specific behavior.

Fields

FieldTypeRequiredKey
idStringPK
nameString
slugString
descriptionString-
organizationIdString
themeIdString-
repoUrlString-
repoBranchString
settingsJson-
createdAtDateTime
updatedAtDateTime
isPublicBoolean
publishedAtDateTime-
urlIdString-unique
publishedSlugString-
toursEnabledBoolean
categoriesCategory[]
documentsDocument[]
flowsFlow[]
kgEntitiesKGEntity[]
membersProjectMember[]
screenshotJobsScreenshotJob[]
screenshotsScreenshot[]
autoDocConfigProjectAutoDocConfig-
technicalSnapshotTechnicalSnapshot-
technicalStaleEntitiesTechnicalStaleEntity[]
docsPrConfigDocsPrConfig-
docsPullRequestsDocsPullRequest[]
docsRepoProjectDocsRepo-
docsOutboxDocsOutbox[]
docGenerationRunsDocGenerationRun[]
docsChangeRequestsDocsChangeRequest[]
docsSyncProjectDocsSync-
supportAgentConfigsSupportAgentConfig[]
chatInteractionsChatInteraction[]
chatSessionsChatSession[]
chatMessagesChatMessage[]
slackIntegrationsSlackIntegration[]
pmeJobsPmeGenerationJob[]
pmePagesPmeGeneratedPage[]
pmeAssetsPmeGeneratedAsset[]
docVersionsDocVersion[]
webhookDeliveriesWebhookDelivery[]
docPageViewsDocPageView[]
docSearchQueriesDocSearchQuery[]
auditEventsAuditEvent[]
scheduledReportsScheduledReport[]
exportHistoryExportHistory[]
brandingProjectBranding-
accessPolicyProjectAccessPolicy-
readerIdentityConfigReaderIdentityConfig-
shareLinksDocsShareLink[]
docFeedbackDocFeedback[]
docIssueReportsDocIssueReport[]
boardsBoard[]
sourceConnectorsSourceConnector[]
customDomainCustomDomain-
readerProfilesReaderProjectProfile[]
readerApiKeysReaderApiKey[]

Diagram

mermaid
erDiagram
  PROJECT {
    String id PK
    String name
    String slug
    String description
    String organizationId FK
    String themeId FK
    String repoUrl
    String repoBranch
    Json settings
    DateTime createdAt
  }

  ORGANIZATION ||--o{ PROJECT : owns
  THEME ||--o{ PROJECT : uses

Usage

ts
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

const project = await prisma.project.create({
  data: {
    name: "Atloria Documentation",
    slug: "atloria-docs",
    description: "Documentation site for the Atloria platform.",
    organizationId: "org_123",
    themeId: "theme_default",
    repoUrl: "https://github.com/atloria/docs.git",
    repoBranch: "main",
    settings: {
      deployment: {
        provider: "vercel",
        autoDeploy: true,
      },
      documentation: {
        defaultLocale: "en",
      },
    },
  },
});

const projects = await prisma.project.findMany({
  where: {
    organizationId: "org_123",
  },
  orderBy: {
    createdAt: "desc",
  },
});

AI Coding Instructions

  • Scope all project reads and mutations by organizationId to preserve tenant isolation.
  • Treat slug as a stable, URL-safe identifier; validate and normalize it before creating or updating projects.
  • Store extensible configuration in settings, but validate its expected shape at the application boundary.
  • Do not expose repository credentials or sensitive connection data through repoUrl, settings, or API responses.
  • Use repoBranch when integrating repository synchronization, build, or deployment workflows.

Relationships

  • HAS_ONE → Organization
  • HAS_ONE → Theme

Referenced By

  • ProjectMember (HAS_ONE)
  • Category (HAS_ONE)
  • KGEntity (HAS_ONE)
  • Flow (HAS_ONE)
  • ScreenshotJob (HAS_ONE)
  • Screenshot (HAS_ONE)
  • WebhookDelivery (HAS_ONE)
  • TechnicalStaleEntity (HAS_ONE)
  • DocsPrConfig (HAS_ONE)
  • ProjectDocsRepo (HAS_ONE)
  • DocsOutbox (HAS_ONE)
  • DocGenerationRun (HAS_ONE)
  • SupportAgentConfig (HAS_ONE)
  • SourceConnector (HAS_ONE)
  • CustomDomain (HAS_ONE)
  • ChatSession (HAS_ONE)
  • ChatInteraction (HAS_ONE)
  • ChatMessage (HAS_ONE)
  • SlackIntegration (HAS_ONE)
  • DocsShareLink (HAS_ONE)
  • DocPageView (HAS_ONE)
  • DocSearchQuery (HAS_ONE)
  • DocFeedback (HAS_ONE)
  • ScheduledReport (HAS_ONE)
  • ExportHistory (HAS_ONE)
  • AuditEvent (HAS_ONE)
  • PmeGenerationJob (HAS_ONE)
  • PmeGeneratedPage (HAS_ONE)
  • PmeGeneratedAsset (HAS_ONE)
  • DocIssueReport (HAS_ONE)
  • ReaderProjectProfile (HAS_ONE)
  • ReaderApiKey (HAS_ONE)
  • ProjectDocsSync (HAS_ONE)

Was this page helpful?

Download as PDF