WinDirStat/SpaceMonger-style treemap visualizer for Google Drive — runs entirely in your browser.
- Treemap visualization — rectangles sized proportionally by storage usage
- Color-coded by file type — PDFs, videos, images, spreadsheets, code files each get distinct colors
- Drill-down navigation — click any folder to zoom in; breadcrumb trail to navigate back
- Full Drive scan — paginates the Drive API to index every file
- Read-only & private — uses
drive.metadata.readonlyscope; no file contents accessed; nothing sent to any server
- Go to console.cloud.google.com
- Create a new project (or select an existing one)
- Enable the Google Drive API:
- Navigate to APIs & Services → Library
- Search for "Google Drive API" and click Enable
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Choose Web application
- Add your GitHub Pages URL to Authorized JavaScript origins:
Also add
https://YOUR_USERNAME.github.iohttp://localhost:5173for local development. - Click Create and copy the Client ID
- Go to APIs & Services → OAuth consent screen
- Choose External (or Internal if using Google Workspace)
- Fill in the app name (e.g. "DriveMap"), support email, and developer email
- Add the scope:
https://www.googleapis.com/auth/drive.metadata.readonly - Add test users if the app is in "Testing" mode (or publish it)
- Fork this repository
- Go to your fork's Settings → Secrets and variables → Actions
- Add a new secret:
- Name:
VITE_GOOGLE_CLIENT_ID - Value: your Client ID from step 2
- Name:
- Go to Settings → Pages
- Source: GitHub Actions
- Push to
main(or trigger the workflow manually under Actions) - Your app is live at
https://YOUR_USERNAME.github.io/drivemap/
# Clone your fork
git clone https://github.com/YOUR_USERNAME/drivemap
cd drivemap
# Install dependencies
npm install
# Set your Client ID
echo "VITE_GOOGLE_CLIENT_ID=your_client_id_here" > .env.local
# Start dev server
npm run dev
# → http://localhost:5173drivemap/
├── src/
│ ├── components/
│ │ ├── LandingScreen.jsx # Sign-in page
│ │ ├── ScanningScreen.jsx # Progress indicator
│ │ ├── TreemapScreen.jsx # Main visualization shell
│ │ └── Treemap.jsx # D3 treemap renderer
│ ├── hooks/
│ │ ├── useGoogleAuth.js # OAuth token management
│ │ └── useDriveScanner.js # Drive API scanning state
│ ├── utils/
│ │ ├── driveApi.js # Drive API fetch helpers
│ │ ├── treeBuilder.js # Flat file list → D3 hierarchy
│ │ └── theme.js # Colors, formatters, constants
│ ├── config.js # Client ID configuration
│ ├── App.jsx
│ └── main.jsx
├── .github/workflows/deploy.yml
├── index.html
├── package.json
└── vite.config.js
DriveMap runs 100% in your browser. It:
- Only requests
drive.metadata.readonly— the minimum scope needed to read file names and sizes - Never reads file contents
- Never sends data to any server (there is no backend)
- Never stores your token or file list beyond the current browser session
| Library | Purpose |
|---|---|
| React 18 | UI framework |
| Vite | Build tool |
| @react-oauth/google | Google OAuth (implicit/token flow) |
| D3 v7 | Treemap layout & SVG rendering |
| Google Drive API v3 | File metadata |
MIT
