# nathsanfer/datavision_insights architecture

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

- Interactive diagram: https://gitdiagram.com/nathsanfer/datavision_insights
- Repository: https://github.com/nathsanfer/datavision_insights

## Overview

CTI Insights is a web application for turning commercial Excel spreadsheets into standardized customer records, database-backed analysis, dashboards, and strategic insights. The main workflow runs from user upload through server-side validation and Python ETL to stored results; users then view dashboards and insights. The frontend also supports login, registration, profile management, and upload history, while administrators manage accounts. Edges follow the README and shown source references/calls; some controller and integration wiring is unsampled, so uncertain links are marked dashed.

Main entry points: [`frontend-vue/src/services/api.js`](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/services/api.js) (HTTP client), [`analytics-python/main.py`](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/main.py) (Batch processing), [`frontend-vue/src/views/Dashboard.vue`](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Dashboard.vue) (Dashboard), [`backend-java/src/main/java/com/cti/backend_java/services/AuthService.java`](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/AuthService.java) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_upload_view["Spreadsheet upload<br/>[Upload.vue]"]
  node_dashboard["Dashboard<br/>[Dashboard.vue]"]
  node_insights_view["Insights view<br/>[Insights.vue]"]
  node_history_view["Batch history<br/>[Historico.vue]"]
  node_auth_views["Login and register<br/>[Login.vue]"]
  node_profile_view["Profile<br/>[Profile.vue]"]
  node_upload_store["Upload state<br/>[uploadStore.js]"]
  node_auth_store["Session state<br/>[auth.js]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_backend["API and accounts"]
  node_rest_api["REST API"]
  node_auth_controller["Authentication routes"]
  node_admin_controller["Admin user routes"]
  node_auth_service["Authentication service<br/>[AuthService.java]"]
  node_jwt_service["JWT service<br/>[JwtService.java]"]
  node_user_repository[("User repository")]
  node_insights_controller["Insights routes"]
  node_lot_controller["Batch history routes"]
end

subgraph group_ingestion["Upload processing"]
  node_upload_service["Upload orchestration<br/>[UploadService.java]"]
  node_row_validation["Row validation"]
  node_python_etl_bridge["Python ETL bridge"]
end

subgraph group_analytics["Analysis and storage"]
  node_python_api["Python processing API<br/>[api.py]"]
  node_batch_processor["Batch processing<br/>[main.py]"]
  node_data_cleaning["Data cleaning<br/>[limpeza.py]"]
  node_analysis["Statistical analysis<br/>[analise.py]"]
  node_insight_generation["Insight generation<br/>[insights.py]"]
  node_database_writer[("Batch data storage<br/>[banco.py]")]
end

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

node_user -->|"uploads spreadsheet"| node_upload_view
node_user -->|"uses account access"| node_auth_views
node_user -->|"views results"| node_dashboard
node_upload_view -.->|"manages upload"| node_upload_store
node_dashboard -->|"uses upload state"| node_upload_store
node_upload_store -->|"requests data"| node_api_client
node_dashboard -->|"requests data"| node_api_client
node_insights_view -.->|"requests insights"| node_api_client
node_history_view -.->|"requests history"| node_api_client
node_profile_view -->|"requests profile"| node_api_client
node_auth_views -.->|"updates session"| node_auth_store
node_auth_store -->|"sends login"| node_api_client
node_api_client -->|"calls REST API"| node_rest_api
node_rest_api -.->|"delegates upload"| node_upload_service
node_auth_controller -->|"delegates authentication"| node_auth_service
node_auth_controller -->|"reads current user"| node_user_repository
node_auth_service -->|"reads and saves users"| node_user_repository
node_admin_controller -->|"manages users"| node_user_repository
node_auth_service -->|"issues tokens"| node_jwt_service
node_upload_service -->|"validates rows"| node_row_validation
node_upload_service -->|"sends valid rows"| node_python_etl_bridge
node_python_etl_bridge -.->|"forwards batch"| node_python_api
node_python_api -.->|"invokes processing"| node_batch_processor
node_batch_processor -->|"cleans rows"| node_data_cleaning
node_batch_processor -->|"calculates metrics"| node_analysis
node_analysis -->|"uses cleaned data"| node_data_cleaning
node_analysis -->|"generates insights"| node_insight_generation
node_batch_processor -->|"stores batch results"| node_database_writer
node_database_writer -->|"writes records"| node_postgres
node_insights_controller -.->|"serves insight data"| node_api_client
node_lot_controller -.->|"serves batch history"| node_api_client
node_insights_view -.->|"loads insights"| node_insights_controller
node_history_view -.->|"loads batches"| node_lot_controller

click node_upload_view "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Upload.vue"
click node_dashboard "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Dashboard.vue"
click node_insights_view "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Insights.vue"
click node_history_view "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Historico.vue"
click node_auth_views "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Login.vue"
click node_profile_view "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Profile.vue"
click node_upload_store "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/stores/uploadStore.js"
click node_auth_store "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/stores/auth.js"
click node_api_client "https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/services/api.js"
click node_rest_api "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/UploadController.java"
click node_auth_controller "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/AuthController.java"
click node_admin_controller "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/AdminUsuarioController.java"
click node_auth_service "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/AuthService.java"
click node_jwt_service "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/security/JwtService.java"
click node_user_repository "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/repository/UsuarioRepository.java"
click node_upload_service "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/UploadService.java"
click node_row_validation "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/ClienteValidacaoService.java"
click node_python_etl_bridge "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/PythonEtlService.java"
click node_python_api "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/api.py"
click node_batch_processor "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/main.py"
click node_data_cleaning "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/limpeza.py"
click node_analysis "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/analise.py"
click node_insight_generation "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/insights.py"
click node_database_writer "https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/banco.py"
click node_insights_controller "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/InsightsController.java"
click node_lot_controller "https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/LotesController.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_view,node_dashboard,node_insights_view,node_history_view,node_auth_views,node_profile_view,node_upload_store,node_auth_store,node_api_client,node_user toneBlue
class node_rest_api,node_auth_controller,node_admin_controller,node_auth_service,node_jwt_service,node_user_repository,node_insights_controller,node_lot_controller,node_postgres toneAmber
class node_upload_service,node_row_validation,node_python_etl_bridge toneMint
class node_python_api,node_batch_processor,node_data_cleaning,node_analysis,node_insight_generation,node_database_writer toneRose
```

## Components

### Web interface

- [Spreadsheet upload](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Upload.vue): `frontend-vue/src/views/Upload.vue`
- [Dashboard](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Dashboard.vue): `frontend-vue/src/views/Dashboard.vue`
- [Insights view](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Insights.vue): `frontend-vue/src/views/Insights.vue`
- [Batch history](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Historico.vue): `frontend-vue/src/views/Historico.vue`
- [Login and register](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Login.vue): `frontend-vue/src/views/Login.vue`
- [Profile](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/views/Profile.vue): `frontend-vue/src/views/Profile.vue`
- [Upload state](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/stores/uploadStore.js): `frontend-vue/src/stores/uploadStore.js`
- [Session state](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/stores/auth.js): `frontend-vue/src/stores/auth.js`
- [HTTP client](https://github.com/nathsanfer/datavision_insights/blob/main/frontend-vue/src/services/api.js): `frontend-vue/src/services/api.js`

### API and accounts

- [REST API](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/UploadController.java): `backend-java/src/main/java/com/cti/backend_java/controllers/UploadController.java`
- [Authentication routes](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/AuthController.java): `backend-java/src/main/java/com/cti/backend_java/controllers/AuthController.java`
- [Admin user routes](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/AdminUsuarioController.java): `backend-java/src/main/java/com/cti/backend_java/controllers/AdminUsuarioController.java`
- [Authentication service](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/AuthService.java): `backend-java/src/main/java/com/cti/backend_java/services/AuthService.java`
- [JWT service](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/security/JwtService.java): `backend-java/src/main/java/com/cti/backend_java/security/JwtService.java`
- [User repository](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/repository/UsuarioRepository.java): `backend-java/src/main/java/com/cti/backend_java/repository/UsuarioRepository.java`
- [Insights routes](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/InsightsController.java): `backend-java/src/main/java/com/cti/backend_java/controllers/InsightsController.java`
- [Batch history routes](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/controllers/LotesController.java): `backend-java/src/main/java/com/cti/backend_java/controllers/LotesController.java`

### Upload processing

- [Upload orchestration](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/UploadService.java): `backend-java/src/main/java/com/cti/backend_java/services/UploadService.java`
- [Row validation](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/ClienteValidacaoService.java): `backend-java/src/main/java/com/cti/backend_java/services/ClienteValidacaoService.java`
- [Python ETL bridge](https://github.com/nathsanfer/datavision_insights/blob/main/backend-java/src/main/java/com/cti/backend_java/services/PythonEtlService.java): `backend-java/src/main/java/com/cti/backend_java/services/PythonEtlService.java`

### Analysis and storage

- [Python processing API](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/api.py): `analytics-python/api.py`
- [Batch processing](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/main.py): `analytics-python/main.py`
- [Data cleaning](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/limpeza.py): `analytics-python/limpeza.py`
- [Statistical analysis](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/analise.py): `analytics-python/analise.py`
- [Insight generation](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/insights.py): `analytics-python/insights.py`
- [Batch data storage](https://github.com/nathsanfer/datavision_insights/blob/main/analytics-python/banco.py): `analytics-python/banco.py`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → Spreadsheet upload: uploads spreadsheet
- User → Login and register: uses account access
- User → Dashboard: views results
- Spreadsheet upload → Upload state: manages upload
- Dashboard → Upload state: uses upload state (evidence: `frontend-vue/src/views/Dashboard.vue`)
- Upload state → HTTP client: requests data (evidence: `frontend-vue/src/stores/uploadStore.js`)
- Dashboard → HTTP client: requests data (evidence: `frontend-vue/src/views/Dashboard.vue`)
- Insights view → HTTP client: requests insights
- Batch history → HTTP client: requests history
- Profile → HTTP client: requests profile (evidence: `frontend-vue/src/views/Profile.vue`)
- Login and register → Session state: updates session
- Session state → HTTP client: sends login (evidence: `frontend-vue/src/stores/auth.js`)
- HTTP client → REST API: calls REST API
- REST API → Upload orchestration: delegates upload
- Authentication routes → Authentication service: delegates authentication (evidence: `backend-java/src/main/java/com/cti/backend_java/controllers/AuthController.java`)
- Authentication routes → User repository: reads current user (evidence: `backend-java/src/main/java/com/cti/backend_java/controllers/AuthController.java`)
- Authentication service → User repository: reads and saves users (evidence: `backend-java/src/main/java/com/cti/backend_java/services/AuthService.java`)
- Admin user routes → User repository: manages users (evidence: `backend-java/src/main/java/com/cti/backend_java/controllers/AdminUsuarioController.java`)
- Authentication service → JWT service: issues tokens (evidence: `backend-java/src/main/java/com/cti/backend_java/services/AuthService.java`)
- Upload orchestration → Row validation: validates rows (evidence: `backend-java/src/main/java/com/cti/backend_java/services/UploadService.java`)
- Upload orchestration → Python ETL bridge: sends valid rows (evidence: `backend-java/src/main/java/com/cti/backend_java/services/UploadService.java`)
- Python ETL bridge → Python processing API: forwards batch
- Python processing API → Batch processing: invokes processing (evidence: `analytics-python/main.py`)
- Batch processing → Data cleaning: cleans rows (evidence: `analytics-python/main.py`)
- Batch processing → Statistical analysis: calculates metrics (evidence: `analytics-python/main.py`)
- Statistical analysis → Data cleaning: uses cleaned data (evidence: `analytics-python/analise.py`)
- Statistical analysis → Insight generation: generates insights (evidence: `analytics-python/analise.py`)
- Batch processing → Batch data storage: stores batch results (evidence: `analytics-python/main.py`)
- Batch data storage → PostgreSQL: writes records
- Insights routes → HTTP client: serves insight data
- Batch history routes → HTTP client: serves batch history
- Insights view → Insights routes: loads insights
- Batch history → Batch history routes: loads batches
