# raineyri/secure-file-manager architecture

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

- Interactive diagram: https://gitdiagram.com/raineyri/secure-file-manager
- Repository: https://github.com/raineyri/secure-file-manager

## Overview

Secure File Manager is a Python console application for authenticated, per-user file management backed by SQLite. The main workflow is: a user registers or signs in, then uses the console to manage files, structured JSON/XML data, or ZIP archives; file ownership and path checks constrain access, and operations are audited. The graph preserves the documented filesystem-information capability as well. Relationships reflect visible calls and documented behavior; unsampled implementation details are not inferred.

Main entry points: [`main.py`](https://github.com/raineyri/secure-file-manager/blob/main/main.py) (Interactive menus), [`app/file_service.py`](https://github.com/raineyri/secure-file-manager/blob/main/app/file_service.py) (File management), [`app/database.py`](https://github.com/raineyri/secure-file-manager/blob/main/app/database.py) (SQLite access), [`app/audit_service.py`](https://github.com/raineyri/secure-file-manager/blob/main/app/audit_service.py) (Audit log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Console interface"]
  node_console["Interactive menus<br/>[main.py]"]
end

subgraph group_access["Identity and access"]
  node_auth["Registration and login<br/>[auth.py]"]
end

subgraph group_files["File operations"]
  node_file_ops["File management<br/>[file_service.py]"]
  node_filesystem_info["Filesystem information<br/>[file_service.py]"]
  node_json["JSON handling<br/>[json_service.py]"]
  node_xml["XML handling<br/>[xml_service.py]"]
  node_archives["ZIP archives<br/>[archive_service.py]"]
end

subgraph group_persistence["Persistence and audit"]
  node_config["Storage configuration<br/>[config.py]"]
  node_database_api["SQLite access<br/>[database.py]"]
  node_sqlite[("Application database")]
  node_audit["Audit log<br/>[audit_service.py]"]
  node_storage[("Managed files")]
end

node_user(("Console user"))

node_user -->|"uses"| node_console
node_console -->|"registers or authenticates"| node_auth
node_console -->|"initializes"| node_database_api
node_console -->|"manages files"| node_file_ops
node_console -->|"requests drive details"| node_filesystem_info
node_console -->|"uses JSON menus"| node_json
node_console -->|"uses XML menus"| node_xml
node_console -->|"creates or extracts"| node_archives
node_console -->|"views operations"| node_audit
node_auth -->|"queries users"| node_database_api
node_file_ops -->|"checks ownership and records files"| node_database_api
node_file_ops -->|"logs operations"| node_audit
node_file_ops -->|"reads and writes files"| node_storage
node_filesystem_info -->|"measures usage"| node_storage
node_json -->|"reads and writes through"| node_file_ops
node_json -->|"logs parse errors"| node_audit
node_xml -->|"reads and writes through"| node_file_ops
node_xml -->|"logs parse errors"| node_audit
node_archives -->|"validates paths with"| node_file_ops
node_archives -->|"checks ownership and registers files"| node_database_api
node_archives -->|"logs archive actions"| node_audit
node_archives -->|"creates and extracts archives"| node_storage
node_database_api -->|"gets database path"| node_config
node_database_api -->|"reads and writes"| node_sqlite
node_config -->|"defines managed directory"| node_storage
node_audit -->|"stores and retrieves events"| node_database_api

click node_console "https://github.com/raineyri/secure-file-manager/blob/main/main.py"
click node_auth "https://github.com/raineyri/secure-file-manager/blob/main/app/auth.py"
click node_file_ops "https://github.com/raineyri/secure-file-manager/blob/main/app/file_service.py"
click node_filesystem_info "https://github.com/raineyri/secure-file-manager/blob/main/app/file_service.py"
click node_json "https://github.com/raineyri/secure-file-manager/blob/main/app/json_service.py"
click node_xml "https://github.com/raineyri/secure-file-manager/blob/main/app/xml_service.py"
click node_archives "https://github.com/raineyri/secure-file-manager/blob/main/app/archive_service.py"
click node_config "https://github.com/raineyri/secure-file-manager/blob/main/app/config.py"
click node_database_api "https://github.com/raineyri/secure-file-manager/blob/main/app/database.py"
click node_audit "https://github.com/raineyri/secure-file-manager/blob/main/app/audit_service.py"
click node_storage "https://github.com/raineyri/secure-file-manager/tree/main/storage"

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_console,node_user toneBlue
class node_auth toneAmber
class node_file_ops,node_filesystem_info,node_json,node_xml,node_archives toneMint
class node_config,node_database_api,node_sqlite,node_audit,node_storage toneRose
```

## Components

### Console interface

- [Interactive menus](https://github.com/raineyri/secure-file-manager/blob/main/main.py): `main.py`

### Identity and access

- [Registration and login](https://github.com/raineyri/secure-file-manager/blob/main/app/auth.py): `app/auth.py`

### File operations

- [File management](https://github.com/raineyri/secure-file-manager/blob/main/app/file_service.py): `app/file_service.py`
- [Filesystem information](https://github.com/raineyri/secure-file-manager/blob/main/app/file_service.py): `app/file_service.py`
- [JSON handling](https://github.com/raineyri/secure-file-manager/blob/main/app/json_service.py): `app/json_service.py`
- [XML handling](https://github.com/raineyri/secure-file-manager/blob/main/app/xml_service.py): `app/xml_service.py`
- [ZIP archives](https://github.com/raineyri/secure-file-manager/blob/main/app/archive_service.py): `app/archive_service.py`

### Persistence and audit

- [Storage configuration](https://github.com/raineyri/secure-file-manager/blob/main/app/config.py): `app/config.py`
- [SQLite access](https://github.com/raineyri/secure-file-manager/blob/main/app/database.py): `app/database.py`
- **Application database**
- [Audit log](https://github.com/raineyri/secure-file-manager/blob/main/app/audit_service.py): `app/audit_service.py`
- [Managed files](https://github.com/raineyri/secure-file-manager/tree/main/storage): `storage`

### Other components

- **Console user**

## Connections

- Console user → Interactive menus: uses (evidence: `README.md`)
- Interactive menus → Registration and login: registers or authenticates (evidence: `main.py`)
- Interactive menus → SQLite access: initializes (evidence: `main.py`)
- Interactive menus → File management: manages files (evidence: `main.py`)
- Interactive menus → Filesystem information: requests drive details (evidence: `main.py`)
- Interactive menus → JSON handling: uses JSON menus (evidence: `main.py`)
- Interactive menus → XML handling: uses XML menus (evidence: `main.py`)
- Interactive menus → ZIP archives: creates or extracts (evidence: `main.py`)
- Interactive menus → Audit log: views operations (evidence: `main.py`)
- Registration and login → SQLite access: queries users (evidence: `app/auth.py`)
- File management → SQLite access: checks ownership and records files (evidence: `app/file_service.py`)
- File management → Audit log: logs operations (evidence: `app/file_service.py`)
- File management → Managed files: reads and writes files (evidence: `app/file_service.py`)
- Filesystem information → Managed files: measures usage (evidence: `app/file_service.py`)
- JSON handling → File management: reads and writes through (evidence: `app/json_service.py`)
- JSON handling → Audit log: logs parse errors (evidence: `app/json_service.py`)
- XML handling → File management: reads and writes through (evidence: `app/xml_service.py`)
- XML handling → Audit log: logs parse errors (evidence: `app/xml_service.py`)
- ZIP archives → File management: validates paths with (evidence: `app/archive_service.py`)
- ZIP archives → SQLite access: checks ownership and registers files (evidence: `app/archive_service.py`)
- ZIP archives → Audit log: logs archive actions (evidence: `app/archive_service.py`)
- ZIP archives → Managed files: creates and extracts archives (evidence: `app/archive_service.py`)
- SQLite access → Storage configuration: gets database path (evidence: `app/database.py`)
- SQLite access → Application database: reads and writes (evidence: `app/database.py`)
- Storage configuration → Managed files: defines managed directory (evidence: `app/config.py`)
- Audit log → SQLite access: stores and retrieves events (evidence: `app/audit_service.py`)
