Skip to content

Documentation

concept
3 min readUpdated

The Documentation subsystem manages automation configuration, scenario candidates, and documentation jobs through DocAutomationController, including starting, listing, retrieving, cancelling, and externally reporting job progress or terminal failure. It generates AI-powered user documentation and complete documentation from a Neo4j knowledge graph, supports change-aware screen baselines and background screenshots, and manages webhook or schedule triggers, secrets, deliveries, and CI/CD URLs. It also owns the Manual Video reader surface for listing, editing, and re-rendering page-video narration scripts.

200 entities in atloria-monorepo/apps/api/src/documentation. 6 other subsystems depend on it, which makes it the 9th most depended-upon part of this codebase.

What it is made of

Its 200 entities sit in 31 files under atloria-monorepo/apps/api/src/documentation: 96 doc comments, 31 HTTP endpoints, 31 interfaces, 18 services and 24 more. doc-automation.controller.ts holds 22 of them — more than any other file here. DocAutomationService declares 23 methods, the widest surface here.

Where work enters

5 controllers publish 31 HTTP endpoints — 14 GET, 12 POST, 2 PUT and 2 DELETE. They answer under /doc-automation, /documentation and /manual-videos, and 2 more base paths. DocAutomationController carries 21 of them; the remaining 10 are split across 4 other controllers. 30 of them declare a guard — JwtAuthGuard on 30 and RolesGuard on 10 — and 1 declares none.

  • DocAutomationControlleratloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:39
  • createConfigatloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:50
  • getConfigatloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:64
  • getScreenBaselineatloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:77
  • updateConfigatloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:95
  • deleteConfigatloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:111

How work moves through it

mermaid
flowchart LR
  DocAutomationController0["DocAutomationController"]
  DocAutomationService10["DocAutomationService"]
  DocAutomationController0 --> DocAutomationService10
  PrismaService20["PrismaService"]
  DocAutomationService10 --> PrismaService20
  DocAutomationGateway21["DocAutomationGateway"]
  DocAutomationService10 --> DocAutomationGateway21
  UrlService22["UrlService"]
  DocAutomationService10 --> UrlService22
  AssetsService23["AssetsService"]
  DocAutomationService10 --> AssetsService23
  more1["+14 more"]
  DocAutomationService10 --> more1
  DocumentIndexingService20["DocumentIndexingService"]
  AzureSearchService30["AzureSearchService"]
  DocumentIndexingService20 --> AzureSearchService30
  KeywordExtractorService31["KeywordExtractorService"]
  DocumentIndexingService20 --> KeywordExtractorService31
  SnippetsService32["SnippetsService"]
  DocumentIndexingService20 --> SnippetsService32
  AzureBlobService33["AzureBlobService"]
  DocumentIndexingService20 --> AzureBlobService33
  more2["+8 more"]
  DocumentIndexingService20 --> more2
  DocsRepoQueue40["DocsRepoQueue"]
  SnippetsService32 --> DocsRepoQueue40
  stop["refused"]
  DocAutomationService10 -. "NotFoundException" .-> stop

Work enters at DocAutomationController and passes through 32 other components. Each step below is a dependency edge between two entities in this repository, followed outward in order.

  1. DocAutomationController takes the work first — atloria-monorepo/apps/api/src/documentation/doc-automation.controller.ts:39.
  2. Next, DocAutomationController hands off to DocAutomationServiceatloria-monorepo/apps/api/src/documentation/services/doc-automation.service.ts:109.
  3. Then, DocAutomationService calls PrismaService, DocAutomationGateway, UrlService and AssetsService, along with 14 more.
  4. Then, DocumentIndexingService calls AzureSearchService, KeywordExtractorService, SnippetsService and AzureBlobService, along with 8 more.
  5. Finally, SnippetsService hands off to DocsRepoQueueatloria-monorepo/apps/api/src/docs-repo/docs-repo-queue.service.ts:31.

Where the work stops

  • DocAutomationService stops the work with NotFoundException when !job — “Documentation job not found”, in 9 places.
  • DocAutomationService stops the work with ForbiddenException when job.organizationId !== user.organizationId && !this.isServiceAccount(user) — “You do not have access to this job”, in 4 places.
  • AssetsService stops the work with BadRequestException when !asset — “Asset not found”, in 2 places.
  • AssetsService stops the work with BadRequestException when !allowedMimeTypes.includes(file.mimetype) — “Invalid file type. Only JPEG, PNG, GIF, and WebP images are allowed.”.
  • SnippetsService stops the work with NotFoundException when !snippet.

When a step fails

  • DocAutomationService handles failure in 48 places: it logs it and continues in 32, discards it silently in 11, lets it reach the caller in 3, and turns it into a return value in 2. A failure discarded silently leaves no trace for whoever debugs this later.
  • PrismaService handles failure in 1 place: it lets it reach the caller in all 1.
  • AzureSearchService handles failure in 10 places: it lets it reach the caller in 9, and turns it into a return value in 1.
  • SnippetsService handles failure in 2 places: it logs it and continues in all 2.

How it refuses and fails

18 of its components record a refusal or a failure handler. 16 of them refuse work outright, under a condition written into the component itself. Their catch blocks handle a failure that already happened in 92 places. Of those 92, 48 log it and continue, 16 turn it into a return value, 16 let it reach the caller and 12 discard it without recording anything. DocAutomationService holds 11 of the silent ones — a failure discarded silently leaves no trace for whoever debugs this later.

Boundaries

6 other subsystems depend on this oneApi, Document, Project, Support Agent, Technical Docs, Webhooks. Changing what it exposes changes them.

Those 6 hold 10 edges between them, unevenly: Project reaches in across 3 edges, while 4 of them hold one each. 45 edges leave it against 10 arriving — it reads more of this repository than this repository reads of it. What they reach is narrower than the folder: 4 of its 200 members carry every inbound edge — DocumentIndexingService (6), DocAutomationService (2) and DocumentationModule (1), plus 1 more. Of the 45 it sends out, 12 go to Ai — more than to any other.

It depends on Database, Auth, Ai, Graph, Doc Version, Snippets, Changelog, Docs Repo, L10n, Notification, Email, Billing, Document, Assets, Change Request, Project, and on nothing else in this repository.

How this code is named

These conventions cover most of the codebase. Learning them is faster than reading an index — each one lets you find any member of its family without looking it up.

PatternWhereCountExamples
*.service.tsacross the repository18web-crawler.service.ts, manual-video.service.ts, azure-search.service.ts, documentation.service.ts
*.controller.tsapi/src/documentation/5search.controller.ts, manual-video.controller.ts, documentation.controller.ts, doc-automation.controller.ts

Was this page helpful?

Download as PDF
Documentation — Atloria (self dogfood)