Skip to content

Repository files navigation

☁️ Smart Cloud File Management System

Cloud Computing Capstone Project — Academic Version 1.0

A modular Python application that simulates an enterprise document storage platform.
Upload, organise, search, analyse, and optionally sync files to Azure Blob Storage — all from a clean CLI interface.


✨ Features

Feature Description
📤 File Upload Validate, deduplicate (SHA-256), auto-categorise, and store files
🔍 Search Filter by name, category, extension, date range, or size
📥 Download Retrieve files by ID with optional Azure fallback
🗑️ Delete Soft delete (recoverable) or hard delete
♻️ Restore Reverse any soft delete
🗂️ Organise Auto-scan and relocate misplaced files
📊 Analytics Totals, averages, distributions, upload timeline
📄 HTML Report Self-contained dark-themed report with 4 embedded charts
☁️ Azure Sync Upload/download via Azure Blob Storage (optional)
📧 Email Report Send generated report via SMTP (optional)

🚀 Quick Start

1. Clone / Enter the project

cd /path/to/cap2

2. Create a virtual environment

python -m venv .venv
source .venv/bin/activate      # Linux / macOS
.venv\Scripts\activate         # Windows

3. Install dependencies

pip install -r requirements.txt

4. Configure the environment

cp .env.example .env
# Edit .env if needed (all defaults work for local mode)

5. Run the application

python run_manager.py

📁 Project Structure

cap2/
├── cloud_manager/          # Core Python package
│   ├── __init__.py
│   ├── logger.py           # Rotating file + console logger
│   ├── utils.py            # Helpers: UUID, checksum, size, category map
│   ├── database.py         # SQLite CRUD layer
│   ├── uploader.py         # File upload pipeline
│   ├── organizer.py        # Storage organisation
│   ├── search.py           # Search engine (tabulate output)
│   ├── downloader.py       # File retrieval
│   ├── deleter.py          # Soft/hard delete + restore
│   ├── analytics.py        # Storage metrics
│   ├── charts.py           # Matplotlib chart generators
│   ├── report_generator.py # HTML report orchestrator
│   ├── azure_storage.py    # Azure Blob Storage integration
│   └── emailer.py          # SMTP email delivery
│
├── templates/
│   └── report_template.html  # Jinja2 dark-themed HTML template
│
├── tests/
│   ├── test_database.py
│   ├── test_uploader.py
│   ├── test_search.py
│   └── test_reports.py
│
├── data/                   # SQLite DB + CSV exports (auto-created)
├── storage/                # Managed file storage (auto-created)
├── reports/                # HTML report + charts (auto-created)
├── logs/                   # Rotating application logs (auto-created)
│
├── run_manager.py          # CLI entry point
├── requirements.txt
├── .env.example
└── .gitignore

🗃️ Database Schema

CREATE TABLE files (
    file_id       TEXT PRIMARY KEY,   -- UUID hex (32 chars)
    file_name     TEXT NOT NULL,
    category      TEXT NOT NULL,      -- Documents, Images, Videos, …
    extension     TEXT NOT NULL,      -- lowercase, no dot
    file_size     INTEGER NOT NULL,   -- bytes
    checksum      TEXT NOT NULL,      -- SHA-256 hex digest
    storage_path  TEXT NOT NULL,      -- absolute path on disk
    upload_date   TEXT NOT NULL,      -- ISO-8601
    modified_date TEXT NOT NULL,      -- ISO-8601
    status        TEXT NOT NULL       -- 'active' | 'deleted'
);

📂 Category Mapping

Category Extensions
Documents pdf, doc, docx, txt, odt, rtf, md, ppt, pptx
Images jpg, jpeg, png, gif, bmp, svg, webp, tiff
Videos mp4, avi, mov, mkv, wmv, flv, webm
Spreadsheets xls, xlsx, csv, ods, tsv
Archives zip, tar, gz, bz2, rar, 7z, xz
Projects py, js, ts, html, css, json, yaml, sh, java, go
Others Everything else

🔧 Environment Variables

Variable Default Description
STORAGE_PATH storage/ Local storage root directory
DB_PATH data/files.db SQLite database path
REPORT_PATH reports/ Report output directory
UPLOAD_TO_AZURE false Enable Azure Blob sync
AZURE_STORAGE_CONNECTION_STRING (empty) Azure connection string
AZURE_CONTAINER_NAME cloud-file-manager Blob container name
SEND_EMAIL false Enable email report delivery
SMTP_HOST smtp.gmail.com SMTP server host
SMTP_PORT 587 SMTP server port
SMTP_USER (empty) Sender email address
SMTP_PASS (empty) SMTP password / app password
EMAIL_RECIPIENT (empty) Report destination email
LOG_LEVEL INFO Logging level
LOG_PATH logs/manager.log Log file path

🧪 Running Tests

pytest tests/ -v

Expected output: all tests pass (no Azure credentials required).


📊 Generated Outputs

After running the system and generating a report:

  • data/files.db — SQLite database
  • data/metadata.csv — full file catalogue export
  • reports/report.html — self-contained HTML analytics report
  • reports/storage_summary.csv — high-level stats CSV
  • reports/charts/category_distribution.png
  • reports/charts/storage_usage.png
  • reports/charts/file_types.png
  • reports/charts/upload_history.png
  • logs/manager.log — rotating application log

📝 License

Academic use only. Cloud Computing Capstone Project.

About

Modular Python-based cloud file management system for uploading, organizing, searching, analyzing, and securely retrieving files, with SQLite-backed metadata, SHA-256 deduplication, analytics and report generation, soft/hard deletion and restoration, plus optional Azure Blob Storage synchronization and email reporting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages