Skip to content

About

Pluggable .NET 9 + Postgres document builder with YJS collaboration, versioning, dynamic tables, and Playwright PDF export.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Document Builder

CI

A .NET 9 + PostgreSQL document builder with real-time collaboration (YJS), inline comments and @mentions, full version history, dynamic-table data binding, artifact sharing, and Playwright-based PDF export.

Backend-first. A minimal test UI is included to exercise every feature end-to-end.

Local Setup

Prerequisites: Docker Desktop, .NET 9 SDK, EF Core CLI (dotnet tool install -g dotnet-ef)

First-run (three commands):

# 1. Start Postgres
docker compose up -d

# 2. Apply migrations
dotnet ef database update --project src/DocumentBuilder.Infrastructure --startup-project src/DocumentBuilder.Api

# 3. Run the API
dotnet run --project src/DocumentBuilder.Api

Then verify: GET http://localhost:5000/health should return {"status":"ok","db":"ok"} (HTTP 200).

Connection string — appsettings.Development.json points to localhost:5432 with user/password postgres/postgres. For production or team environments, override via environment variable:

export ConnectionStrings__Default="Host=...;Port=5432;Database=documentbuilder;Username=...;Password=..."

Or use .NET User Secrets:

cd src/DocumentBuilder.Api
dotnet user-secrets set "ConnectionStrings:Default" "Host=localhost;Port=5432;Database=documentbuilder;Username=postgres;Password=<your-password>"

Tear down:

docker compose down          # stop containers (data volume preserved)
docker compose down -v       # stop + delete volume (fresh state)

Playwright / PDF Setup

Install Playwright browsers (one-time after first build):

# Build first so the playwright.ps1 bootstrap script is available
dotnet build src/DocumentBuilder.Api

# Install headless Chromium
pwsh src/DocumentBuilder.Api/bin/Debug/net9.0/playwright.ps1 install chromium

For Release builds:

dotnet build src/DocumentBuilder.Api --configuration Release
pwsh src/DocumentBuilder.Api/bin/Release/net9.0/playwright.ps1 install chromium

PDF cold-start budget

Scenario Target Notes
Warm (browser already launched, new context) ≤ 5 s NewContextAsync + NewPageAsync + GotoAsync("about:blank")
Cold (first request after app start) ≤ 30 s Includes Playwright.CreateAsync() + Chromium.LaunchAsync()

Verify with the smoke endpoint after startup:

curl http://localhost:5000/api/debug/pdf-smoke
# → {"status":"ok","launchMs":412}

launchMs measures only the context/page/navigate round trip (warm path). The first call will be slower (cold browser launch); subsequent calls should be well within the 5 s warm budget.

In CI the browsers directory (~/.cache/ms-playwright) is cached via actions/cache keyed on the Infrastructure .csproj hash, so Chromium is downloaded only when the Playwright version changes.

Status

Pre-scaffolding. See plan.md for the delivery plan, waves, and per-milestone ticket breakdown.

Linear project: Document Builder · target 2026-09-30

Stack

  • .NET 9 (ASP.NET Core Web API)
  • PostgreSQL (EF Core, JSONB for document state)
  • Y.js CRDT via WebSocket for real-time collaboration
  • Playwright (headless Chromium) for PDF export
  • React + Vite test UI

Layout (planned)

src/
  DocumentBuilder.Api/                  # ASP.NET Core host
  DocumentBuilder.Core/                 # Domain, controls registry, contracts
  DocumentBuilder.Infrastructure/       # EF Core, Postgres, providers
tests/
  DocumentBuilder.UnitTests/
  DocumentBuilder.IntegrationTests/
ui/                                     # React test UI (M8)
scripts/                                # validate-obj-NNN.ps1 per ticket
validation/                             # captured DB + API evidence per ticket

Working agreement

  • Branch per ticket from main using Linear's gitBranchName
  • One PR per ticket, base branch main, squash-merge
  • No ticket merges without both a DB check and a live-API check captured under validation/
  • See plan.md for the full per-ticket workflow and CI gates

About

Pluggable .NET 9 + Postgres document builder with YJS collaboration, versioning, dynamic tables, and Playwright PDF export.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages