Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚑ FlowDrive

Bring Your Own Storage β€” Hybrid Multi-Cloud Storage Platform

FastAPI React TailwindCSS shadcn/ui Cloudflare Pages Render License


FlowDrive is a state-of-the-art, open-source multi-cloud storage platform that lets users bring their own cloud storage space (Google Drive & Cloudflare R2) under a unified, high-contrast Neobrutalism UI dashboard.


✨ Features

  • 🎨 Neobrutalism Design System: Built using shadcn/ui Neobrutalism components β€” bold 4px black borders, drop shadows (4px 4px 0 #000), hover-shift interactions, and high-contrast typography (Space Grotesk & Inter).
  • πŸ”‘ Multi-Account Google Drive Linking: Connect multiple Google Drive accounts to a single FlowDrive user profile. Switch default target drives with a single click.
  • πŸ›‘οΈ Zero Data Lock-in: All permanent files live directly in your personal Google Drive inside a dedicated FlowDrive folder.
  • ⏱️ Temporary Auto-Expiring Storage: Store temporary files (1 hour, 24 hours, or 7 days) powered by Cloudflare R2 with automatic background cleanup schedules.
  • πŸš€ Parallel Upload Pool: Up to 5x multi-threaded parallel file uploads with live progress tracking and instant user cancellation support.
  • πŸ”’ Enterprise-Grade Security:
    • SHA-256 + Bcrypt password hashing for local accounts.
    • Signed cryptographic state tokens (itsdangerous) carrying PKCE code_verifier for OAuth 2.0.
    • SHA-256 derived Fernet symmetric encryption (AES-128-CBC) for storing Google OAuth refresh tokens securely.
    • SameSite=None; Secure cross-site ASGI session cookies.

πŸ› οΈ Technology Stack

Frontend

  • Framework: React 19 + Vite
  • UI & Components: Neobrutalism UI (shadcn/ui primitive set)
  • Styling: Tailwind CSS v4 + CSS Design Tokens
  • Icons & Notifications: Lucide React + Sonner Toasts

Backend

  • Framework: FastAPI (Python 3.11)
  • Database ORM: SQLAlchemy 2.0 (SQLite & PostgreSQL compatible)
  • Security & Encryption: Cryptography (Fernet), PyCryptodome, Bcrypt, ItsDangerous
  • Background Tasks: APScheduler (Automated temporary file cleanup)
  • Logging: Structlog + JSON-formatted unbuffered standard output

🌐 Live Demo Architecture

Component Platform Live URL
Frontend UI Cloudflare Pages https://flowdrive-80s.pages.dev
Backend API Render (Docker) https://flowdrive-backend-2.onrender.com

πŸ“– Self-Hosting & Deployment Guide

Follow this guide to deploy your own instance of FlowDrive with your own Google OAuth Client Credentials!


Step 1: Create Google OAuth 2.0 Credentials

  1. Go to the Google Cloud Console.
  2. Create a new project named FlowDrive.
  3. Navigate to APIs & Services > Library and search for Google Drive API. Click Enable.
  4. Go to APIs & Services > OAuth consent screen:
    • Choose External user type.
    • Fill in app name (FlowDrive), user support email, and developer contact information.
    • Under Scopes, add the following scopes:
      • openid
      • https://www.googleapis.com/auth/userinfo.email
      • https://www.googleapis.com/auth/userinfo.profile
      • https://www.googleapis.com/auth/drive.file (Restricted scope β€” only accesses files created by FlowDrive)
    • Add test users (your email address) if your app status is in Testing.
  5. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID:
    • Application Type: Web Application.
    • Name: FlowDrive Web Client.
    • Authorized JavaScript origins:
      • https://<your-cloudflare-pages-domain>.pages.dev
      • http://localhost:5173 (for local development)
    • Authorized redirect URIs:
      • https://<your-backend-render-domain>.onrender.com/api/v1/auth/google/callback
      • http://localhost:8000/api/v1/auth/google/callback (for local development)
  6. Copy your Client ID and Client Secret.

Step 2: Deploy Backend on Render

  1. Fork or push this repository to your GitHub account.
  2. Sign in to Render Dashboard and click New + > Web Service.
  3. Connect your GitHub repository.
  4. Select Docker as the Environment.
  5. Add the following Environment Variables in Render:
Variable Name Description Example Value
APP_ENV Application environment production
FRONTEND_URL Your Cloudflare Pages URL https://your-flowdrive.pages.dev
SESSION_SECRET Secret key for signed cookies Any random 32+ character string
TOKEN_ENCRYPTION_KEY Key for Fernet refresh token encryption Any random 32+ character string
GOOGLE_CLIENT_ID Your Google OAuth Client ID 123456789-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET Your Google OAuth Client Secret GOCSPX-xyz123...
GOOGLE_OAUTH_REDIRECT_URI Google OAuth Callback URL https://your-flowdrive-backend.onrender.com/api/v1/auth/google/callback
GOOGLE_DRIVE_FOLDER_NAME Folder created in user's Drive FlowDrive
  1. Click Create Web Service. Render will automatically build the Docker container and start your server!
  2. ⚑ Pro Tip β€” Keep Free Render Instance Awake: Render's free tier spins down web services after 15 minutes of inactivity. To prevent cold starts and keep your backend instantly responsive 24/7:
    • Create a free account on cron-job.org or UptimeRobot.
    • Set up an automated HTTP GET request every 10-14 minutes targeting your /health endpoint: https://<your-backend-render-domain>.onrender.com/health

Step 3: Deploy Frontend on Cloudflare Pages

  1. Log in to Cloudflare Dashboard and go to Workers & Pages.
  2. Click Create Application > Pages > Connect to Git.
  3. Select your repository.
  4. Configure Build Settings:
    • Framework Preset: Vite
    • Root directory: / (or leave empty)
    • Build command: cd frontend && npm install && npm run build
    • Build output directory: frontend/dist
  5. Under Environment Variables (Advanced), add:
    • VITE_API_BASE_URL: https://your-flowdrive-backend.onrender.com
  6. Click Save and Deploy. Cloudflare Pages will build and deploy your frontend globally!

πŸ’» Local Development Setup

1. Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Git

2. Clone Repository

git clone https://github.com/ShubhangDoley/FlowDrive.git
cd FlowDrive

3. Start Backend Server

cd backend
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate

pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Backend will be running at http://localhost:8000 (Swagger docs at http://localhost:8000/docs).

4. Start Frontend Client

cd frontend
npm install
npm run dev

Frontend will be running at http://localhost:5173.


πŸ›°οΈ API Architecture

FlowDrive API (/api/v1)
 β”œβ”€β”€ /health                          [GET] Health check & DB status
 β”œβ”€β”€ /auth
 β”‚    β”œβ”€β”€ /register                   [POST] Register username/password
 β”‚    β”œβ”€β”€ /login                      [POST] Authenticate user
 β”‚    β”œβ”€β”€ /logout                     [POST] Clear session cookie
 β”‚    β”œβ”€β”€ /me                         [GET] Fetch current authenticated user
 β”‚    β”œβ”€β”€ /google/connect-url         [GET] Fetch Google OAuth consent URL
 β”‚    β”œβ”€β”€ /google/connect             [GET] Direct OAuth redirect
 β”‚    └── /google/callback            [GET] OAuth callback from Google
 β”œβ”€β”€ /drive
 β”‚    └── /accounts
 β”‚         β”œβ”€β”€ /                      [GET] List connected Google Drive accounts
 β”‚         β”œβ”€β”€ /{id}                  [DELETE] Disconnect Drive account
 β”‚         └── /{id}/default          [PATCH] Set default active Drive account
 └── /files
      β”œβ”€β”€ /                           [GET] List all uploaded files
      β”œβ”€β”€ /upload                     [POST] Upload file (Drive / R2)
      β”œβ”€β”€ /{id}                       [DELETE] Remove file
      └── /{id}/download              [GET] Download file from storage

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

About

🌌 Bring Your Own Storage β€” Hybrid Multi-Cloud Storage Platform powered by Google Drive & Cloudflare R2 under a unified, high-contrast Neobrutalism UI dashboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages