sequenceDiagram
participant Client
participant App
participant Database
participant Broker as Broker (redis)
participant Worker as Celery Worker
Client->>App: POST /api/document/create
activate App
App->>Database: Insert document
App->>Broker: Enqueue a new task
App->>Client: Response with document ID
deactivate App
Worker->>Broker: Worker picks up task
activate Worker
Worker->>Database: Write result database and EFS
deactivate Worker
Client->>App: GET /api/document/resource
activate App
App->>Database: Fetch document resource
App->>Client: Appropriate response
deactivate App
flowchart TD
Import
Import --> bibtex["BibTeX"]
Import --> code["ID-like"]
code --> DOI["DOI via CrossRef"]
code --> PMID["PMID via PubMed"]
code --> ArxID["ArXivID via ArXiv"]
DOI -->|bibtex|bibtex
PMID -->|bibtex|bibtex
ArxID -->|bibtex|bibtex
bibtex --> Single
bibtex --> Multiple
Single --> ReviewSingle
ReviewSingle --> BibMergeDialog
ReviewSingle --> Create[Create]
ReviewSingle --> Skip
Multiple --> ReviewMultiple
ReviewMultiple --> Create[Create]
ReviewMultiple --> Skip
ReviewMultiple --> ReviewMultipleDialog