Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/arverma/Bihar-Police-Notebook/llms.txt

Use this file to discover all available pages before exploring further.

Bihar Police Notebook is a fully static website: there is no application server, no backend API, and no database in the cloud that the app controls. Every document you write is stored locally in your browser’s IndexedDB, and the optional Google Drive integration copies those documents into your own Drive folder — the app never touches a server of its own. The live editor runs at https://bpdiary.arverma.dev/.

Five external interactions

The system is made up of the browser-hosted editor and five interaction points. Nothing else leaves the device unless you explicitly trigger it.
System pieceRole
Editor siteThe entire UI: header, document History sidebar, Letter and Diary page templates, overlays, and settings. Served as static files from GitHub Pages.
IndexedDB (local)Primary document store — autosaves every keystroke with a 600 ms debounce. No network required. Two databases: bp-writing-tool (documents) and bp-writing-tool-auth (Drive session).
Google Input ToolsHinglish → Hindi Devanagari transliteration suggestions fetched from inputtools.google.com. Network-dependent; disabled automatically on screens narrower than 768 px (mobile).
Google DriveOptional manual backup into the folder Bihar Police Notebook Backup — do not delete in the user’s own Drive. Uses the drive.file scope — the app can only see files it created.
Browser print / PDFThe editor opens a formatted print window and calls window.print(). The browser’s native Save as PDF dialog handles the rest — no PDF library is bundled.

High-level flow

User
 └─▶ Editor site  ──▶  IndexedDB          (autosave, 600 ms debounce)
                  ──▶  Google Input Tools  (Hinglish suggestions, desktop only)
                  ──▶  Google Drive        (manual backup/restore, drive.file scope)
                  ──▶  Browser print/PDF   (window.print → Save as PDF)

Editor internals

All application logic lives under editor/js/. There is no build step for the app itself — the files are loaded directly as ES modules by the browser. The editor/ folder is the deployment artifact: what goes to GitHub Pages is exactly what you see in that directory.
main.js  (orchestrator)
  ├── paged-sheet.js    letter template + page spill
  ├── diary-sheet.js    FIR diary template + column layout
  ├── page-scale.js     fit-to-width scaling, pinch zoom
  ├── store.js          IndexedDB CRUD
  ├── drive-config.js   OAuth constants
  ├── drive-auth.js     GIS token client
  ├── drive-sync.js     Drive backup / restore
  ├── translit.js       Hinglish → Hindi suggestions
  ├── dictation.js      Web Speech engine
  ├── dictation-ui.js   dictation FAB
  ├── prefs.js          localStorage wrapper
  ├── punctuation.js    Hindi punctuation panel
  ├── quill-fields.js   Quill rich-text for diary fields
  └── utils.js          shared helpers
main.js is the only module that touches the DOM at the top level. All other modules export pure functions or small state machines and are imported by main.js (or by each other).

Module dependency overview

main.js
  ├── paged-sheet.js  ──▶  (store.js for save, quill-fields.js for rich text)
  ├── diary-sheet.js  ──▶  (store.js, quill-fields.js)
  ├── page-scale.js
  ├── store.js
  ├── drive-auth.js   ──▶  drive-config.js, prefs.js
  ├── drive-sync.js   ──▶  drive-config.js, drive-auth.js, store.js, prefs.js
  ├── translit.js
  ├── dictation.js    ──▶  prefs.js
  ├── dictation-ui.js ──▶  dictation.js, prefs.js
  ├── punctuation.js
  ├── quill-fields.js
  └── utils.js

Phone vs. computer

Behavior diverges at max-width: 768px:
  • Transliteration suggestions are hidden; the OS keyboard handles Hindi input instead.
  • The dictation FAB (microphone button) is not shown on mobile.
  • Page scaling switches from click-to-zoom to pinch-to-zoom.

Important constants

ItemValue
Live originhttps://bpdiary.arverma.dev
Drive folder nameBihar Police Notebook Backup — do not delete
Drive OAuth scopedrive.file (files the app created only)
IndexedDB — documentsbp-writing-tool
IndexedDB — auth sessionbp-writing-tool-auth
Mobile breakpointmax-width: 768px
Autosave debounce600 ms
The client ID in editor/js/drive-config.js is intentionally public — it is an OAuth client ID, not a secret. Never commit a client secret to the repository.

Build docs developers (and LLMs) love