# atharvadchaudhari05/securecloud architecture

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

- Interactive diagram: https://gitdiagram.com/atharvadchaudhari05/securecloud
- Repository: https://github.com/atharvadchaudhari05/securecloud

## Overview

SecureCloud is a Flask secure-file application. Its main workflow registers and authenticates users with password, TOTP, risk scoring and conditional email OTP, then lets authenticated users encrypt, store, retrieve or shred files. Source excerpts show these routes and services; report generation/display and passkey data are present as capabilities or model support, but no passkey flow is evidenced. The README is empty, so the graph is based on the supplied tree and excerpts; unsampled subsystem links are omitted where calls cannot be verified.

Main entry points: [`securecloud/app/__init__.py`](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/__init__.py) (Flask app setup), [`securecloud/app/routes/auth.py`](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/auth.py) (Account and login routes), [`securecloud/app/routes/files.py`](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/files.py) (File and dashboard routes), [`securecloud/app/models.py`](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/models.py) (Account and event records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_factory["Flask app setup<br/>[__init__.py]"]
  node_config["App configuration<br/>[config.py]"]
  node_models[("Account and event records<br/>[models.py]")]
end

subgraph group_identity["Identity and risk"]
  node_auth_routes["Account and login routes<br/>[auth.py]"]
  node_auth_service["Password and TOTP<br/>[auth_service.py]"]
  node_risk_service["Login risk scoring<br/>[risk_service.py]"]
  node_mailer["Email OTP and alerts<br/>[mailer.py]"]
end

subgraph group_files["Secure file handling"]
  node_files_routes["File and dashboard routes<br/>[files.py]"]
  node_crypto["Encryption service<br/>[crypto_service.py]"]
  node_file_store[("Encrypted file blobs")]
end

subgraph group_insights["ML and reports"]
  node_risk_model["Risk model artifact<br/>[risk_model.joblib]"]
  node_crypto_model["Cipher policy artifact"]
  node_report_routes["Security reports<br/>[report.py]"]
  node_report_data["Metrics and benchmarks"]
end

node_user(("User"))
node_smtp["Gmail SMTP"]

node_user -.->|"uses app"| node_factory
node_factory -->|"loads config"| node_config
node_factory -->|"initializes ORM"| node_models
node_factory -->|"registers routes"| node_auth_routes
node_factory -->|"registers routes"| node_files_routes
node_factory -->|"registers routes"| node_report_routes
node_factory -->|"loads artifact"| node_risk_model
node_factory -->|"loads artifact"| node_crypto_model
node_auth_routes -->|"reads and writes"| node_models
node_auth_routes -->|"verifies credentials"| node_auth_service
node_auth_routes -->|"scores login"| node_risk_service
node_auth_routes -->|"requests OTP and alerts"| node_mailer
node_auth_routes -->|"redirects after MFA"| node_files_routes
node_auth_routes -->|"sends notices via"| node_smtp
node_mailer -->|"stores OTP"| node_models
node_risk_service -->|"queries login history"| node_models
node_risk_service -->|"predicts risk"| node_risk_model
node_files_routes -->|"reads and writes"| node_models
node_files_routes -->|"checks action TOTP"| node_auth_service
node_files_routes -->|"encrypts and decrypts"| node_crypto
node_files_routes -->|"writes and reads blobs"| node_file_store
node_crypto -->|"selects cipher"| node_crypto_model
node_files_routes -.->|"report navigation"| node_report_routes
node_report_routes -->|"reads metrics"| node_report_data

click node_factory "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/__init__.py"
click node_config "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/config.py"
click node_auth_routes "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/auth.py"
click node_auth_service "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/auth_service.py"
click node_risk_service "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/risk_service.py"
click node_mailer "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/mailer.py"
click node_files_routes "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/files.py"
click node_crypto "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/crypto_service.py"
click node_file_store "https://github.com/atharvadchaudhari05/securecloud/tree/main/securecloud/storage"
click node_models "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/models.py"
click node_risk_model "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/ml/models/risk_model.joblib"
click node_crypto_model "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/ml/models/crypto_policy.joblib"
click node_report_routes "https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/report.py"
click node_report_data "https://github.com/atharvadchaudhari05/securecloud/tree/main/securecloud/ml/reports"

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_factory,node_config,node_models,node_user toneBlue
class node_auth_routes,node_auth_service,node_risk_service,node_mailer toneAmber
class node_files_routes,node_crypto,node_file_store toneMint
class node_risk_model,node_crypto_model,node_report_routes,node_report_data toneRose
class node_smtp toneIndigo
```

## Components

### Web application

- [Flask app setup](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/__init__.py): `securecloud/app/__init__.py`
- [App configuration](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/config.py): `securecloud/app/config.py`
- [Account and event records](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/models.py): `securecloud/app/models.py`

### Identity and risk

- [Account and login routes](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/auth.py): `securecloud/app/routes/auth.py`
- [Password and TOTP](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/auth_service.py): `securecloud/app/services/auth_service.py`
- [Login risk scoring](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/risk_service.py): `securecloud/app/services/risk_service.py`
- [Email OTP and alerts](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/mailer.py): `securecloud/app/services/mailer.py`

### Secure file handling

- [File and dashboard routes](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/files.py): `securecloud/app/routes/files.py`
- [Encryption service](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/services/crypto_service.py): `securecloud/app/services/crypto_service.py`
- [Encrypted file blobs](https://github.com/atharvadchaudhari05/securecloud/tree/main/securecloud/storage): `securecloud/storage`

### ML and reports

- [Risk model artifact](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/ml/models/risk_model.joblib): `securecloud/ml/models/risk_model.joblib`
- [Cipher policy artifact](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/ml/models/crypto_policy.joblib): `securecloud/ml/models/crypto_policy.joblib`
- [Security reports](https://github.com/atharvadchaudhari05/securecloud/blob/main/securecloud/app/routes/report.py): `securecloud/app/routes/report.py`
- [Metrics and benchmarks](https://github.com/atharvadchaudhari05/securecloud/tree/main/securecloud/ml/reports): `securecloud/ml/reports`

### Other components

- **User**
- **Gmail SMTP**

## Connections

- User → Flask app setup: uses app
- Flask app setup → App configuration: loads config (evidence: `securecloud/app/__init__.py`)
- Flask app setup → Account and event records: initializes ORM (evidence: `securecloud/app/__init__.py`)
- Flask app setup → Account and login routes: registers routes (evidence: `securecloud/app/__init__.py`)
- Flask app setup → File and dashboard routes: registers routes (evidence: `securecloud/app/__init__.py`)
- Flask app setup → Security reports: registers routes (evidence: `securecloud/app/__init__.py`)
- Flask app setup → Risk model artifact: loads artifact (evidence: `securecloud/app/__init__.py`)
- Flask app setup → Cipher policy artifact: loads artifact (evidence: `securecloud/app/__init__.py`)
- Account and login routes → Account and event records: reads and writes (evidence: `securecloud/app/routes/auth.py`)
- Account and login routes → Password and TOTP: verifies credentials (evidence: `securecloud/app/routes/auth.py`)
- Account and login routes → Login risk scoring: scores login (evidence: `securecloud/app/routes/auth.py`)
- Account and login routes → Email OTP and alerts: requests OTP and alerts (evidence: `securecloud/app/routes/auth.py`)
- Account and login routes → File and dashboard routes: redirects after MFA (evidence: `securecloud/app/routes/auth.py`)
- Account and login routes → Gmail SMTP: sends notices via
- Email OTP and alerts → Account and event records: stores OTP (evidence: `securecloud/app/services/mailer.py`)
- Login risk scoring → Account and event records: queries login history (evidence: `securecloud/app/services/risk_service.py`)
- Login risk scoring → Risk model artifact: predicts risk (evidence: `securecloud/app/services/risk_service.py`)
- File and dashboard routes → Account and event records: reads and writes (evidence: `securecloud/app/routes/files.py`)
- File and dashboard routes → Password and TOTP: checks action TOTP (evidence: `securecloud/app/routes/files.py`)
- File and dashboard routes → Encryption service: encrypts and decrypts (evidence: `securecloud/app/routes/files.py`)
- File and dashboard routes → Encrypted file blobs: writes and reads blobs (evidence: `securecloud/app/routes/files.py`)
- Encryption service → Cipher policy artifact: selects cipher (evidence: `securecloud/app/services/crypto_service.py`)
- File and dashboard routes → Security reports: report navigation
- Security reports → Metrics and benchmarks: reads metrics (evidence: `securecloud/app/routes/report.py`)
