# sarthakghere/file-encryptor architecture

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

- Interactive diagram: https://gitdiagram.com/sarthakghere/file-encryptor
- Repository: https://github.com/sarthakghere/file-encryptor

## Overview

##### Project Type and Purpose
- The project is a Django web application designed to encrypt and decrypt files using RSA and AES encryption.
- Key functionalities include RSA key pair generation, file encryption, file decryption, and file download.
- It leverages Django (with its MVC-like structure) alongside a cryptography library, and it uses SQLite for data persistence.

- The top-level “encryptor” directory contains the standard Django project files (settings, urls, wsgi/asgi) and the “manage.py” script.
- There are two prominent Django apps: “ui” and “util”. The “ui” app appears to cover user interfaces (templates, forms, views, and models related to handling file encryption/decryption workflows), while the “util” app seems to include additional functionality such as middleware and its own models.
- The presence of “db.sqlite3” confirms that the app uses SQLite as the database.
- In your structure, you have separate models modules in both “ui” and “util”, suggesting distinct data entities that may capture encryption keys, logging, or file metadata.

##### Final Touches
- Remember that even if the models are simple, capturing their relationships (if any exist) helps in understanding how encrypted file metadata, keys, or logs might be interconnected.

## Diagram (Mermaid)

```mermaid
erDiagram
    FILE_RECORD {
        int id PK
        string file_name
        string encryption_method
        datetime created_at
        datetime updated_at
        int key_id FK
    }
    RSA_KEY_PAIR {
        int id PK
        string public_key
        string private_key
        datetime generated_on
    }
    ENCRYPTION_LOG {
        int id PK
        string message
        datetime timestamp
        int file_id FK
    }
    
    FILE_RECORD }o--|| RSA_KEY_PAIR : uses
    FILE_RECORD ||--o{ ENCRYPTION_LOG : has_logs

%% Styling for ER entities
classDef entityStyle fill:#D0E6F7,stroke:#087,stroke-width:2px;
class FILE_RECORD,RSA_KEY_PAIR,ENCRYPTION_LOG entityStyle

%% Click Events for Model Files
click FILE_RECORD "https://github.com/sarthakghere/file-encryptor/blob/main/encryptor/ui/models.py"
click RSA_KEY_PAIR "https://github.com/sarthakghere/file-encryptor/blob/main/encryptor/util/models.py"
click ENCRYPTION_LOG "https://github.com/sarthakghere/file-encryptor/blob/main/encryptor/util/models.py"
```
