← Back to App

🏹 Project Arjuna — Help & Guide

1 Getting Started

Project Arjuna is a personal productivity dashboard built for UPSC preparation (2026–2028). It tracks your daily routine, study progress, finances, health, mind, growth, and tasks — all in one place.

Two operating modes

🌐 Cloud Mode (recommended)

Sign in with Google. Your data syncs automatically across all browsers and devices via Firebase Firestore. All changes on any device appear on every other device within seconds.

📴 Local-Only Mode

No sign-in required. Data is stored only in your browser's IndexedDB + localStorage. You'll see a 📴 Local badge in the header. Data is not synced across devices. Use the Backup feature to manually transfer data.

First launch

  1. Open the app — it loads instantly from local storage (no network needed).
  2. If Firebase is configured, a Google sign-in overlay will appear.
  3. Click Sign in with Google and complete the auth flow.
  4. The app merges any local data with your cloud data automatically.

2 Firebase & Sync Setup

This is a one-time setup. Once done, sync is fully automatic — no further action required.

Step-by-step: Create a Firebase project

1
Go to console.firebase.google.com and click Add project. Give it a name (e.g. "project-arjuna"). Disable Google Analytics if you don't need it.
2
Enable Google Sign-In: In the left sidebar go to Build → Authentication → Sign-in method. Click Google, toggle it Enabled, add your support email, and click Save.
3
Authorise your domain: Still in Authentication, click the Settings tab → Authorised domains. Add your GitHub Pages domain, e.g. abhay-bhat.github.io. Also add localhost for local testing.
4
Create a Firestore database: Go to Build → Firestore Database → Create database. Choose Start in production mode (we'll set proper rules next). Pick a region close to you (e.g. asia-south1 for India).
5
Apply security rules: In Firestore, click the Rules tab. Replace the default rules with the rules below and click Publish.

Firestore Security Rules (copy-paste exactly)

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    // Master state document — all devices read/write here
    match /users/{userId}/data/state {
      allow read, write: if request.auth != null
                         && request.auth.uid == userId;
    }

    // Device presence documents — one per device, records last-seen time
    match /users/{userId}/devices/{deviceId} {
      allow read, write: if request.auth != null
                         && request.auth.uid == userId;
    }

    // Per-device state backups — isolated copy, never overwritten by other devices
    match /users/{userId}/deviceStates/{deviceId} {
      allow read, write: if request.auth != null
                         && request.auth.uid == userId;
    }

  }
}
6
Get your Firebase config: Go to Project Settings (gear icon) → General → scroll to Your apps. If no web app exists, click the </> icon to add one (no need to set up Firebase Hosting). Copy the firebaseConfig object shown.

Configure the app

Create (or edit) js/firebase-config.js in your repository with this content:

// js/firebase-config.js
// Replace ALL values below with your actual Firebase project values.
const FIREBASE_CONFIG = {
  apiKey:            "YOUR_API_KEY",
  authDomain:        "YOUR_PROJECT_ID.firebaseapp.com",
  projectId:         "YOUR_PROJECT_ID",
  storageBucket:     "YOUR_PROJECT_ID.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId:             "YOUR_APP_ID"
};
Never commit your real firebase-config.js to a public repository. Add it to .gitignore or use GitHub Actions secrets to inject it at deploy time.

After saving and deploying, refresh the app. The sign-in overlay will appear and sync will be fully enabled.

3 Dashboard Tabs Overview

🏠

Today

Daily routine checklist, calendar, UPSC current affairs log, and quick check-ins for health and mind.

📚

UPSC

Subject-wise syllabus progress tracker, study schedule, and phase milestone overview.

💰

Finance

Dubai savings tracker, investment portfolio with maturity projections, monthly expense log, and financial checklist.

❤️

Health

Sleep, gym, and screen-time log with charts. Cholesterol tracker and health history.

🧠

Mind

NoFap streak tracker, meditation log, loneliness rating, and partner connection log.

🌱

Growth

Career milestones, book reading tracker, weekly & monthly review journal.

Tasks

Kanban-style task planner with buckets (categories), priorities, due dates, and completion tracking.

4 Cross-Device Sync Guide

How automatic sync works

  1. On load: The app reads Firestore once and merges cloud data with local data.
  2. On every save: Any change (checking a task, logging data) is pushed to Firestore within ~800 ms.
  3. Real-time listener: The app watches Firestore for changes from other devices and applies them instantly (echo-guarded — it ignores its own writes).
  4. Cross-tab sync: Tabs in the same browser sync via BroadcastChannel — no Firestore round-trip needed.

Manual sync

Open the header menu (☰) → click Sync Now. The button shows ⟳ while syncing and ✓ when done. The status row below it shows the last sync time.

Merge strategy (data is never deleted)

Checking sync status (developer console)

Open browser DevTools (F12) → Console tab and run:

ATHENA.syncDiag()

The table shows: enabled (must be true), isAuthenticated, pendingPush, listenerActive, etc.

If data is missing on a device, run:

ATHENA.forcePull()

This bypasses all guards and directly applies the latest Firestore state.

5 Backup & Restore Guide

Auto-backups

The app creates backups automatically at three points:

Backups are stored in IndexedDB inside your browser. They are local — not synced to Firestore.

Accessing backups

  1. Click the ☰ menu in the header.
  2. Click 💾 Backups.
  3. A modal lists all saved backups with their timestamp and type.
  4. Click Restore next to any backup to apply it. The app will reload with that state.

Manual backup via console

// Create a backup right now
ATHENA.backup()

// List all backups (shows in console as a table)
ATHENA.listBackups()

// Restore a specific backup by key
ATHENA.restoreBackup('backup_key_here')
After restoring a backup, the app pushes the restored state to Firestore so all other devices catch up automatically.

Exporting data

Open DevTools Console and run:

JSON.stringify(AppState._buildPayload())

Copy the output and save it as a .json file. This is your full data export.

6 Troubleshooting

SymptomLikely cause & fix
📴 Local badge in header Firebase is not configured. Check that js/firebase-config.js exists and has real values (not YOUR_API_KEY). See Section 2.
Sign-in overlay always appears Your domain is not in Firebase Authorised Domains. Go to Firebase Console → Authentication → Settings → Authorised domains and add your site URL.
Sync enabled in console but data not appearing on Device B Run ATHENA.forcePull() on Device B. If that fails, check Firestore rules in the Firebase console match Section 2 exactly.
enabled: false in ATHENA.syncDiag() Firestore SDK failed to initialize. Check the browser console for the actual error. Common cause: incorrect API key or Firestore not created in Firebase project.
Data missing after restore Select an earlier backup from the Backups modal. Backups are kept for multiple checkpoints — go further back in time.
Sync icon shows error (!) in menu Network issue or Firestore rules too restrictive. Check your internet connection, then verify rules in Firebase Console match Section 2.
Quote strip shows same quote every day The daily quote is cached in localStorage. To refresh: open DevTools Console and run localStorage.removeItem('athena_quote'); location.reload();
App shows blank / white screen JavaScript error during boot. Open DevTools Console, look for the red error, and check if all script files are loading (Network tab). Try a hard reload: Ctrl+Shift+R.
Tasks / data reset to empty Accidental clearState() or restore. Immediately run ATHENA.listBackups() and restore the most recent pre-sync backup.

7 Manual Actions You May Need to Take

These are one-time actions in external consoles — not in the app itself.

A. Apply Firestore security rules

Every time the security rules in Section 2 change, you must re-publish them in Firebase Console → Firestore → Rules. The app cannot do this automatically.

B. Add your domain to Authorised Domains

When you deploy to a new URL (e.g. custom domain, new GitHub Pages URL), you must add it in Firebase Console → Authentication → Settings → Authorised domains.

C. Inject Firebase config at deploy time (GitHub Actions)

If you don't want to commit your real config, use GitHub Actions secrets:

  1. Go to your GitHub repo → Settings → Secrets and variables → Actions.
  2. Add secrets: FIREBASE_API_KEY, FIREBASE_PROJECT_ID, etc.
  3. In your workflow YAML, add a step before deploy:
- name: Write Firebase config
  run: |
    cat > js/firebase-config.js <<EOF
    const FIREBASE_CONFIG = {
      apiKey: "${{ secrets.FIREBASE_API_KEY }}",
      authDomain: "${{ secrets.FIREBASE_PROJECT_ID }}.firebaseapp.com",
      projectId: "${{ secrets.FIREBASE_PROJECT_ID }}",
      storageBucket: "${{ secrets.FIREBASE_PROJECT_ID }}.appspot.com",
      messagingSenderId: "${{ secrets.FIREBASE_SENDER_ID }}",
      appId: "${{ secrets.FIREBASE_APP_ID }}"
    };
    EOF

D. Clear stale local data (reset)

If the app is stuck in a bad state, open DevTools Console and run:

ATHENA.clearState()   // wipes localStorage and reloads (data still in Firestore)
This clears local state permanently. Your cloud data in Firestore is unaffected — sign back in to re-sync.

E. Force a full re-sync from Firestore

ATHENA.forcePull()   // pulls latest Firestore state, applies, and re-renders

F. Check sync diagnostics

ATHENA.syncDiag()    // prints a table of all sync state variables to console

Project Arjuna • Master Your Path • 2026–2028