Skip to Content

Data Model

Defined in prisma/schema.prisma. All DB access goes through repository classes in src/modules/db/repositories/.

Entities

Site

Represents a domain.

FieldTypeNotes
idUUIDPrimary key
hostnameStringe.g. example.com
nameStringDisplay name
createdAtDateTime
updatedAtDateTime

Crawl

A full-site audit run for a site.

FieldTypeNotes
idUUID
siteIdFK → Site
statusEnumqueued | discovering | scanning | completed | failed | cancelled
totalPagesIntPages discovered
scannedPagesIntPages with completed scans
enrichedPagesIntPages with AI enrichment
overallScoreFloat?Null until crawl completes
maxPagesInt?Per-crawl page cap
newIssuesIntIssues not seen in previous crawl
fixedIssuesIntIssues from previous crawl no longer present

Page

A URL discovered within a site.

FieldTypeNotes
idUUID
siteIdFK → Site
urlStringFull URL
pathStringURL path only
firstSeenCrawlIdFK → CrawlCrawl where this page was first discovered

Scan

A single-page accessibility scan (created for both standalone scans and crawl-initiated scans).

FieldTypeNotes
idUUID
urlString
statusEnumqueued | running | completed | failed | completed_partial | cancelled
progressInt0–100
currentStageString?Current pipeline stage name
pageTitleString?
pageScreenshotString?Base64 PNG
metadataJSON?Browser info, viewport, etc.
retryCountInt

Issue

An accessibility violation found in a scan.

FieldTypeNotes
scanIdFK → Scan (CASCADE)
issueHashStringFingerprint: hash(pageUrl + ruleId + selector)
issueStatusEnumopen | fixed | dismissed | cant_fix
pageUrlString
firstSeenScanIdFK → Scan
lastSeenScanIdFK → Scan
fixedAtCrawlIdFK → Crawl?Set when status transitions to fixed
typeEnumconfirmed | potential
severityEnumcritical | serious | moderate | minor
confidenceScoreFloat?0–1, for potential issues
wcagCriterionStringe.g. 1.1.1
wcagLevelEnumA | AA
elementSelectorStringCSS selector
elementHtmlStringOuter HTML snippet
descriptionStringAI or raw description
fixSuggestionStringAI or raw fix suggestion
axeRuleIdString?axe-core rule ID

ScanSummary

AI-generated summary for a scan. One-to-one with Scan.

FieldTypeNotes
scanIdFK → Scan (unique, CASCADE)
overallScoreInt0–100
summaryStringNarrative summary
topPrioritiesJSONRanked issue list
positiveFindingsJSONWhat the page does well

Repository pattern

All DB access goes through repositories, not direct Prisma calls from processors or API routes:

  • PrismaScanRepository — CRUD for Scan
  • PrismaIssueRepository — CRUD for Issue
  • PrismaSummaryRepository — CRUD for ScanSummary

Next steps

Last updated on