SYS.ID: THEORIONGD
INNOVATE. BUILD. IMPACT.
BACK TO MASTER CATALOG
SPEC-ID: CHRONICLE-ARCHIVE-VAULTDOM: [CLIENT-SIDE TOOLS & UTILITIES]DEPLOYED

Chronicle Archive Vault

Client-Offline Scheduler & Task Manager with Custom Service Worker PWA Installation.

TECHNICAL SPECIFICATION SHEETREVISION: 2025
SYSTEM NAME:Chronicle Archive Vault
VERIFIED MATURITY:DEPLOYED
DEPLOYMENT CLASSIFICATION:PRODUCTION (Vercel)
DEVELOPMENT YEAR:2025
DOMAIN CATEGORY:Client-Side Tools & Utilities
COLLABORATORS:arjunestudios-sys
SYSTEM PERFORMANCE PARAMETERS:
Storage Mechanism:Isolated Client LocalStorage
Offline Mode:Custom Compiled PWA Service Worker
TECH STACK:React 19TypeScriptViteTailwind CSS v4PWA Service WorkerLocalStorage
SYSTEM ARCHITECTURE & TECHNICAL OVERVIEW

ARCHITECTURAL SPECIFICATION

Privacy-focused personal planner operating 100% in browser memory and LocalStorage. Features custom PWA Service Worker offline caching, Pomodoro focus mode, multi-locale translations, and touch horizontal grids.

ORIGINAL REPOSITORY DOCUMENTATION (README)
README DOCUMENT

πŸ›οΈ Chronicle Archive Vault

 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β•šβ•β•β–ˆβ–ˆβ•”β•β•β•
β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—    β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   
β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•    β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   
β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   
 β•šβ•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•    β•šβ•β•β•β•  β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β•   

A premium client-offline database vault for calendar schedules, tasks, Pomodoro focus blocks, productivity trends, and notes.


Licence: Apache 2.0 React Version TypeScript Version Vite Version Tailwind CSS Version Service Worker PWA Status Supported Languages


πŸ“– Developer Story

Why We Built It

In the modern landscape of software development, user data is increasingly treated as a telemetry commodity. Everyday productivity utilitiesβ€”planners, note-taking apps, and calendarsβ€”silently sync local inputs to remote cloud databases. This architecture introduces latency, exposes personal data to network breaches, and compromises user privacy.

We built Chronicle Archive Vault as an alternative to this telemetry-heavy model. Our primary goal was to engineering a zero-telemetry, offline-first digital scheduler where the user retains 100% control of their database. By utilizing browser isolation scopes, Chronicle runs completely sandbox-contained, eliminating server latency and data transmission risks.

Who We Are

Chronicle is designed and engineered by Arjun and Godfrey. We are developer advocates who believe that high-performance web applications should prioritize both local-first architecture and rich, premium aesthetics. Together, we crafted Chronicle to combine high responsiveness with structural simplicity.

Challenges Faced

  1. Dynamic Sandbox Synchronization: Designing an offline multi-profile system required storing data across different namespaces. Managing local reactive states that seamlessly update localStorage paths upon calendar edits without creating infinite render loops was a key challenge.
  2. PWA Mobile Compatibility: Designing the app for mobile browser installation required conforming to strict Progressive Web App criteria. We resolved this by building a custom Service Worker from scratch, compiling standard web app manifests, and ensuring responsive touch targets.
  3. Multi-Locale Translation Grids: Chronicle supports six different languages. Building the localized JSON matrix in TypeScript and ensuring layout items adjusted dynamically without breaking grid cells was a significant design challenge.

How We Built It

We structured Chronicle with a React 19 and TypeScript core, utilizing Vite for fast, hot-reloading compilation. We avoided heavy backend abstractions, choosing instead to handle data mutations purely in-memory via React context wrappers. For styling, we utilized Tailwind CSS v4 to map theme colors dynamically to CSS custom properties. Micro-animations are managed by Motion, and vector icons are rendered via Lucide React.

Security & UX

Chronicle isolates data by storing it strictly within the client's browser sandbox. The application has no external fetch APIs, no telemetry hooks, and zero network calls. Security is maintained by data isolation. From a UX standpoint, we prioritized glassmorphism, horizontal touch grids, and interactive modal dialogs to provide a premium feel on mobile and desktop viewports.

Key Learnings

  • SVG Portability: We learned that using inline vector SVG assets for favicons is highly reliable. It eliminates external HTTP file requests and scales dynamically.
  • Client-Side Processing is Powerful: Modern client-side engines can handle complex data indexing, streak calculations, and search matching instantly without needing a server.
  • CSS Custom Properties: Binding CSS variables directly to theme states enables seamless color switching without compiling new utility files.

Future Roadmap

  • Encrypted Local Exports: Implementing local encryption (AES-256) for JSON database backups.
  • Biometric Lock Integrations: Adding face/touch ID validation options via WebAuthn APIs for local browser authentication.
  • Custom ICS Syncing: Developing a local parser to import and export .ics files without network connections.

πŸ’Œ Developer Message

"Curiosity is the engine of progress. We built Chronicle because we wanted a calendar that belongs to usβ€”fully offline, fully local, and beautifully responsive. We hope this tool provides a private, telemetry-free workspace to organize your days and thoughts. Thank you for using Chronicle!"

β€” Arjun | Godfrey


πŸ—‚οΈ Table of Contents

  1. Developer Story
  2. Project Specifications
  3. Architecture & Workflow
  4. Directory Structure
  5. Feature Matrix
  6. Data Schema & Storage Mechanics
  7. PWA & Offline Registration
  8. Installation & Deployment
  9. Component Walkthrough
  10. Configuration & Environment
  11. Troubleshooting & Diagnostics
  12. Security & Sandbox Isolation
  13. Testing Documentation
  14. Frequently Asked Questions (FAQ)
  15. Contributors & License

πŸ› οΈ Project Specifications

SpecificationDetails
Project NameChronicle Archive Vault
Project TypeClient-Offline Progressive Web Application (PWA)
Industry DomainPersonal Productivity & Personal Information Management (PIM)
Target AudiencePrivacy-focused professionals, developers, and offline-first advocates
Primary PurposeIsolated client-side scheduler, timer logs, and notes vaulting
Runtime EnvironmentWeb Browser (Chromium, WebKit, Gecko engines)

Core Technology Stack


πŸ“ Architecture & Workflow

Overall Sandbox System Architecture

The application runs entirely within the browser's context. A single React root renders the application, which is wrapped by a ProfileProvider context. The context acts as the local transaction processor, managing in-memory states and writing directly to the browser's localStorage sandbox.

LANG: mermaid
graph TD
    User([User Interaction]) <--> UI[React UI Components]
    UI <--> Context[ProfileContext State Engine]
    Context <--> Storage[(Browser LocalStorage Sandbox)]
    
    subgraph Browser Context
        Context
        Storage
    end
    
    subgraph Offline Service Worker
        SW[sw.js Caching Handler] <--> Cache[(Cache Storage API)]
    end
    
    UI <--> SW

App State Lifecycle & Multi-Profile Sandboxing

When a user launches Chronicle, the system initializes by executing the profile checks outlined in the sequence diagram below. If no profile registry key is discovered, the onboarding UI mounts, forcing the creation of a new database workspace.

LANG: mermaid
sequenceDiagram
    autonumber
    actor User as User Browser
    participant App as App.tsx
    participant Context as ProfileContext.tsx
    participant Store as Browser LocalStorage
    
    User->>App: Load Application page
    App->>Context: Request Active Profile State
    Context->>Store: Get 'calendar_profiles_registry'
    
    alt Registry is Empty (First Load)
        Store-->>Context: Return Empty Array
        Context-->>App: Mount Onboarding View
        User->>App: Enter Profile Name, Avatar & Color Accent
        App->>Context: Call createProfile()
        Context->>Store: Write Profile Data & Create initial log
        Context->>Store: Create 'calendar_items_profile_[UUID]'
        Context-->>App: Set activeProfileId
    else Profiles Exist
        Store-->>Context: Return Profile Registry Array
        Context->>Store: Get 'calendar_active_profile_id'
        Store-->>Context: Return UUID
        Context->>Store: Load profile items, archives, and logs
        Store-->>Context: Return profile datasets
        Context-->>App: Initialize Workspace View
    end
    
    App-->>User: Render Main Interface

Pomodoro Focus Timer Logging Sequence

The Focus Mode page features an interactive Pomodoro timer. The diagram below illustrates how users log completed focus sessions directly to the active calendar date.

LANG: mermaid
sequenceDiagram
    autonumber
    actor User as Active User
    participant FocusView as FocusView.tsx
    participant Context as ProfileContext.tsx
    participant Store as LocalStorage Sandbox
    
    User->>FocusView: Start focus session timer
    Note over FocusView: Timer ticks down to 0:00 (or user pauses/stops)
    User->>FocusView: Click "Log Session"
    FocusView->>Context: Call addItem(type: 'note', title: 'Focus Session')
    Context->>Context: Generate unique item UUID
    Context->>Store: Write updated items stream to localStorage
    Context->>Context: Call logActivity('Added note: Focus Session')
    Context->>Store: Write updated activity log stream to localStorage
    Context-->>FocusView: Confirm Logging Action
    FocusView-->>User: Display 'Session Logged' checkmark

πŸ“‚ Directory Structure

Below is the directory layout of Chronicle Vault, illustrating the modular code organization.

Calender/
β”œβ”€β”€ .git/                      # Version control database
β”œβ”€β”€ node_modules/              # Project dependencies
β”œβ”€β”€ public/                    # Static Assets (served at root)
β”‚   β”œβ”€β”€ favicon.svg            # Standalone vector icon file
β”‚   β”œβ”€β”€ manifest.json          # Web App Manifest configuration
β”‚   └── sw.js                  # Service Worker caching handler
β”œβ”€β”€ src/                       # Source files
β”‚   β”œβ”€β”€ assets/                # Local styling vectors
β”‚   β”œβ”€β”€ components/            # UI components and page views
β”‚   β”‚   β”œβ”€β”€ ActivityLogsView.tsx # Chronological log viewer
β”‚   β”‚   β”œβ”€β”€ ArchiveView.tsx      # Trash bin and recovery view
β”‚   β”‚   β”œβ”€β”€ CalendarView.tsx     # Calendar view and stopwatch log widget
β”‚   β”‚   β”œβ”€β”€ DashboardView.tsx    # High-level calendar dashboard
β”‚   β”‚   β”œβ”€β”€ FloatingDock.tsx     # Navigation dock
β”‚   β”‚   β”œβ”€β”€ FocusView.tsx        # Pomodoro timer and scratchpad view
β”‚   β”‚   β”œβ”€β”€ HelpView.tsx         # Help guide and FAQ panels
β”‚   β”‚   β”œβ”€β”€ ItemForm.tsx         # Note, task, and reminder input form
β”‚   β”‚   β”œβ”€β”€ ItemList.tsx         # List viewer and search matches stream
β”‚   β”‚   β”œβ”€β”€ LandingView.tsx      # Welcome screen, story, and tech stack
β”‚   β”‚   β”œβ”€β”€ ProfilesView.tsx     # Switcher, creation, and JSON backup tool
β”‚   β”‚   └── SettingsView.tsx     # App settings and PWA install buttons
β”‚   β”œβ”€β”€ context/               # React contexts
β”‚   β”‚   └── ProfileContext.tsx   # State engine, registry, and data syncing
β”‚   β”œβ”€β”€ data/                  # Mock and sample database arrays
β”‚   β”‚   └── initialData.ts       # Default calendar samples
β”‚   β”œβ”€β”€ utils/                 # Utility helpers
β”‚   β”‚   β”œβ”€β”€ dateUtils.ts         # Calendar grid matrix calculators
β”‚   β”‚   └── i18n.ts              # Six-locale translation dictionary
β”‚   β”œβ”€β”€ App.tsx                # Master coordinator and onboarding view
β”‚   β”œβ”€β”€ index.css              # Styling configurations
β”‚   β”œβ”€β”€ main.tsx               # Render mount point
β”‚   └── types.ts               # Shared TypeScript schemas
β”œβ”€β”€ index.html                 # Index page structure
β”œβ”€β”€ LICENSE                    # Apache 2.0 license file
β”œβ”€β”€ package.json               # Package configurations
β”œβ”€β”€ tsconfig.json              # TypeScript compilation rules
└── vite.config.ts             # Vite server and compiler configurations

πŸ“‹ Feature Matrix

Chronicle is organized into 10 distinct pages, managed by the Floating Dock navigation system:

ViewPrimary PurposeKey Interactive Elements
LandingWelcome pageShows the active profile, developer story, tech stack details, and entry triggers.
DashboardMetrics overviewDisplays task completion progress gauges, upcoming lists, and search queries.
CalendarVisual schedule gridToggles month, week, day, and list grids; includes stopwatch logging.
TrendsProductivity trendsTracks streaks (consecutive days of completed tasks), ratios, and weekday performance.
Focus ModePomodoro timerTicks down customizable work blocks; includes a quick notepad and session logging.
ArchiveTrash recovery binSafe bin for deleted calendar items, offering individual restores or permanent purging.
HistoryActivity logs timelineDisplays chronological timeline logs of database modifications.
ProfilesAccount managementSwitches profiles, registers profiles, and imports/exports JSON data backups.
SettingsPreferences configurationConfigures theme accents, language settings, clock types (12h/24h), and first day of week.
Help GuideFAQs and guideEditorial FAQs explaining local sandboxing, storage safety, and project credits.

πŸ’Ύ Data Schema & Storage Mechanics

Sandbox Isolation Strategy

The workspace partitions database records by prefixing localStorage keys with the active profile's UUID (profileId). This design isolates data and prevents cross-profile database contamination.

The keys managed by Chronicle include:

  • calendar_profiles_registry: A global index containing profile details (UUID, name, avatar, and settings configuration).
  • calendar_active_profile_id: Stored identifier of the currently active profile UUID.
  • calendar_items_profile_${profileId}: Array of active tasks, notes, and reminders for the specified profile.
  • calendar_archived_profile_${profileId}: Array of archived/deleted items for the specified profile.
  • calendar_logs_profile_${profileId}: Chronological array of audit logs for the specified profile.

Calendar Item Schema (types.ts)

Each schedule item conforms to the strict CalendarItem interface:

LANG: typescript
export interface CalendarItem {
  id: string;               // Unique database key (UUID)
  title: string;            // User input title
  description?: string;     // Additional notes/details
  date: string;             // Legacy date fallback reference
  dateStr: string;          // Formatted date string (YYYY-MM-DD)
  time?: string;            // Formatted schedule time (HH:MM)
  completed: boolean;       // Task completion boolean
  type: 'task' | 'note' | 'reminder'; // Category type
  tag?: 'slate' | 'indigo' | 'emerald' | 'rose' | 'amber' | 'violet' | 'ocean' | 'terracotta'; // Color tag
  createdAt: number;        // Epoch creation timestamp (milliseconds)
}

Audit Log Schema (ProfileContext.tsx)

Audit logs track profile events and user actions using this layout:

LANG: typescript
export interface ActivityLog {
  id: string;               // Unique log entry key
  timestamp: number;        // Event timestamp (milliseconds)
  action: string;           // Detailed description of the action
}

🌐 PWA & Offline Registration

To provide a native, standalone experience, Chronicle is built as a Progressive Web App (PWA) that complies with standard lighthouse specifications.

1. The Web App Manifest (public/manifest.json)

The manifest configures the app's standalone appearance and provides high-definition launcher icons:

LANG: json
{
  "short_name": "Chronicle",
  "name": "Chronicle Archive Vault",
  "description": "A premium client-offline calendar, tasks, & notes database.",
  "icons": [
    {
      "src": "favicon.svg",
      "type": "image/svg+xml",
      "sizes": "any",
      "purpose": "any"
    },
    {
      "src": "favicon.svg",
      "type": "image/svg+xml",
      "sizes": "192x192",
      "purpose": "any"
    },
    {
      "src": "favicon.svg",
      "type": "image/svg+xml",
      "sizes": "512x512",
      "purpose": "any"
    }
  ],
  "start_url": "/",
  "background_color": "#ffffff",
  "theme_color": "#4f46e5",
  "display": "standalone",
  "orientation": "portrait"
}

2. The Service Worker (public/sw.js)

The custom service worker caches core assets at registration and intercepts fetch requests to ensure offline availability:

LANG: javascript
const CACHE_NAME = 'chronicle-cache-v1';
const ASSETS = [
  '/',
  '/index.html',
  '/manifest.json',
  '/favicon.svg'
];

self.addEventListener('install', (e) => {
  e.waitUntil(
    caches.open(CACHE_NAME).then((cache) => {
      return cache.addAll(ASSETS);
    })
  );
  self.skipWaiting();
});

self.addEventListener('activate', (e) => {
  e.waitUntil(
    caches.keys().then((keys) => {
      return Promise.all(
        keys.map((key) => {
          if (key !== CACHE_NAME) {
            return caches.delete(key);
          }
        })
      );
    })
  );
  self.clients.claim();
});

self.addEventListener('fetch', (e) => {
  e.respondWith(
    caches.match(e.request).then((cachedResponse) => {
      if (cachedResponse) {
        return cachedResponse;
      }
      return fetch(e.request).then((networkResponse) => {
        if (networkResponse && networkResponse.status === 200 && e.request.method === 'GET') {
          const responseToCache = networkResponse.clone();
          caches.open(CACHE_NAME).then((cache) => {
            cache.put(e.request, responseToCache);
          });
        }
        return networkResponse;
      });
    })
  );
});

πŸš€ Installation & Deployment

Follow these steps to run the development environment or compile the production bundle.

Prerequisites

  • Node.js (v18.0.0 or higher recommended)
  • npm (or similar package manager)

1. Clone the Repository

LANG: bash
git clone https://github.com/TheOrionGD/Calender.git
cd Calender

2. Install Project Dependencies

LANG: bash
npm install

3. Start the Local Development Server

LANG: bash
npm run dev

The server will start, exposing the application on http://localhost:3000.

4. Build for Production

To compile and bundle the codebase for static hosting:

LANG: bash
npm run build

This output is saved to the dist/ directory, which can be deployed to static hosts like Netlify, Vercel, or GitHub Pages.

5. Preview the Production Build Locally

LANG: bash
npm run preview

🧩 Component Walkthrough

1. State Engine (src/context/ProfileContext.tsx)

This context wraps the application state and manages multi-profile sandboxing:

LANG: typescript
// Example of multi-profile load orchestration hook inside context
useEffect(() => {
  if (!isLoaded) return;
  if (!activeProfileId) {
    setItems([]);
    setArchivedItems([]);
    setActivityLogs([]);
    return;
  }

  const itemsKey = `calendar_items_profile_${activeProfileId}`;
  const archivedKey = `calendar_archived_profile_${activeProfileId}`;
  const logsKey = `calendar_logs_profile_${activeProfileId}`;

  // Read item states
  try {
    const storedItems = localStorage.getItem(itemsKey);
    setItems(storedItems ? JSON.parse(storedItems) : []);
  } catch (e) {
    console.error("Failed to parse local profile items", e);
  }
  
  // Read archive states
  try {
    const storedArchived = localStorage.getItem(archivedKey);
    setArchivedItems(storedArchived ? JSON.parse(storedArchived) : []);
  } catch (e) {
    console.error("Failed to parse local profile archives", e);
  }

  // Read log states
  try {
    const storedLogs = localStorage.getItem(logsKey);
    setActivityLogs(storedLogs ? JSON.parse(storedLogs) : []);
  } catch (e) {
    console.error("Failed to parse local profile logs", e);
  }
}, [activeProfileId, isLoaded]);

2. Settings PWA Installer Widget (src/components/SettingsView.tsx)

The settings panel features an active app checker and install initiator button:

LANG: typescript
const [deferredPrompt, setDeferredPrompt] = useState<any>(null);
const [isInstallable, setIsInstallable] = useState(false);
const [isStandalone, setIsStandalone] = useState(false);
const [showPwaInstructions, setShowPwaInstructions] = useState(false);

useEffect(() => {
  // Check if app is already running in standalone mode
  if (window.matchMedia('(display-mode: standalone)').matches || (window.navigator as any).standalone) {
    setIsStandalone(true);
  }

  const handleBeforeInstall = (e: Event) => {
    e.preventDefault();
    setDeferredPrompt(e);
    setIsInstallable(true);
  };

  window.addEventListener('beforeinstallprompt', handleBeforeInstall);
  return () => window.removeEventListener('beforeinstallprompt', handleBeforeInstall);
}, []);

const handleInstallApp = async () => {
  if (deferredPrompt) {
    deferredPrompt.prompt();
    const { outcome } = await deferredPrompt.userChoice;
    if (outcome === 'accepted') {
      setIsInstallable(false);
      setDeferredPrompt(null);
    }
  } else {
    // Launch mobile installation guide modal
    setShowPwaInstructions(true);
  }
};

βš™οΈ Configuration & Environment

Vite serves files from the public directory at the root (/).

Vite Port Configuration (package.json)

The dev script exposes the local server across all network interfaces so it can be previewed on mobile devices:

LANG: json
"scripts": {
  "dev": "vite --port=3000 --host=0.0.0.0",
  "build": "vite build",
  "preview": "vite preview",
  "lint": "tsc --noEmit"
}

Dynamic Accent Styling (src/context/ProfileContext.tsx)

Chronicle sets styling accents dynamically by mapping active profiles to custom CSS properties:

LANG: typescript
useEffect(() => {
  if (!isLoaded) return;
  const active = profiles.find(p => p.id === activeProfileId);
  const colorTheme = active ? active.accentColor : 'indigo';
  const accentData = ACCENTS[colorTheme] || ACCENTS.indigo;
  
  // Set properties on document root
  const root = document.documentElement;
  root.style.setProperty('--color-accent-val', accentData.primary);
  root.style.setProperty('--color-accent-hover-val', accentData.hover);
  root.style.setProperty('--color-accent-muted-val', accentData.muted);
  root.style.setProperty('--color-accent-light-val', accentData.light);
}, [activeProfileId, profiles, isLoaded]);

πŸ” Troubleshooting & Diagnostics

Below are steps to resolve common local development issues.

1. The PWA "Install Application" Button Only Opens Instructions

  • Reason: The browser has not fired the beforeinstallprompt event yet.
  • Diagnostics:
    • PWA installation requires the app to be served over localhost or a secure https:// connection.
    • Verify that the Service Worker is registered successfully in Chrome Developer Tools (Application -> Service Workers).
    • Clear site data and refresh to retrigger registration.

2. Changes in index.css Do Not Rebuild

  • Reason: Vite utilizes HMR (Hot Module Replacement) but might fail to hot-swap style changes if there are CSS syntax errors.
  • Diagnostics:
    • Run the linter compiler to verify types: npm run lint.
    • Restart the development command: npm run dev.

3. Backup JSON File Fails to Import

  • Reason: The backup JSON schema does not conform to the expected format.
  • Diagnostics:
    • Export a sample database file to examine the structure.
    • Verify that the UUIDs and schema layout match the specifications.

πŸ”’ Security & Sandbox Isolation

Chronicle is built to prioritize user privacy and data security.

  1. No External Network Requests: The application features no fetch calls, analytics tracking, or telemetry scripts.
  2. LocalStorage Sandboxing: All inputs are sandboxed to the active profile inside the client's browser local storage.
  3. PWA Standalone Shell: Running Chronicle in standalone mode encapsulates the browser context, protecting it from cross-site scripting (XSS) risks.
  4. Offline Resilience: The service worker caching is structured strictly for static assets. Your calendar database is never cached in public caching stores, remaining protected inside standard local storage blocks.

πŸ§ͺ Testing Documentation

Static typing and build processes are tested before commits.

Static TypeScript Validation

LANG: bash
npm run lint

Result: Evaluates all typings and files for compiler errors.

Production Bundling Test

LANG: bash
npm run build

Result: Builds static files into /dist to verify bundling succeeds.


πŸ’¬ Frequently Asked Questions (FAQ)

Q1: Where is my database stored?

Your database is stored entirely inside your browser's local storage. None of your data is ever uploaded to a server.

Q2: How do I transfer my data to a new device?

Go to the Profiles tab, click Export All Data (JSON) to download your database file, and then import it on your new device.

Q3: What happens if I clear my browser cookies or history?

Clearing site storage will reset your local storage databases. We recommend regular JSON database exports to protect your data.

Q4: Does the stopwatch log timed sessions directly?

Yes! Swapping to the stopwatch and clicking save will log the session's duration as a Task or Note on the active calendar date.


πŸ‘₯ Contributors & License

  • Arjun β€” Core developer, UX designer, and i18n localization coordinator.
  • Godfrey β€” Systems architecture design, PWA setup, and state synchronization.

License

This project is licensed under the Apache License, Version 2.0 (SPDX-License-Identifier: Apache-2.0). See the LICENSE file for details.


Created with curiosity by Arjun | Godfrey.