Skip to content

aryan225a/Oculus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘οΈ Oculus

License Privacy Self Hosted Built with n8n Google Apps Script Gemini AI ActivityWatch

Local Activity Tracking β†’ Smart Productivity Reports

Oculus is a privacy-first, open-source productivity system that tracks your browsing activity locally, stores it in Google Sheets, and sends you a personalized daily email report with AI-generated insights and analysis.

All data stays under your control:

  • Activity tracking runs locally on your machine
  • Automation runs on your machine via n8n
  • Reports are generated inside your Google account

No external dashboards. No data selling. No cloud surveillance.


πŸ‘€ Who Is This For?

  • Developers who want personal productivity insights
  • Privacy-conscious users
  • People who prefer email over dashboards
  • Anyone already using ActivityWatch

✨ What This Project Does

  • Tracks browsing activity locally using ActivityWatch
  • Automates hourly data collection using n8n
  • Stores activity logs in Google Sheets
  • Generates personalized reports using Google Apps Script + Gemini AI
  • Includes three analysis perspectives:
    • πŸ“Š Executive Assistant: Concise data-driven summary with time allocation
    • πŸ˜„ Funny Friend: Witty, sarcastic observations about your browsing habits
    • 🎯 Productivity Coach: "Deep Work" vs "Distraction" analysis + actionable tips

πŸš€ Quick Start

  1. Read the Setup Guide for complete step-by-step instructions
  2. Install ActivityWatch, n8n, and configure Google Apps Script
  3. Set up your Gemini API key
  4. Create a daily trigger at your preferred time
  5. Start tracking β€” your first report arrives tomorrow!

Estimated setup time: 30-45 minutes


πŸ“‹ Requirements

  • ActivityWatch β€” Free, open-source activity tracker
  • n8n β€” Free, self-hosted automation platform
  • Google Account β€” For Sheets and Apps Script
  • Gemini API Key β€” Free tier available at ai.google.dev
  • Local machine running 24/7 (optional) β€” For continuous tracking

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Your Local Machine                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                     β”‚
β”‚  ActivityWatch (Port 5600)                          β”‚
β”‚  └─ Tracks all browser activity                     β”‚
β”‚                                                     β”‚
β”‚  n8n (Port 5678)                                    β”‚
β”‚  └─ Hourly automation workflow                      β”‚
β”‚     └─ Fetches activity data                        β”‚
β”‚     └─ Sends to Google Sheets                       β”‚
β”‚                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓ (Hourly via n8n (customizable))
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Your Google Account                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                     β”‚
β”‚  Google Sheet                                       β”‚
β”‚  └─ Stores all activity logs                        β”‚
β”‚                                                     β”‚
β”‚  Google Apps Script (Daily @11:55 PM (customizable))β”‚
β”‚  └─ Reads today's data from Sheet                   β”‚
β”‚  └─ Calls Gemini API for analysis                   β”‚
β”‚  └─ Sends personalized email report                 β”‚
β”‚                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Repository Structure

oculus/
β”œβ”€β”€ n8n/
β”‚   └── activitywatch_collector.json    # n8n workflow for data collection
β”‚
β”œβ”€β”€ apps-script/
β”‚   └── daily_report.gs                 # Google Apps Script for email reports
β”‚
β”œβ”€β”€ screenshots/
β”‚   β”œβ”€β”€ email_report.png                # Sample email output
β”‚   β”œβ”€β”€ sheet_data.png                  # Google Sheet with activity logs
β”‚   └── n8n_workflow.png                # n8n automation setup
β”‚
β”œβ”€β”€ SETUP.md                            # Complete setup guide (step-by-step)
β”œβ”€β”€ README.md                           # This file
└── .gitignore                          # Prevents accidental secret commits

🎯 Key Features

Feature Details
Multi-persona Analysis Executive, Coach, and Friend perspectives on your productivity
Real-time Tracking Continuous monitoring via ActivityWatch, hourly sync via n8n
Email Reports Daily summaries with insights and recommendations
Time Tracking Detailed breakdown by site and duration
Pattern Detection Identifies deep work vs distraction patterns
No Server Costs Everything runs locally or on free Google services
Customizable Modify prompts, email templates, and triggers to suit your workflow

Fault-tolerant design:

  • Laptop off β†’ no data collected (expected)
  • Laptop on β†’ collection resumes automatically
  • No duplicate or corrupted reports
  • Skip days with no activity without errors
  • If the AI service is temporarily unavailable, Oculus automatically retries and gracefully falls back without interrupting report delivery.

πŸ”’ Privacy & Security

βœ… All tracking is local β€” Activity data never leaves your machine until you authorize it
βœ… No third-party analytics β€” No Google Analytics, Mixpanel, or similar
βœ… Private Google Sheet β€” Only visible to you
βœ… Secure API key storage β€” Gemini API key stored in Apps Script Properties (encrypted)
βœ… No credentials in repository β€” API keys never committed to git
βœ… Open source β€” Full transparency, auditable code

You own 100% of your data.


πŸ“Έ Screenshots

Screenshots are anonymized and represent a real run of the system.

Daily Email Report

Personalized AI-generated productivity report delivered to your inbox.

Daily Email Report

Activity Data in Google Sheets

Hourly activity logs collected locally and stored securely in your sheet.

Google Sheets Data

n8n Automation Workflow

Local automation that collects ActivityWatch data every hour.

n8n Workflow


πŸ› Troubleshooting

Issue Solution
No data in Google Sheet Verify ActivityWatch is running, n8n workflow is active
Email not received Check Apps Script execution logs, verify Gmail permissions
"API key not set" error Run setGeminiApiKey() in Apps Script editor
n8n workflow fails Check ActivityWatch bucket name, timezone settings
Emoji rendering issues in email Minor visual glitch, doesn't affect functionality

See SETUP.md for detailed troubleshooting.


πŸ”§ Customization

  • Modify analysis prompts in daily_report.gs (line ~65)
  • Change email format by editing the HTML template (line ~140)
  • Adjust trigger time in Apps Script Triggers menu
  • Filter specific sites by editing the n8n workflow
  • Change email recipient in the GmailApp.sendEmail() call

πŸ“œ License

MIT License β€” Free to use, modify, and share.


πŸ™Œ Built With


πŸ’‘ Tips

  • Run n8n 24/7 for continuous tracking (use auto-startup scripts)
  • Review your reports to identify productivity patterns
  • Adjust your daily workflow based on coaching tips
  • Keep your Gemini API key secure β€” treat it like a password
  • Regularly clean up old data in Google Sheets (optional)

🀝 Contributing

Found a bug? Have an improvement idea?

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

All contributions welcome! Check CONTRIBUTION.md for detailed instructions.


Questions? Check SETUP.md for detailed instructions and troubleshooting.

Ready to start? Head to SETUP.md now!

Releases

No releases published

Packages

No packages published