Back to Systems EngineeringLegal & Astronomical Engineering

Aaj: Offline Indian Daily Almanac & AGPL License Isolation Pipeline

Building an offline-first astronomical almanac PWA with Astro, build-time Swiss Ephemeris calculations, and an automated CI quarantine gate isolating AGPL-3.0 code from client bundles.

RoleCo-Founder & Chief Technology Officer, 7Zen Labs
Timeline2025 — 2026
DomainLocal-First & Distributed
EnvironmentMass Consumer Offline Daily Almanac PWA
Bundle AGPL Leakage0.00%Verified by automated CI quarantine gate
Precomputed Span2026 — 2028Daily facts for ~30 Indian cities
Client Bundle42 KBUltra-lightweight Astro PWA
Runtime DependencyZero Cloud100% offline service worker
Aaj system logoAaj•Local-First & Distributed
Click to inspect
Aaj: Offline Indian Daily Almanac & AGPL License Isolation Pipeline Architecture Dashboard
Inspect Full Screen
Mass Consumer Offline Daily Almanac PWA
Enterprise Confidentiality & Architectural Governance NoticeAll architecture topologies, state invariant proofs, and failure recovery protocols presented in this dossier are sanitized commercial abstractions. Production source code, database credentials, and proprietary business schemas remain strictly confidential and protected under commercial Non-Disclosure Agreements (NDAs).

Executive Architecture Summary

Aaj is a high-precision, offline-first consumer daily almanac (Panchang) progressive web app. Its core technical innovation lies in solving a difficult dual challenge: computing complex planetary astronomical ephemeris equations without loading heavy C libraries on mobile browsers, while strictly isolating AGPL-3.0 licensed calculation engines to protect proprietary application code.

The Problem Space & Inherent Failure Modes

Computing Vedic tithis, planetary coordinates, and solar ephemeris requires the Swiss Ephemeris library—a battle-tested C engine distributed under the strict AGPL-3.0 copyleft license. Bundling WebAssembly ports into client browsers not only bloats web apps by 10MB, but legally triggers AGPL distribution provisions, forcing the entire commercial codebase into open-source disclosure.

AGPL Build-Time Quarantine & Static Artifact Pipeline

Hermetic separation of AGPL build-time computation tools from client distribution assets.

7Zen Aaj :: ARCHITECTURAL TOPOLOGY
Interactive Data Bus • Click any subsystem to view formal guard invariant
SUBSYSTEM INVARIANT: Optimistic State EngineFIFO Queue Processor
Layer: QUEUE
Formal Correctness Invariant

UI updates instantaneously before network handoff

Core Invariants & Non-Negotiable Guarantees

Zero-Runtime AGPL Code Invariant

No AGPL-3.0 code, C binary, or WebAssembly module is ever packaged into the client web distribution. Verified on every git commit via an automated CI quarantine scanner.

Golden Set Astronomical Verification

Precomputed sunrise, sunset, and tithi timestamps must match official Rashtriya Panchang ephemeris tables within a strict 60-second delta across all ~30 coordinate matrices.

Subsystems Architecture & Implementation Decisions

1. Build-Time Python Precomputation Engine

Architected an automated build-time pipeline using Python SwissEph that calculates high-precision celestial coordinates, lunar phases, and auspicious time intervals for ~30 major Indian urban centers across 2026-2028.

Key Architectural Decisions:

  • •Precomputed data is structured into compressed, city-partitioned JSON tables for minimal bandwidth consumption.
  • •Employed multiprocessing to reduce 3-year ephemeris calculations from 42 minutes to 85 seconds.

2. Automated CI Legal Quarantine Gate

Implemented a strict GitHub Actions compliance gate that scans compiled output bundles for banned license headers, symbol tables, and binary signatures before deployment approval.

Key Architectural Decisions:

  • •Ensured unambiguous compliance with open-source software license governance.
  • •Segregated calculation scripts into an isolated tools/ directory with explicit build-only execution flags.

3. Ultra-Lightweight Astro PWA with Service Worker Offline Storage

Engineered the frontend in Astro for zero unnecessary JavaScript hydration. When a user selects their city, the service worker downloads that city’s year-round JSON table (under 80KB), enabling instantaneous offline access in rural areas.

Key Architectural Decisions:

  • •Eliminated all external font and analytics dependencies for maximum privacy and performance.
  • •Designed responsive celestial time dials that compute user daylight progression locally using trigonometric math.

Failure Modes & Edge Case Recovery Protocols

Failure Scenario: User travels to remote village with zero cellular reception
Mechanism: Mobile browser has no active internet connection.
Recovery Protocol: PWA service worker serves cached astronomical tables from CacheStorage. Local device clock drives dial progression with zero network requests.
Failure Scenario: Accidental dependency import bridging AGPL tools into web bundle
Mechanism: Developer accidentally imports a calculation function into an Astro component.
Recovery Protocol: CI quarantine gate detects non-compliant AST import and fails build before Cloudflare Pages deployment.

Technologies & Engineering Standards

Precomputation Engine
PythonSwiss EphemerisMultiprocessing
Frontend Architecture
AstroTypeScriptTailwind CSSPWA Service Workers
Compliance & CI
GitHub ActionsStatic License ScannerGolden Set Tests

Verified Production Outcomes

  • Precomputed over 32,000 individual astronomical daily facts with verified golden-set precision against Rashtriya Panchang standards.
  • Achieved sub-50ms First Contentful Paint (FCP) on low-end Android mobile devices.
  • Build-time calculation pipeline isolates Swiss Ephemeris AGPL dependencies from client bundle, ensuring clean IP ownership.

Interested in Similar Architectural Rigor?

Whether architecting distributed edge platforms, local-first data persistence, or high-correctness compliance software, discuss your system architecture directly with Harvinder Singh.