Vaibhav More Logo
VAIBHAVMORE
ACTIVE PRODUCTION / UTILITY•
2024
•
Offline-First Native Desktop Application (Windows)

AutoBillDrive

Offline-First Desktop Billing & Invoicing Automation System

Offline-first desktop billing application for Windows with SQLite persistence, automated PDF generation, Google Drive sync, and WhatsApp delivery.

Category

Automation & Utilities, Backend Systems

Timeline

3 Months (Iterative Design & Deployment)

Primary Core

Electron

Platforms

Windows 10 / 11 (x64, ARM64), macOS (packaged), Linux (deb/AppImage)

PROJECT OVERVIEW & STRATEGY

Problem, Solution & Engineering Scope

The Industry Friction

Operational Challenges & Cloud Fragility

Small workshops, service garages, and retail businesses face unstable internet connections and high subscription costs for cloud-based POS tools. Network downtime halts invoice generation, disrupts walk-in customer checkout, and leads to error-prone handwritten bills that cause tax discrepancies and inventory stockouts.

The Architectural Solution

Offline-First Zero Latency Local Engine

A zero-latency, local-first Electron desktop billing station running an embedded SQLite database. Invoices and inventory updates commit atomically on the local disk within milliseconds. Whenever network connectivity is detected, background daemons sync encrypted backups to Google Drive and enable instant PDF delivery over WhatsApp.

Core Project Objectives
  • 1Deliver sub-10ms invoice persistence without requiring an active internet connection
  • 2Generate professional, tax-compliant PDF invoices with custom headers and serial numbering in under 150ms
  • 3Automate off-site cloud backups to Google Drive with zero configuration for non-technical shop owners
  • 4Streamline digital distribution through instant single-click WhatsApp delivery
Target End-Users
  • Automobile Repair Shops & Service Centers
  • Hardware & Raw Material Retailers
  • Independent Contractors & Freelance Technicians
  • Small Business Accounting Desks
Architecture & Modules

Key System Capabilities

Engineered features and deep architectural implementations.

10 Modular Features
ATOMIC ACID
Core Billing

Invoice Management

Create, itemize, edit, and void invoices with automated tax calculations, discounts, and custom payment states.

DIRECTORY
Customer CRM

Customer Management

Maintain comprehensive customer ledgers, transaction histories, credit balances, and one-click contact shortcuts.

REAL-TIME
Stock Control

Materials & Inventory

Manage stock counts, batch prices, low-stock warnings, and barcode/SKU mappings with auto-deduction upon billing.

150MS RENDER
Document Engine

Vector PDF Generation

Vector-precision PDF engine rendering customized multi-page invoices with branding logos, terms, and tax breakdown.

OAUTH 2.0
Cloud Backup

Google Drive Sync

Background watcher uploads encrypted database snapshots and compiled invoice PDFs whenever network connects.

ONE-CLICK
Customer Delivery

WhatsApp Sharing

Dispatches generated invoices directly to customer WhatsApp numbers using deep-linked web automation.

SPREADSHEET
Data Portability

Excel Import / Export

Bidirectional xlsx and csv synchronization to import customer databases or bulk-export monthly sales ledgers.

HEURISTIC
Smart Audit

AI Invoice Review

Intelligent validation checking for duplicated line items, irregular tax tiers, and anomalous totals before printing.

LOCAL INSIGHTS
Analytics

Revenue Dashboard

Real-time visual reports tracking daily revenue, top-selling inventory items, outstanding credit, and tax liability.

ZERO DATA LOSS
Data Safety

Backup & Restore

Single-click encrypted local archive generation and restoration with automatic timestamped checkpointing.

Topology & Pipeline

AutoBillDrive IPC & Offline-First Persistence Architecture

Electron multi-process topology separating Chromium UI from the Node.js main supervisor with sandboxed IPC channels and an embedded SQLite transactional engine.

Low-Level Desktop Process
Interactive Architecture Map
Frontend / UI

Presentation Layer

Electron Renderer (Chromium) running React/Tailwind UI with reactive state, responsive data tables, and instant print previews.

Main / API

Application Core

Node.js Main Process handling system IPC, file system access, PDFKit vector rendering, and native OS dialogs.

Database

Persistence Layer

Embedded SQLite 3 with Write-Ahead Logging (WAL) and PRAGMA foreign_keys=ON for atomic ACID commits.

Integrations

External Services

Google Drive API (OAuth 2.0 refresh tokens), WhatsApp Web automation, and SheetJS Excel parsers.

Frontend Layer

Electron Renderer (Chromium) running React/Tailwind UI with reactive state, responsive data tables, and instant print previews.

Backend / Logic

Node.js Main Process handling system IPC, file system access, PDFKit vector rendering, and native OS dialogs.

Database Layer

Embedded SQLite 3 with Write-Ahead Logging (WAL) and PRAGMA foreign_keys=ON for atomic ACID commits.

Integration Layer

Google Drive API (OAuth 2.0 refresh tokens), WhatsApp Web automation, and SheetJS Excel parsers.

Architectural Subsystems & Responsibilities

Renderer WindowChromium / React / Tailwind

Renders billing workspace, customer directory, and dynamic data tables.

IPC BridgeElectron ContextBridge

Enforces strict process sandboxing and validates all inter-process message payloads.

Core SupervisorNode.js Main Process

Executes business transactions, manages system events, and orchestrates sync workers.

Persistence Layerbetter-sqlite3

Executes sub-millisecond local SQL transactions with write-ahead logging (WAL).

Document CompilerPDFKit Canvas Engine

Constructs vector-perfect PDF invoices in-memory with custom layout coordinates.

Cloud Sync DaemonGoogle Drive REST API

Polls network connectivity and pushes incremental database backups and PDF artifacts.

Product Gallery

Application Interface & Workflows

High-resolution screenshots showcasing user workflows, dashboards, and operational interfaces.

5 Interface Views
Revenue & Sales Performance Dashboard
Enlarge ViewSlot 1
Dashboard01 / 05

Revenue & Sales Performance Dashboard

Real-time summary of daily revenue, open receivables, and fast-moving inventory items.

POS Billing & Fast Line-Item Entry
Enlarge ViewSlot 2
Invoice Creation02 / 05

POS Billing & Fast Line-Item Entry

Streamlined billing interface with instant product search, tax calculation, and split payment modes.

Customer Directory & Balance Ledger
Enlarge ViewSlot 3
Customer Management03 / 05

Customer Directory & Balance Ledger

Centralized directory tracking individual customer billing history, credit allowances, and contact details.

Vector PDF Invoice Preview & Print
Enlarge ViewSlot 4
Invoice Preview04 / 05

Vector PDF Invoice Preview & Print

High-precision vector PDF output rendered with custom branding, itemized tables, and tax breakdown.

Financial Reports & Tax Analytics
Enlarge ViewSlot 5
Reports & Analytics05 / 05

Financial Reports & Tax Analytics

Detailed analytics breakdown covering GST reports, monthly turnover, and stock replenishment alerts.

Under The Hood

Technology Stack & Core Tooling

Selected languages, frameworks, runtime environments, and engines.

8 Technologies Identified
Electron logo
Desktop

Electron

Cross-platform desktop application shell with native OS API bindings and isolated IPC renderer.

Integratedelectron
Node.js logo
Backend

Node.js

Main supervisor process handling file I/O, IPC message routing, and background sync workers.

Integratednodedotjs
SQLite logo
Database

SQLite

Embedded zero-configuration transactional database running in Write-Ahead Logging (WAL) mode.

Integratedsqlite
PDFKit logo
Libraries

PDFKit

High-performance vector PDF rendering engine generating itemized tax invoices in memory.

Integratedadobeacrobatreader
React logo
Frontend

React

Component-driven user interface for POS billing forms, customer search, and inventory tables.

Integratedreact
Tailwind CSS logo
Frontend

Tailwind CSS

Utility-first styling powering desktop dark mode and responsive layout grids.

Integratedtailwindcss
Google Drive API logo
Tools

Google Drive API

OAuth 2.0 automated cloud backup service syncing encrypted snapshots and invoices.

Integratedgoogledrive
SH
Libraries

SheetJS (xlsx)

Bidirectional Excel and CSV data parser for bulk inventory imports and financial ledger exports.

Integratedsheetjsxlsx
Data Model & Storage

Database Architecture & Schema

Normalized relational schema designed to 3NF standards, enforcing referential integrity with foreign key constraints, composite unique indexes, and SQLite Write-Ahead Logging (WAL).

SQLite (3NF Normalized)
Storage Strategy & Concurrency Engine

Zero-configuration local SQLite persistence running in Write-Ahead Logging (WAL) mode. Transactions write to the WAL ring buffer with zero blocking on read queries, achieving under 2ms read/write latency. Automatic VACUUM and hourly checkpoints ensure zero database fragmentation.

Entity Relationships & Foreign Keys
customers1:Ninvoices

One customer can have multiple invoices and historical payment records.

invoices1:Ninvoice_items

An invoice contains one or more itemized line products with quantity and tax rates.

materials1:Ninvoice_items

Inventory materials map to billed line items to trigger automated stock decrements.

Tables (5):

Table:invoices

Header records for all customer billing transactions and totals.

9 Defined Columns
ColumnTypeConstraintsDescription
idINTEGER
PK
Auto-incrementing unique invoice identifier.
invoice_numberTEXT
-
Sequential formatted invoice code (e.g. INV-2024-0012).
customer_idINTEGER
FK
Foreign key reference to the billed customer.→ References customers(id)
subtotalREAL
-
Sum of line item amounts before tax and deductions.
tax_amountREAL
-
Aggregated CGST, SGST, or IGST tax sum.
discount_amountREAL
-
Discretionary discount applied to the bill.
total_amountREAL
-
Final payable amount rounded to standard currency.
payment_statusTEXT
-
Status flag: 'PAID', 'PENDING', or 'PARTIAL'.
created_atTEXT
-
ISO 8601 creation timestamp.
Problem Solving

Engineering Challenges & Technical Solutions

Complex bottlenecks, concurrency hurdles, and architectural decisions resolved during development.

3 Critical Engineering Trade-offs
Technical Resolution

Configured SQLite with PRAGMA journal_mode = WAL and PRAGMA synchronous = NORMAL, coupled with atomic transaction blocks wrapped in Node.js IPC handlers to guarantee zero state corruption.

Implementation Details & Mechanics

Transactions are executed within db.transaction() scopes in better-sqlite3, committing to disk in <4ms with automated hourly VACUUM checkpoints.

Trade-off Evaluated:Minor temporary disk footprint overhead for the WAL ring buffer in exchange for instantaneous non-blocking reads and crash durability.
Authorship & Ownership

Individual Contributions & Architectural Ownership

Sole Architect & Full-Stack Desktop Engineer responsible for design, desktop shell, data model, and local distribution.

Architected the multi-process Electron application with sandboxed IPC communication

Designed the 3NF relational SQLite schema with foreign key cascades and WAL mode

Built the dynamic PDFKit canvas layout engine for custom invoice compilation

Implemented Google Drive OAuth 2.0 token management and automated cloud sync daemon

Engineered single-click WhatsApp Web deep-linking for paperless invoice dispatch

Results & Metrics

Project Outcomes & Benchmarks

Deployed to active workshop environments, eliminating checkout delays during internet blackouts and cutting billing turnaround time by over 40%.

Commit Latency
< 5ms

Local SQLite transaction write speed

PDF Generation
< 140ms

Full vector document compile time

Offline Availability
100%

Zero cloud dependencies for billing

Checkout Speed
+45%

Faster customer transaction processing

Planned Architectural Roadmap & Future Enhancements
  • 1
    Thermal receipt printer driver support via ESC/POS direct USB printing
  • 2
    Multi-terminal LAN synchronization allowing multiple checkout counters to share a local SQLite server
  • 3
    Automated GST e-Way bill and e-Invoicing portal direct government API integration
Next Case Studies

Explore Other Architectures

All Projects & Case Studies →
Full-Stack Web

EventApp

Production-ready event registration platform with Spring Boot 3.2, React 18, JWT RBAC, QR-code ticket generation, and async email confirmations.

Explore Architecture
Full-Stack Web

FarmaShield

Digital biosecurity monitoring platform for agricultural and poultry operations with real-time risk dashboards, role-based workflows, and multilingual UI.

Explore Architecture