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 static website — the entire application is the editor/ directory. There is no Node build step, no server-side rendering, and no Python backend for the application itself. Deployment is handled by a single GitHub Actions workflow that uploads the editor/ folder as a Pages artifact on every qualifying push.

How the publish pipeline works

Any push to the main (or master) branch that touches a file under editor/** or modifies .github/workflows/pages.yml triggers the workflow automatically. You can also run it manually from the Actions tab using the workflow_dispatch trigger.
# .github/workflows/pages.yml (key excerpt)
on:
  push:
    branches: [main, master]
    paths:
      - 'editor/**'
      - '.github/workflows/pages.yml'
  workflow_dispatch:
The workflow performs four steps in sequence:
  1. Checkout — checks out the repository at the pushed commit.
  2. Setup Pages — runs actions/configure-pages to prepare the GitHub Pages environment.
  3. Upload artifact — uploads the editor/ folder as a Pages artifact using actions/upload-pages-artifact.
  4. Deploy — publishes the artifact to GitHub Pages via actions/deploy-pages.
The live site is then served at https://bpdiary.arverma.dev/ — a custom domain alias configured in the repository’s Pages settings.
The workflow uses concurrency: group: pages with cancel-in-progress: true, so a newer push automatically cancels any in-progress deployment for the same branch.

Local preview

Because the editor is static files, a plain HTTP file server is all you need. The standard approach uses Python’s built-in server — no npm install required for just running the app.
1

Clone the repository

git clone https://github.com/arverma/Bihar-Police-Notebook.git
cd Bihar-Police-Notebook
2

Change into the editor directory

The editor/ folder is the web root. Serving from the repository root would expose parent directories — always serve from inside editor/.
cd editor
3

Start the HTTP server

python3 -m http.server 8080
You should see output like Serving HTTP on 0.0.0.0 port 8080.
4

Open the app in your browser

Navigate to http://127.0.0.1:8080/. The editor loads immediately — IndexedDB, transliteration, and print/PDF all work at this URL without any further setup.
You can use any port you like. If 8080 is taken, try python3 -m http.server 3000. Just remember the port when you add the OAuth origin in the next section.

Google Drive OAuth setup

Drive integration requires the origin of the page that hosts the app to be listed as an Authorised JavaScript origin in your Google Cloud Console project. Without this, the GIS token client will refuse to open the consent popup.
Add the following origin in APIs & Services → Credentials → OAuth 2.0 Client IDs for your client ID:
https://bpdiary.arverma.dev
This is already configured for the live deployment. You only need to change it if you fork the project and host it on a different domain.
The file editor/js/drive-config.js contains the OAuth Client ID (a public identifier). Do not add a client secret to this file or commit one anywhere in the repository. The drive.file scope means the app can only access files it created, even if the client ID were shared.

Development dependencies (testing only)

The app itself has zero runtime dependencies. The package.json includes two devDependencies for the test suite only:
PackagePurpose
vitestUnit tests — run with npm test (vitest run editor/)
@playwright/testEnd-to-end tests — run with npm run test:e2e
Neither package is needed to run, preview, or deploy the application.
# Run unit tests (Vitest)
npm test

# Run end-to-end tests (Playwright — requires browsers installed)
npm run test:e2e

Build docs developers (and LLMs) love