Docstree is a Manifest V3 browser extension that signs in with Google and shows your Drive (My Drive and Shared Drives) as a clean, collapsible tree. It is built with React and Plasmo for quick iteration and open-source contributions.
- Quickly browse Google Drive folders/files without opening drive.google.com
- Jump straight to a file or folder via the tree links
- Keep a lightweight set of favorites for frequent locations
- Stay in a privacy-first client: no backend, tokens remain in the browser
- Google OAuth with
identity+ Drive read-only scope; sign-in/out from the popup - Toggle between My Drive and available Shared Drives; remembers the last selection
- Live tree view with search filter, item counts, and per-item favorites
- Light/dark theme toggle; preference stored locally
- Favorites tab built from your starred nodes; persisted locally
- Links open in a new tab directly to the Drive item
- Node.js 18+
- A package manager (
pnpm,npm, oryarn) - Chrome/Edge/Firefox with extension developer mode enabled
- A Google Cloud OAuth client ID for the extension (no client secret is stored or required)
- Install dependencies:
pnpm install # or npm install / yarn install - Run the dev build:
pnpm dev # or npm run dev / yarn dev - Load the unpacked build:
- Chrome/Edge: open
chrome://extensions(oredge://extensions), enable Developer mode, click Load unpacked, and selectbuild/chrome-mv3-dev. - Firefox: open
about:debugging#/runtime/this-firefox, click Load Temporary Add-on, and selectbuild/firefox-mv3-dev/manifest.json.
More detail: docs/getting-started.md.
- Copy
.env.exampleto.env.local(or.env) and setPLASMO_PUBLIC_GOOGLE_CLIENT_ID=.... - Only
PLASMO_PUBLIC_*vars are exposed to the client bundle; keep anything sensitive out of the extension entirely. .envis gitignored;.env.exampleshows required keys for contributors.
- Enable the Google Drive API in your Cloud project.
- Create an OAuth client for the extension and set the redirect to
https://<EXTENSION_ID>.chromiumapp.org/. - Place your client ID in
.env.localviaPLASMO_PUBLIC_GOOGLE_CLIENT_ID. No client secret is needed in the extension code. - Keep OAuth JSON secrets out of source control when publishing.
Full walkthrough: docs/google-drive-setup.md.
- Open the extension popup → Sign in with Google.
- Choose a root: My Drive, a Shared Drive, or Favorites (appears after you star something).
- Use the search box to filter the tree; click a row to open the Drive link in a new tab.
- Star/unstar nodes to build your favorites list; theme toggle lives in the popup menu.
pnpm build # or npm run build / yarn buildOutputs production bundles in build/<browser>-mv3-prod, ready to zip and submit to extension stores. pnpm package can also produce zipped artifacts.
popup.tsx— main UI (tree rendering, search, favorites, theming, auth state)lib/googleAuth.ts— Google OAuth viachrome.identitylib/googleDrive.ts— Drive API calls (files and shared drives)styles/*+tailwind.config.js— theme tokens and Tailwind setupdocs/*— setup guides for development and Drive/OAuth configuration
- Docstree is client-side only; it calls Google APIs directly from the browser.
- Access token and preferences (selected drive, theme, favorites) are stored locally (
chrome.storage/localStorage). - Scope is limited to
drive.readonlyby default; broaden only if you need additional capabilities. - Do not commit private OAuth JSON files (e.g.,
secrets/*.json) when publishing the project.