# codepaiva/projeto-sisupa architecture

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

- Interactive diagram: https://gitdiagram.com/codepaiva/projeto-sisupa
- Repository: https://github.com/codepaiva/projeto-sisupa

## Overview

SisUpa is a Tkinter desktop application for storing uploaded files and browsing previews. The main workflow is file selection, upload and compression, SQLite persistence, dynamic listing, then selection or navigation to preview an extracted image or PDF. The graph also includes the documented upload, listing, preview, and image-navigation capabilities, plus format strategies. Edges reflect visible calls and wiring; the README documents user-facing capabilities, while PPTX/XLSX strategy implementations are present but their runtime dispatch is not shown in the sampled processor.

Main entry points: [`app/main.py`](https://github.com/codepaiva/projeto-sisupa/blob/main/app/main.py) (Application entry), [`app/views/form_view.py`](https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/form_view.py) (Upload form), [`app/services/file_processor_service.py`](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/file_processor_service.py) (Preview processor), [`app/views/render_preview_view.py`](https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/render_preview_view.py) (File list and preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Application entry<br/>[main.py]"]
  node_form["Upload form<br/>[form_view.py]"]
  node_preview_view["File list and preview"]
end

subgraph group_workflow["File workflow"]
  node_search["File selection"]
  node_upload["Upload service<br/>[upload_service.py]"]
  node_compress["File compression"]
end

subgraph group_preview["Preview processing"]
  node_processor["Preview processor"]
  node_decompress["File decompression"]
  node_strategy_interface["File strategy interface"]
  node_image_strategy["Image strategy<br/>[image_strategy.py]"]
  node_pdf_strategy["PDF strategy<br/>[pdf_strategy.py]"]
  node_pptx_strategy["PPTX strategy<br/>[pptx_strategy.py]"]
  node_xlsx_strategy["XLSX strategy<br/>[xlsx_strategy.py]"]
end

subgraph group_storage["Persistence"]
  node_repository[("SQLite repository<br/>[repository.py]")]
end

node_user(("User"))

node_user -->|"uses"| node_form
node_app -->|"initializes"| node_form
node_app -->|"initializes"| node_preview_view
node_app -->|"provides"| node_search
node_app -->|"provides"| node_upload
node_app -->|"provides"| node_processor
node_form -->|"requests file"| node_search
node_form -->|"uploads file"| node_upload
node_form -->|"triggers list refresh"| node_preview_view
node_upload -->|"compresses file"| node_compress
node_upload -->|"inserts record"| node_repository
node_preview_view -->|"reads records"| node_repository
node_preview_view -->|"requests preview"| node_processor
node_processor -->|"decompresses file"| node_decompress
node_processor -->|"dispatches images"| node_image_strategy
node_processor -->|"dispatches PDFs"| node_pdf_strategy
node_image_strategy -->|"implements"| node_strategy_interface
node_pdf_strategy -->|"implements"| node_strategy_interface
node_pptx_strategy -->|"implements"| node_strategy_interface
node_xlsx_strategy -->|"implements"| node_strategy_interface

click node_app "https://github.com/codepaiva/projeto-sisupa/blob/main/app/main.py"
click node_form "https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/form_view.py"
click node_preview_view "https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/render_preview_view.py"
click node_search "https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/search_file_service.py"
click node_upload "https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/upload_service.py"
click node_compress "https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/compressed_service.py"
click node_processor "https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/file_processor_service.py"
click node_decompress "https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/decompressed_service.py"
click node_strategy_interface "https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/file_interface_strategy.py"
click node_image_strategy "https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/image_strategy.py"
click node_pdf_strategy "https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/pdf_strategy.py"
click node_pptx_strategy "https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/pptx_strategy.py"
click node_xlsx_strategy "https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/xlsx_strategy.py"
click node_repository "https://github.com/codepaiva/projeto-sisupa/blob/main/app/repositories/repository.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_app,node_form,node_preview_view,node_user toneBlue
class node_search,node_upload,node_compress toneAmber
class node_processor,node_decompress,node_strategy_interface,node_image_strategy,node_pdf_strategy,node_pptx_strategy,node_xlsx_strategy toneMint
class node_repository toneRose
```

## Components

### Desktop interface

- [Application entry](https://github.com/codepaiva/projeto-sisupa/blob/main/app/main.py): `app/main.py`
- [Upload form](https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/form_view.py): `app/views/form_view.py`
- [File list and preview](https://github.com/codepaiva/projeto-sisupa/blob/main/app/views/render_preview_view.py): `app/views/render_preview_view.py`

### File workflow

- [File selection](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/search_file_service.py): `app/services/search_file_service.py`
- [Upload service](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/upload_service.py): `app/services/upload_service.py`
- [File compression](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/compressed_service.py): `app/services/compressed_service.py`

### Preview processing

- [Preview processor](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/file_processor_service.py): `app/services/file_processor_service.py`
- [File decompression](https://github.com/codepaiva/projeto-sisupa/blob/main/app/services/decompressed_service.py): `app/services/decompressed_service.py`
- [File strategy interface](https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/file_interface_strategy.py): `app/Strategy/file_interface_strategy.py`
- [Image strategy](https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/image_strategy.py): `app/Strategy/image_strategy.py`
- [PDF strategy](https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/pdf_strategy.py): `app/Strategy/pdf_strategy.py`
- [PPTX strategy](https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/pptx_strategy.py): `app/Strategy/pptx_strategy.py`
- [XLSX strategy](https://github.com/codepaiva/projeto-sisupa/blob/main/app/Strategy/xlsx_strategy.py): `app/Strategy/xlsx_strategy.py`

### Persistence

- [SQLite repository](https://github.com/codepaiva/projeto-sisupa/blob/main/app/repositories/repository.py): `app/repositories/repository.py`

### Other components

- **User**

## Connections

- User → Upload form: uses (evidence: `README.md`)
- Application entry → Upload form: initializes (evidence: `app/main.py`)
- Application entry → File list and preview: initializes (evidence: `app/main.py`)
- Application entry → File selection: provides (evidence: `app/main.py`)
- Application entry → Upload service: provides (evidence: `app/main.py`)
- Application entry → Preview processor: provides (evidence: `app/main.py`)
- Upload form → File selection: requests file (evidence: `app/views/form_view.py`)
- Upload form → Upload service: uploads file (evidence: `app/views/form_view.py`)
- Upload form → File list and preview: triggers list refresh (evidence: `app/main.py`)
- Upload service → File compression: compresses file (evidence: `app/services/upload_service.py`)
- Upload service → SQLite repository: inserts record (evidence: `app/services/upload_service.py`)
- File list and preview → SQLite repository: reads records (evidence: `app/views/render_preview_view.py`)
- File list and preview → Preview processor: requests preview (evidence: `app/views/render_preview_view.py`)
- Preview processor → File decompression: decompresses file (evidence: `app/services/file_processor_service.py`)
- Preview processor → Image strategy: dispatches images (evidence: `app/services/file_processor_service.py`)
- Preview processor → PDF strategy: dispatches PDFs (evidence: `app/services/file_processor_service.py`)
- Image strategy → File strategy interface: implements (evidence: `app/Strategy/image_strategy.py`)
- PDF strategy → File strategy interface: implements (evidence: `app/Strategy/pdf_strategy.py`)
- PPTX strategy → File strategy interface: implements (evidence: `app/Strategy/pptx_strategy.py`)
- XLSX strategy → File strategy interface: implements (evidence: `app/Strategy/xlsx_strategy.py`)
