# mizcausevic-dev/cyberark-access-review-sync architecture

> Architecture diagram of the GitHub repository mizcausevic-dev/cyberark-access-review-sync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mizcausevic-dev/cyberark-access-review-sync
- Repository: https://github.com/mizcausevic-dev/cyberark-access-review-sync

## Overview

Purpose and principal workflow: An HTTP client—typically an operator or downstream API consumer—requests a review view or API result. The FastAPI application reads a locally seeded CyberArk-style account inventory, evaluates risk and review readiness, and returns rendered HTML or structured JSON for prioritized queues, findings, and approval-ready evidence. Despite the product’s “sync” framing, the sampled code demonstrates local-data evaluation and presentation, not a live CyberArk extraction or downstream queue write.

Components

**HTTP application**
- **FastAPI application** — `app/main.py`: Defines the web entry point, HTML and JSON routes, and their calls into the review service.
- **Uvicorn host** — null repository path (external runtime): The module’s executable entry point starts Uvicorn to serve the FastAPI application.

**Review data and decisioning**
- **Seed account inventory** — `app/data/sample_review_data.json`: Supplies the account records loaded by the service; this is local sample state, not evidence of a live vault connection.
- **Review decision and payload service** — `app/services/review_sync_service.py`: Loads that inventory and computes risk, verdicts, review readiness, account catalogs, queues, findings, summaries, and approval payloads. Risk scoring and per-account evaluation are internal steps in this main workflow.

**Operator and consumer surfaces**
- **HTML review surfaces** — `app/render.py`: Builds the overview, queue, findings, audit, settings, methodology, and API-summary pages from service data.
- **JSON API surfaces** — `app/main.py`: Exposes summary, account listing/detail, review queue, findings, and sample-payload endpoints. This shares the application module with the route entry point, rather than representing a separate backend.

**External actors**
- **HTTP client** — null repository path (external caller): Initiates the workflow by requesting a page or API endpoint.
- **CyberArk vault** — null repository path (external system described by the product): The README describes CyberArk as the metadata source, but the sampled implementation reads the local JSON inventory and shows no vault API call.
- **Downstream governance or review systems** — null repository path (external systems described by the product): The README describes approval-ready handoffs and target systems, but the sampled implementation does not establish an outbound integration.

Relationships
- **HTTP client -> Uvicorn host**: Sends an HTTP request to the locally served application; the module’s run block configures Uvicorn.
- **Uvicorn host -> FastAPI application**: Serves the application specified by the Uvicorn run call.
- **FastAPI application -> Review decision and payload service**: Calls service methods for API results; route handlers call page renderers for HTML responses.
- **FastAPI application -> HTML review surfaces**: Invokes the relevant renderer for each HTML route.
- **HTML review surfaces -> Review decision and payload service**: Calls service methods to assemble page data; the renderer constructs a service instance at import time.
- **Review decision and payload service -> Seed account inventory**: Opens and parses the JSON file during service construction.
- **FastAPI application -> HTTP client**: Returns rendered HTML or JSON results, and returns 404 for an unknown account detail request.
- **Review decision and payload service -> Downstream governance or review systems**: No runtime call is established; the service constructs approval-ready payload data, but sampled code does not transmit it.
- **CyberArk vault -> Review decision and payload service**: No runtime extraction relationship is established; the described vault source is not called in the sampled implementation.

Coverage limits: The service and renderer excerpts are partial, so details of some returned fields and page construction are not visible. The README documents broader sync and audit-evidence behavior, but the sampled implementation does not establish scheduled execution, live CyberArk access, persistent state beyond the seed file, audit-event replay, or outbound integrations.

Main entry points: [`app/main.py`](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/main.py) (FastAPI Application), [`app/services/review_sync_service.py`](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/services/review_sync_service.py) (Review Service), [`app/render.py`](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/render.py) (HTML Review Surfaces), [`app/data/sample_review_data.json`](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/data/sample_review_data.json) (Seed Account Inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP Application"]
  node_uvicorn["Uvicorn Host<br/>runtime server"]
  node_app["FastAPI Application<br/>web application"]
end

subgraph group_review["Review Decisioning"]
  node_service["Review Service<br/>decision and payload service"]
  node_inventory["Seed Account Inventory<br/>local JSON data"]
end

subgraph group_surfaces["Operator Surfaces"]
  node_renderer["HTML Review Surfaces<br/>page renderer"]
end

node_client["HTTP Client<br/>external caller"]

node_client -->|"HTTP request"| node_uvicorn
node_uvicorn -->|"serves"| node_app
node_app -->|"gets API data"| node_service
node_app -->|"renders pages"| node_renderer
node_renderer -->|"assembles page data"| node_service
node_service -->|"loads inventory"| node_inventory
node_app -->|"HTML or JSON response"| node_client

click node_app "https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/main.py"
click node_service "https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/services/review_sync_service.py"
click node_inventory "https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/data/sample_review_data.json"
click node_renderer "https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/render.py"

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_uvicorn,node_app,node_client toneBlue
class node_service,node_inventory toneAmber
class node_renderer toneMint
```

## Components

### HTTP Application

- **Uvicorn Host**: runtime server
- [FastAPI Application](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/main.py): web application · `app/main.py`

### Review Decisioning

- [Review Service](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/services/review_sync_service.py): decision and payload service · `app/services/review_sync_service.py`
- [Seed Account Inventory](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/data/sample_review_data.json): local JSON data · `app/data/sample_review_data.json`

### Operator Surfaces

- [HTML Review Surfaces](https://github.com/mizcausevic-dev/cyberark-access-review-sync/blob/main/app/render.py): page renderer · `app/render.py`

### Other components

- **HTTP Client**: external caller

## Connections

- HTTP Client → Uvicorn Host: HTTP request
- Uvicorn Host → FastAPI Application: serves
- FastAPI Application → Review Service: gets API data
- FastAPI Application → HTML Review Surfaces: renders pages
- HTML Review Surfaces → Review Service: assembles page data
- Review Service → Seed Account Inventory: loads inventory
- FastAPI Application → HTTP Client: HTML or JSON response
