gdrive-notepad
v1.0.0
Published
A local-first notepad web app with autosave, light/dark mode, and optional one-click Google Drive sync
Maintainers
Readme
Notepad — local-first, optional Google Drive sync
Notes save to your local disk by default. No login needed. Click Connect Google Drive any time to start also syncing to a Drive folder called "Notepad Sync".
Run it
npm install
node server.jsOpen http://localhost:3000
That's it — try it right now, no Google setup required. Create notes, edit
them, they save to data/notes/ on your machine.
Enable Google Drive sync (optional)
You can add credentials right from the app now — no .env editing required:
- Go to https://console.cloud.google.com/apis/credentials
- Create a project (or use an existing one) and enable the Google Drive API (APIs & Services > Library > search "Google Drive API" > Enable).
- Create credentials → OAuth client ID → Application type: Web application.
- Under "Authorized redirect URIs" add:
http://localhost:3000/api/drive/callback - Copy the Client ID and Client Secret.
- In the app, click Google Drive settings in the sidebar, paste them in, and click Save.
- Click Connect Google Drive, sign in, approve access.
- Click Sync all now to push any notes you wrote before connecting. From then on, every save also updates the file on Drive.
Credentials are saved to data/credentials.json on your machine (gitignored) —
never sent anywhere except to Google during the OAuth flow. Multiple people
running their own copy of this app just paste in their own client ID/secret.
If you'd rather set credentials as environment variables instead, .env.example
still works as a fallback — copy it to .env and fill it in; anything saved
via Settings in the UI takes priority over .env.
Notes uses the drive.file scope — the app can only see files it creates
itself, never the rest of your Drive.
How data is stored
data/index.json— metadata for all notes (name, last updated, and the Drive file ID once synced)data/notes/<id>.txt— the actual note content, one file per notedata/drive-token.json— your Google OAuth token, created after you connect
Project structure
server.js Express app, wires local + Drive routes together
localStore.js Local-first storage (works with zero configuration)
drive.js Google OAuth + Drive API calls (only touched when connected)
public/ Frontend (plain HTML/JS, no build step)