This document provides sequence-style descriptions of cross-component behavior with concrete API payload examples.
System components:
sequenceDiagram
participant FE as Frontend (Desktop or Mobile)
participant BE as Backend API
participant DB as MongoDB
participant FS as Image Storage
FE->>BE: POST /employee/create or /visitor/create
BE->>DB: Insert profile document
DB-->>BE: Created record with generated EA/VA id
BE-->>FE: EmployeeRead or VisitorRead
FE->>BE: POST /image/upload (owner_id + files[])
BE->>BE: Validate owner id and file types
BE->>BE: Preprocess images
BE->>FS: Save processed enrollment images
BE-->>FE: Upload manifest with paths
POST /employee/create
Content-Type: application/json
X-API-Key: <key>
{
"fullName": "Jane Doe",
"gender": "female",
"DoB": "1997-05-10",
"email": "jane@example.com",
"Phone": "+447000000000"
}
{
"id": "EAABC123",
"fullName": "Jane Doe",
"gender": "female",
"DoB": "1997-05-10",
"email": "jane@example.com",
"Phone": "+447000000000"
}
POST /image/upload
Content-Type: multipart/form-data
X-API-Key: <key>
Form fields:
{
"owner_id": "EAABC123",
"owner_type": "employee",
"uploaded": [
"temp_images/EAABC123_20260411_102030_123456_face_0.jpg",
"temp_images/EAABC123_20260411_102031_123457_face_1.jpg",
"temp_images/EAABC123_20260411_102032_123458_face_2.jpg"
]
}
sequenceDiagram
participant FE as Desktop Check-In
participant BE as Backend /image/search
participant FS as Enrolled Images
participant DF as DeepFace
participant DB as MongoDB
FE->>BE: POST /image/search (captured image)
BE->>BE: Validate image + detect required face
BE->>DF: Search nearest candidates
DF-->>BE: Best candidate rows
BE->>BE: Group by owner and check ambiguity
alt Candidate found
BE->>DF: Analyze soft attributes
BE->>FS: Load owner reference images
BE->>DF: Verify pairwise embeddings
BE->>DB: Load owner profile
BE-->>FE: Match payload with confirmation_required true/false
else No candidate
BE-->>FE: New visitor payload
end
| Branch | Condition | Frontend-visible result |
|---|---|---|
| No match | No owner candidate found | message = Welcome new visitor, no owner object |
| Ambiguous | Best owner too close to runner-up | owner omitted, confirmation_required false |
| Unconfirmed | Owner candidate exists, verification fails | owner omitted, confirmation_required false |
| Confirmed | Owner candidate and verification passes | employee or visitor object returned, confirmation_required true |
sequenceDiagram
participant U as User
participant M as Mobile App
participant BE as Backend
U->>M: Complete identity form
M->>BE: Create profile API call
BE-->>M: Record ID
loop Five poses
U->>M: Capture pose
M->>M: Store capture in local state
end
M->>BE: Upload images (multipart)
alt Upload success
BE-->>M: Upload manifest
M-->>U: Setup success screen
else Upload failure
BE-->>M: Error response
M-->>U: Error + retry button
end
When writing report claims, cross-reference these implementation points: