Skip to content

CoderRony955/docSL

Repository files navigation

docSL banner

docSL

Document storage manager built with Flask, PocketBase, and Backblaze B2. docSL lets you upload, browse, update, search, and delete documents across local and cloud providers from one interface.

Table of Contents

About

docSL is a web app for managing documents across multiple backends:

  • PocketBase as local/self-hosted document metadata and file storage.
  • Backblaze B2 as cloud backup storage.
  • Combined operations for both providers through a single API/UI flow.

The application includes authentication, a dashboard, document upload/update/delete flows, and provider-based filtering.

Project Motive

The core motive behind building docSL is to safely manage important and sensitive documents with a hybrid storage model:

  • Local-first storage so critical documents remain under your control.
  • Cloud backup support for recovery and redundancy.
  • Encrypted cloud storage workflow so backed-up files are protected in transit/storage.

In short, the project is designed to give both ownership (local storage) and resilience (secure cloud backup) for high-value documents.

Features

  • User signup/login flow with session-based access control.
  • Multi-provider document listing (pocketbase, backblaze, or both).
  • Document upload support with temporary-file handling.
  • Document update and delete operations for selected storage providers.
  • Document search API with type filtering.
  • Dashboard with provider status and usage summary.

Project Structure

  • main.py: Flask app entry point and web routes.
  • routes/apis.py: REST endpoints for document operations.
  • storage/pocketbase/: PocketBase storage integration.
  • storage/blackbaze/: Backblaze B2 integration.
  • templates/: HTML templates used by the UI.
  • static/: Static files (styles/assets).
  • config.yaml: Runtime configuration.
  • example.config.yaml: Base template for configuration.

Requirements

Minimum requirements:

  • Python 3.13+
  • pip (or uv if you prefer)
  • Node.js 18+ and npm (for Tailwind CLI dependency)

Service requirements:

  • PocketBase server (reachable URL)
  • Backblaze B2 account (optional but required for cloud backup features)

Python dependencies (from pyproject.toml):

  • Flask
  • PyYAML
  • pocketbase
  • b2sdk

Node dependencies (from package.json):

  • tailwindcss
  • @tailwindcss/cli

Configuration

  1. Copy example configuration:
cp example.config.yaml config.yaml

On Windows PowerShell:

Copy-Item example.config.yaml config.yaml
  1. Update config.yaml values:
  • app.username and app.password
  • app.host, app.port, app.debug
  • app.pocketbase.* values (URL, credentials, collection)
  • app.backblaze.* values (application key ID, key, bucket name)

PocketBase Setup

Set up PocketBase before starting the app:

  1. Download PocketBase from the official site: https://pocketbase.io
  2. Extract the binary and run it.
  3. Start the server (default: http://127.0.0.1:8090).
  4. Open the PocketBase admin UI in browser.
  5. Create an admin account.
  6. Create the collection used by this project (set its name in app.pocketbase.collection_name inside config.yaml).
  7. Create or prepare user credentials for API access and put them in:
  • app.pocketbase.email
  • app.pocketbase.password
  • app.pocketbase.url

Recommended:

  • Keep PocketBase running as a local/private service.
  • Use strong credentials and restrict external access if hosted remotely.

Backblaze B2 Setup

Set up Backblaze B2 for encrypted cloud backup:

  1. Create/sign in to your Backblaze account: https://www.backblaze.com/
  2. Enable B2 Cloud Storage in your account.
  3. Create a bucket for backups (private bucket recommended and enable encryption).
  4. Create an Application Key with access to that bucket.
  5. Save these values into config.yaml:
  • app.backblaze.application_key_id
  • app.backblaze.application_key
  • app.backblaze.bucket_name

Security notes:

  • Store keys only in trusted environments.
  • Rotate keys periodically.
  • Use private buckets for sensitive documents.
  • Keep local copies of critical files even when cloud backup is enabled.

Installation

First of all clone the repository:

git clone https://github.com/CoderRony955/docSL.git

Windows

  1. Install prerequisites:
  • Python 3.13+
  • Node.js 18+
  • PocketBase running and configured
  • Backblaze B2 configured (if cloud backup is required)
  1. Open PowerShell in the project directory:
cd docSL
  1. Create and activate virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
  1. Upgrade pip (recommended):
python -m pip install --upgrade pip
  1. Install Python dependencies:
pip install -e .
  1. Install Node dependencies:
npm i

Linux

  1. Install prerequisites:
  • Python 3.13+
  • python3-venv
  • Node.js 18+
  • PocketBase running and configured
  • Backblaze B2 configured (if cloud backup is required)
  1. Open terminal in the project directory:
cd /path/to/docSL
  1. Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Upgrade pip (recommended):
python -m pip install --upgrade pip
  1. Install Python dependencies:
pip install -e .
  1. Install Node dependencies:
npm i

macOS

  1. Install prerequisites:
  • Python 3.13+
  • Node.js 18+
  • PocketBase running and configured
  • Backblaze B2 configured (if cloud backup is required)
  1. Open terminal in the project directory:
cd /path/to/docSL
  1. Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Upgrade pip (recommended):
python -m pip install --upgrade pip
  1. Install Python dependencies:
pip install -e .
  1. Install Node dependencies:
npm i

Run the App

Start the Flask app:

python main.py

Default config example uses:

  • Host: 0.0.0.0
  • Port: 8080
  • Debug: true

Open your browser:

http://localhost:8080

Terms of Use

By using this project, you agree to the following:

  • You are responsible for securing credentials configured in config.yaml.
  • You are responsible for legal compliance of any uploaded or processed files.
  • This software is provided "as is", without warranties of any kind.
  • The maintainers are not liable for data loss, downtime, or misconfiguration.
  • Always test storage operations in a safe environment before production use.

Also see on route /terms-of-use for more details.

Contributing

Contributions are welcome! Please open an issue or a pull request if you have any suggestions or find any bugs.

License

This project is released under the MIT License.