How knaw-huc/annorepo works
AnnoRepo is a W3C Web Annotation Protocol service with custom batch-upload, search, and indexing APIs. A typical client sends annotation or query requests through the HTTP client to server resources; those resources use container persistence and, for search or index operations, background chore managers. Shared API types represent annotation pages and index types. The tree and excerpts also identify authentication, custom queries, and gRPC services. Some relationships and subsystem internals are documented or indexed but not sampled, so those links are dashed where their wiring is unverified.
Main entry points: ContainerServiceResource.kt Container services · AnnoRepoClient.kt AnnoRepo client · ContainerDAO.kt Container storage · SearchManager.kt Search manager
Components 22
Client and API
- AnnoRepo client
client/src/main/kotlin/nl/knaw/huc/annorepo/client/AnnoRepoClient.kt - Annotation pages
common/src/main/kotlin/nl/knaw/huc/annorepo/api/AnnotationPage.kt - API paths
common/src/main/kotlin/nl/knaw/huc/annorepo/api/ResourcePaths.kt - Index types
common/src/main/kotlin/nl/knaw/huc/annorepo/api/IndexType.kt
HTTP resources
- Container services
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Global services
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/GlobalServiceResource.kt - W3C protocol
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/W3CResource.kt - Batch upload
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/BatchResource.kt
Search and indexing
- Search manager
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/SearchManager.kt - Search jobs
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/SearchChore.kt - Query stages
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/AggregateStageGenerator.kt - Index manager
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/IndexManager.kt - Index jobs
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/IndexChore.kt
Persistence and identity
- Container storage
server/src/main/kotlin/nl/knaw/huc/annorepo/dao/ContainerDAO.kt - Custom queries
server/src/main/kotlin/nl/knaw/huc/annorepo/dao/CustomQueryDAO.kt - Container access
server/src/main/kotlin/nl/knaw/huc/annorepo/dao/ContainerUserDAO.kt - Authentication
server/src/main/kotlin/nl/knaw/huc/annorepo/auth/AROAuthAuthenticator.kt
Protocols and auth
- gRPC upload
server/src/main/kotlin/nl/knaw/huc/annorepo/grpc/AnnotationUploadService.kt - gRPC search
server/src/main/kotlin/nl/knaw/huc/annorepo/grpc/AnnotationSearchService.kt
Other components
- API user
- OpenID provider
- SRAM provider
Connections 20
- API user → AnnoRepo client: uses
- AnnoRepo client → Container services: calls HTTP
client/src/main/kotlin/nl/knaw/huc/annorepo/client/AnnoRepoClient.kt - AnnoRepo client → Annotation pages: parses pages
client/src/main/kotlin/nl/knaw/huc/annorepo/client/AnnoRepoClient.kt - Container services → Container storage: reads and writes
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Container services → Container access: manages access
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Container services → Custom queries: loads queries
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Container services → Query stages: builds stages
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Container services → Index manager: starts indexing
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - Index manager → Container storage: gets collection
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/IndexManager.kt - Index manager → Index jobs: dispatches job
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/IndexManager.kt - Global services → Search manager: starts searches
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/GlobalServiceResource.kt - Search manager → Search jobs: dispatches job
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/SearchManager.kt - Search manager → Container storage: supplies storage
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/tools/SearchManager.kt - Container services → W3C protocol: serves protocol
- AnnoRepo client → Batch upload: uploads batches
- AnnoRepo client → Global services: requests search
- Container services → Index types: accepts index types
server/src/main/kotlin/nl/knaw/huc/annorepo/resources/ContainerServiceResource.kt - gRPC upload → Container storage: stores annotations
server/src/main/kotlin/nl/knaw/huc/annorepo/grpc/AnnotationUploadService.kt - Authentication → OpenID provider: authenticates with
- Authentication → SRAM provider: authenticates with