# mohamedalami236887/orchivademoproject architecture

> Architecture diagram of the GitHub repository mohamedalami236887/orchivademoproject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohamedalami236887/orchivademoproject
- Repository: https://github.com/mohamedalami236887/orchivademoproject

## Overview

Orchiva is a local internal request-and-document workflow: employees create and submit requests, role-scoped approvers process sequential tasks, and users can track documents, notifications, and audit history. Angular screens call a Spring REST API; application services enforce rules and PostgreSQL stores workflow and business metadata, with document bytes stored locally. The principal request-to-approval path and several service dependencies are visible in excerpts; broader product capabilities and storage boundaries are also documented in the README. Some unsampled subsystem links are therefore documented rather than source-verified.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/app.routes.ts) (Application routes), [`backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java) (Workflow service), [`backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java) (Document service), [`backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java`](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java) (Request service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Angular workspace"]
  node_routes["Application routes<br/>[app.routes.ts]"]
  node_login["Sign-in<br/>[login.component.ts]"]
  node_request_ui["Request workspace"]
  node_approval_ui["Approval inbox"]
  node_workflow_ui["Workflow Studio"]
  node_dashboard_ui["Dashboard"]
  node_document_ui["Document library"]
  node_audit_ui["Audit explorer"]
end

subgraph group_requests["Requests and approvals"]
  node_request_service["Request service"]
  node_request_store[("Request metadata")]
  node_workflow_service["Workflow service"]
  node_workflow_store[("Workflow and task records")]
end

subgraph group_identity["Identity and administration"]
  node_identity_service["Identity and access"]
  node_user_admin["User administration"]
  node_dashboard_service["Dashboard queries"]
end

subgraph group_records["Documents and traceability"]
  node_document_service["Document service"]
  node_document_store[("Document metadata")]
  node_file_storage[("Local file storage")]
  node_notification_service["Notifications"]
  node_audit_service["Audit recording<br/>[AuditService.java]"]
  node_audit_query["Audit queries"]
  node_audit_store[("Audit events")]
end

node_employee(("Employee or approver"))
node_postgres[("PostgreSQL")]

node_employee -->|"uses"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_request_ui
node_routes -->|"routes to"| node_approval_ui
node_routes -->|"routes to"| node_workflow_ui
node_routes -->|"routes to"| node_dashboard_ui
node_routes -->|"routes to"| node_document_ui
node_routes -->|"routes to"| node_audit_ui
node_request_ui -->|"calls API"| node_request_service
node_approval_ui -->|"calls API"| node_workflow_service
node_workflow_ui -->|"calls API"| node_workflow_service
node_dashboard_ui -->|"calls API"| node_dashboard_service
node_document_ui -->|"calls API"| node_document_service
node_audit_ui -->|"calls API"| node_audit_query
node_request_service -->|"persists requests"| node_request_store
node_request_service -->|"starts workflow"| node_workflow_service
node_workflow_service -->|"loads and saves tasks"| node_workflow_store
node_workflow_service -->|"creates notifications"| node_notification_service
node_workflow_service -->|"records decisions"| node_audit_service
node_request_service -->|"records changes"| node_audit_service
node_document_service -->|"stores and resolves bytes"| node_file_storage
node_document_service -->|"persists metadata"| node_document_store
node_document_service -->|"checks request access"| node_request_service
node_document_service -->|"records uploads"| node_audit_service
node_audit_service -->|"saves events"| node_audit_store
node_request_store -->|"stores metadata"| node_postgres
node_workflow_store -->|"stores workflow state"| node_postgres
node_document_store -->|"stores metadata"| node_postgres
node_audit_store -->|"stores history"| node_postgres
node_file_storage -->|"serves authorized files"| node_employee
node_login -.->|"authenticates"| node_identity_service
node_identity_service -.->|"supports account access"| node_user_admin
node_dashboard_service -.->|"queries operational state"| node_postgres
node_audit_query -.->|"queries events"| node_audit_store
node_workflow_service -->|"notifies approvers"| node_employee

click node_routes "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/app.routes.ts"
click node_login "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/auth/login.component.ts"
click node_request_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/requests/request-list-v2.component.ts"
click node_approval_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/approvals/approval-inbox-v2.component.ts"
click node_workflow_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/workflows/workflow-admin.component.ts"
click node_dashboard_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/dashboard/dashboard-v2.component.ts"
click node_document_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/documents/document-library-v2.component.ts"
click node_audit_ui "https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/audit/audit-v2.component.ts"
click node_request_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java"
click node_request_store "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/request/repository/BusinessRequestRepository.java"
click node_workflow_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java"
click node_workflow_store "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/workflow/repository/WorkflowDefinitionRepository.java"
click node_identity_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/identity/application/CurrentUserService.java"
click node_user_admin "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/identity/application/UserAdministrationService.java"
click node_dashboard_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/administration/application/DashboardService.java"
click node_document_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java"
click node_document_store "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/repository/DocumentRepository.java"
click node_file_storage "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/storage/LocalDocumentStorage.java"
click node_notification_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/notification/application/NotificationService.java"
click node_audit_service "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/application/AuditService.java"
click node_audit_query "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/application/AuditQueryService.java"
click node_audit_store "https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/repository/AuditEventRepository.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_login,node_request_ui,node_approval_ui,node_workflow_ui,node_dashboard_ui,node_document_ui,node_audit_ui toneBlue
class node_request_service,node_request_store,node_workflow_service,node_workflow_store,node_postgres toneAmber
class node_identity_service,node_user_admin,node_dashboard_service toneMint
class node_document_service,node_document_store,node_file_storage,node_notification_service,node_audit_service,node_audit_query,node_audit_store toneRose
class node_employee toneIndigo
```

## Components

### Angular workspace

- [Application routes](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Sign-in](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/auth/login.component.ts): `frontend/src/app/features/auth/login.component.ts`
- [Request workspace](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/requests/request-list-v2.component.ts): `frontend/src/app/features/requests/request-list-v2.component.ts`
- [Approval inbox](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/approvals/approval-inbox-v2.component.ts): `frontend/src/app/features/approvals/approval-inbox-v2.component.ts`
- [Workflow Studio](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/workflows/workflow-admin.component.ts): `frontend/src/app/features/workflows/workflow-admin.component.ts`
- [Dashboard](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/dashboard/dashboard-v2.component.ts): `frontend/src/app/features/dashboard/dashboard-v2.component.ts`
- [Document library](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/documents/document-library-v2.component.ts): `frontend/src/app/features/documents/document-library-v2.component.ts`
- [Audit explorer](https://github.com/mohamedalami236887/orchivademoproject/blob/main/frontend/src/app/features/audit/audit-v2.component.ts): `frontend/src/app/features/audit/audit-v2.component.ts`

### Requests and approvals

- [Request service](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java): `backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java`
- [Request metadata](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/request/repository/BusinessRequestRepository.java): `backend/src/main/java/com/orchiva/workflow/request/repository/BusinessRequestRepository.java`
- [Workflow service](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java): `backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`
- [Workflow and task records](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/workflow/repository/WorkflowDefinitionRepository.java): `backend/src/main/java/com/orchiva/workflow/workflow/repository/WorkflowDefinitionRepository.java`

### Identity and administration

- [Identity and access](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/identity/application/CurrentUserService.java): `backend/src/main/java/com/orchiva/workflow/identity/application/CurrentUserService.java`
- [User administration](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/identity/application/UserAdministrationService.java): `backend/src/main/java/com/orchiva/workflow/identity/application/UserAdministrationService.java`
- [Dashboard queries](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/administration/application/DashboardService.java): `backend/src/main/java/com/orchiva/workflow/administration/application/DashboardService.java`

### Documents and traceability

- [Document service](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java): `backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`
- [Document metadata](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/repository/DocumentRepository.java): `backend/src/main/java/com/orchiva/workflow/document/repository/DocumentRepository.java`
- [Local file storage](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/document/storage/LocalDocumentStorage.java): `backend/src/main/java/com/orchiva/workflow/document/storage/LocalDocumentStorage.java`
- [Notifications](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/notification/application/NotificationService.java): `backend/src/main/java/com/orchiva/workflow/notification/application/NotificationService.java`
- [Audit recording](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/application/AuditService.java): `backend/src/main/java/com/orchiva/workflow/audit/application/AuditService.java`
- [Audit queries](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/application/AuditQueryService.java): `backend/src/main/java/com/orchiva/workflow/audit/application/AuditQueryService.java`
- [Audit events](https://github.com/mohamedalami236887/orchivademoproject/blob/main/backend/src/main/java/com/orchiva/workflow/audit/repository/AuditEventRepository.java): `backend/src/main/java/com/orchiva/workflow/audit/repository/AuditEventRepository.java`

### Other components

- **Employee or approver**
- **PostgreSQL**

## Connections

- Employee or approver → Application routes: uses (evidence: `README.md`)
- Application routes → Sign-in: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Request workspace: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Approval inbox: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Workflow Studio: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Dashboard: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Document library: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Application routes → Audit explorer: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Request workspace → Request service: calls API (evidence: `README.md`)
- Approval inbox → Workflow service: calls API (evidence: `README.md`)
- Workflow Studio → Workflow service: calls API (evidence: `README.md`)
- Dashboard → Dashboard queries: calls API (evidence: `README.md`)
- Document library → Document service: calls API (evidence: `README.md`)
- Audit explorer → Audit queries: calls API (evidence: `README.md`)
- Request service → Request metadata: persists requests (evidence: `backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java`)
- Request service → Workflow service: starts workflow (evidence: `backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java`)
- Workflow service → Workflow and task records: loads and saves tasks (evidence: `backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`)
- Workflow service → Notifications: creates notifications (evidence: `backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`)
- Workflow service → Audit recording: records decisions (evidence: `backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`)
- Request service → Audit recording: records changes (evidence: `backend/src/main/java/com/orchiva/workflow/request/application/RequestService.java`)
- Document service → Local file storage: stores and resolves bytes (evidence: `backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`)
- Document service → Document metadata: persists metadata (evidence: `backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`)
- Document service → Request service: checks request access (evidence: `backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`)
- Document service → Audit recording: records uploads (evidence: `backend/src/main/java/com/orchiva/workflow/document/application/DocumentService.java`)
- Audit recording → Audit events: saves events (evidence: `backend/src/main/java/com/orchiva/workflow/audit/application/AuditService.java`)
- Request metadata → PostgreSQL: stores metadata (evidence: `README.md`)
- Workflow and task records → PostgreSQL: stores workflow state (evidence: `README.md`)
- Document metadata → PostgreSQL: stores metadata (evidence: `README.md`)
- Audit events → PostgreSQL: stores history (evidence: `README.md`)
- Local file storage → Employee or approver: serves authorized files (evidence: `README.md`)
- Sign-in → Identity and access: authenticates
- Identity and access → User administration: supports account access
- Dashboard queries → PostgreSQL: queries operational state (evidence: `README.md`)
- Audit queries → Audit events: queries events
- Workflow service → Employee or approver: notifies approvers (evidence: `backend/src/main/java/com/orchiva/workflow/workflow/application/WorkflowService.java`)
