# rogeriobertolino/cti_insights architecture

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

- Interactive diagram: https://gitdiagram.com/rogeriobertolino/cti_insights
- Repository: https://github.com/rogeriobertolino/cti_insights

## Overview

CTI Insights imports XLSX workbooks, analyzes and persists the resulting metrics and records, then presents dashboards and reports. The documented workflow and sampled calls support the main upload-to-analysis path; source excerpts do not show all API routing or database configuration, so those links are limited to explicit documentation or direct calls.

Main entry points: [`src/router/index.js`](https://github.com/rogeriobertolino/cti_insights/blob/main/src/router/index.js) (Application routes), [`backend/src/main/java/br/com/cti/insights/imports/ImportService.java`](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportService.java) (Import coordinator), [`src/dataStore.js`](https://github.com/rogeriobertolino/cti_insights/blob/main/src/dataStore.js) (API data store), [`src/layouts/AppLayout.vue`](https://github.com/rogeriobertolino/cti_insights/blob/main/src/layouts/AppLayout.vue) (Workspace shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vue interface"]
  node_upload["Workbook upload<br/>[UploadView.vue]"]
  node_frontend_data["API data store<br/>[dataStore.js]"]
  node_app_routing["Application routes<br/>[index.js]"]
  node_layout["Workspace shell<br/>[AppLayout.vue]"]
  node_header["Header<br/>[Header.vue]"]
  node_sidebar["Navigation sidebar<br/>[Sidebar.vue]"]
  node_home["Home page<br/>[HomeView.vue]"]
  node_login["Login page<br/>[LoginView.vue]"]
  node_dashboard["Charts dashboard<br/>[GraficosView.vue]"]
  node_reports["Reports<br/>[RelatoriosView.vue]"]
end

subgraph group_backend["Import API"]
  node_api["Imports API"]
  node_import_service["Import coordinator<br/>[ImportService.java]"]
  node_python_bridge["Python bridge"]
end

subgraph group_analysis["Analysis engine"]
  node_analysis_script["Workbook analysis<br/>[analyze.py]"]
end

subgraph group_storage["Persistent data"]
  node_batch[("Import batches<br/>[ImportBatch.java]")]
  node_batch_repo["Batch repository"]
  node_record[("Imported records")]
  node_record_repo["Record repository"]
end

node_user(("Analyst"))
node_postgres[("PostgreSQL")]

node_user -->|"selects workbook"| node_upload
node_upload -->|"uploads XLSX"| node_frontend_data
node_frontend_data -->|"POST imports"| node_api
node_api -->|"delegates processing"| node_import_service
node_import_service -->|"saves batch"| node_batch_repo
node_import_service -->|"invokes analysis"| node_python_bridge
node_python_bridge -->|"runs script"| node_analysis_script
node_import_service -->|"saves records"| node_record_repo
node_import_service -->|"updates status"| node_batch_repo
node_batch_repo -->|"persists batches"| node_batch
node_record_repo -->|"persists records"| node_record
node_batch -->|"stored in"| node_postgres
node_record -->|"stored in"| node_postgres
node_frontend_data -->|"GET latest"| node_api
node_dashboard -->|"loads latest"| node_frontend_data
node_reports -->|"reads analysis"| node_frontend_data
node_app_routing -->|"routes to"| node_home
node_app_routing -->|"routes to"| node_login
node_app_routing -->|"routes to"| node_layout
node_app_routing -->|"routes to"| node_upload
node_app_routing -->|"routes to"| node_reports
node_app_routing -->|"routes to"| node_dashboard
node_layout -->|"renders"| node_header
node_layout -->|"renders"| node_sidebar

click node_upload "https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/UploadView.vue"
click node_frontend_data "https://github.com/rogeriobertolino/cti_insights/blob/main/src/dataStore.js"
click node_app_routing "https://github.com/rogeriobertolino/cti_insights/blob/main/src/router/index.js"
click node_layout "https://github.com/rogeriobertolino/cti_insights/blob/main/src/layouts/AppLayout.vue"
click node_header "https://github.com/rogeriobertolino/cti_insights/blob/main/src/components/Header.vue"
click node_sidebar "https://github.com/rogeriobertolino/cti_insights/blob/main/src/components/Sidebar.vue"
click node_home "https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/HomeView.vue"
click node_login "https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/LoginView.vue"
click node_dashboard "https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/GraficosView.vue"
click node_reports "https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/RelatoriosView.vue"
click node_api "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportController.java"
click node_import_service "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportService.java"
click node_python_bridge "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/PythonAnalysisService.java"
click node_analysis_script "https://github.com/rogeriobertolino/cti_insights/blob/main/python/analyze.py"
click node_batch "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportBatch.java"
click node_batch_repo "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportBatchRepository.java"
click node_record "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportedRecord.java"
click node_record_repo "https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportedRecordRepository.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_upload,node_frontend_data,node_app_routing,node_layout,node_header,node_sidebar,node_home,node_login,node_dashboard,node_reports toneBlue
class node_api,node_import_service,node_python_bridge,node_postgres toneAmber
class node_analysis_script toneMint
class node_batch,node_batch_repo,node_record,node_record_repo toneRose
class node_user toneIndigo
```

## Components

### Vue interface

- [Workbook upload](https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/UploadView.vue): `src/views/UploadView.vue`
- [API data store](https://github.com/rogeriobertolino/cti_insights/blob/main/src/dataStore.js): `src/dataStore.js`
- [Application routes](https://github.com/rogeriobertolino/cti_insights/blob/main/src/router/index.js): `src/router/index.js`
- [Workspace shell](https://github.com/rogeriobertolino/cti_insights/blob/main/src/layouts/AppLayout.vue): `src/layouts/AppLayout.vue`
- [Header](https://github.com/rogeriobertolino/cti_insights/blob/main/src/components/Header.vue): `src/components/Header.vue`
- [Navigation sidebar](https://github.com/rogeriobertolino/cti_insights/blob/main/src/components/Sidebar.vue): `src/components/Sidebar.vue`
- [Home page](https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/HomeView.vue): `src/views/HomeView.vue`
- [Login page](https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/LoginView.vue): `src/views/LoginView.vue`
- [Charts dashboard](https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/GraficosView.vue): `src/views/GraficosView.vue`
- [Reports](https://github.com/rogeriobertolino/cti_insights/blob/main/src/views/RelatoriosView.vue): `src/views/RelatoriosView.vue`

### Import API

- [Imports API](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportController.java): `backend/src/main/java/br/com/cti/insights/imports/ImportController.java`
- [Import coordinator](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportService.java): `backend/src/main/java/br/com/cti/insights/imports/ImportService.java`
- [Python bridge](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/PythonAnalysisService.java): `backend/src/main/java/br/com/cti/insights/imports/PythonAnalysisService.java`

### Analysis engine

- [Workbook analysis](https://github.com/rogeriobertolino/cti_insights/blob/main/python/analyze.py): `python/analyze.py`

### Persistent data

- [Import batches](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportBatch.java): `backend/src/main/java/br/com/cti/insights/imports/ImportBatch.java`
- [Batch repository](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportBatchRepository.java): `backend/src/main/java/br/com/cti/insights/imports/ImportBatchRepository.java`
- [Imported records](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportedRecord.java): `backend/src/main/java/br/com/cti/insights/imports/ImportedRecord.java`
- [Record repository](https://github.com/rogeriobertolino/cti_insights/blob/main/backend/src/main/java/br/com/cti/insights/imports/ImportedRecordRepository.java): `backend/src/main/java/br/com/cti/insights/imports/ImportedRecordRepository.java`

### Other components

- **Analyst**
- **PostgreSQL**

## Connections

- Analyst → Workbook upload: selects workbook (evidence: `src/views/UploadView.vue`)
- Workbook upload → API data store: uploads XLSX (evidence: `src/views/UploadView.vue`)
- API data store → Imports API: POST imports (evidence: `README.md`)
- Imports API → Import coordinator: delegates processing (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportController.java`)
- Import coordinator → Batch repository: saves batch (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportService.java`)
- Import coordinator → Python bridge: invokes analysis (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportService.java`)
- Python bridge → Workbook analysis: runs script (evidence: `README.md`)
- Import coordinator → Record repository: saves records (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportService.java`)
- Import coordinator → Batch repository: updates status (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportService.java`)
- Batch repository → Import batches: persists batches (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportBatchRepository.java`)
- Record repository → Imported records: persists records (evidence: `backend/src/main/java/br/com/cti/insights/imports/ImportedRecordRepository.java`)
- Import batches → PostgreSQL: stored in (evidence: `README.md`)
- Imported records → PostgreSQL: stored in (evidence: `README.md`)
- API data store → Imports API: GET latest (evidence: `README.md`)
- Charts dashboard → API data store: loads latest (evidence: `src/views/GraficosView.vue`)
- Reports → API data store: reads analysis (evidence: `src/views/RelatoriosView.vue`)
- Application routes → Home page: routes to (evidence: `src/router/index.js`)
- Application routes → Login page: routes to (evidence: `src/router/index.js`)
- Application routes → Workspace shell: routes to (evidence: `src/router/index.js`)
- Application routes → Workbook upload: routes to (evidence: `src/router/index.js`)
- Application routes → Reports: routes to (evidence: `src/router/index.js`)
- Application routes → Charts dashboard: routes to (evidence: `src/router/index.js`)
- Workspace shell → Header: renders (evidence: `src/layouts/AppLayout.vue`)
- Workspace shell → Navigation sidebar: renders (evidence: `src/layouts/AppLayout.vue`)
