Event-Creator

Gemini Event Creator – Chrome Extension

Turn any text on the web into a Google Calendar event in a couple of clicks.
Highlight → Parse (Gemini) → Create event.

This extension injects a small, glassy popup in the bottom-right of the page (similar to Grammarly). When you highlight something that looks like an event, it offers Quick Create or Edit & Create and talks to Google Calendar through OAuth.


Table of Contents

  1. Overview
  2. Features
  3. Architecture
  4. Prerequisites
  5. Setup & Installation
  6. Google OAuth (Calendar)
  7. How It Works (User Flow)
  8. Build & Load in Chrome
  9. Troubleshooting
  10. Permissions
  11. Future Enhancements
  12. Contributors
  13. Links
  14. License

Overview

Gemini Event Creator is a Chrome extension that:

The goal is to remove the “copy → open Calendar → paste → fix date → save” loop and let you do it inline.


Features


Architecture

Files:


Prerequisites


Setup & Installation

1. Clone & install

git clone https://github.com/<your-org-or-username>/Event-Creator.git
cd Event-Creator
npm install

2. Add your Gemini API key

Create a .env file in the project root:

GEMINI_API_KEY=your_actual_api_key_here

Your vite.config.js should already contain something like:

import { defineConfig, loadEnv } from 'vite';

export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd(), '');
  return {
    build: {
      outDir: 'dist',
      rollupOptions: {
        input: {
          background: 'background.js',
          content: 'content.js',
          auth: 'auth.js',
          popup: 'popup.js'
        }
      },
      define: {
        'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
      }
    }
  };
});

Google OAuth (Calendar)

To actually create a Google Calendar event for the user, you need OAuth. Here’s the minimal flow.

Step-by-step

  1. Create a Google Cloud project
    • Go to Google Cloud Console
    • Click “Select a project” → “New project”
    • Name it e.g. gemini-event-creator
    • Create & select it
  2. Enable Calendar API
    • APIs & Services → Library
    • Search Google Calendar API
    • Click Enable
  3. Configure OAuth consent screen
    • User type: External
    • App name: Gemini Event Creator
    • Add your email
    • Scopes:
      https://www.googleapis.com/auth/calendar.events
    • Test users: Add your Google accounts
    • Save
  4. Create OAuth credentials
    • Type: Chrome extension
    • Add your extension ID from chrome://extensions
    • Get client ID like: 1234567890-abcxyz123.apps.googleusercontent.com
  5. Add to manifest.json
"oauth2": {
  "client_id": "YOUR_CLIENT_ID_HERE.apps.googleusercontent.com",
  "scopes": [
    "https://www.googleapis.com/auth/calendar.events"
  ]
},
"permissions": [
  "identity",
  "storage",
  "activeTab",
  "scripting",
  "tabs"
],
"background": {
  "service_worker": "background.js"
}

How It Works (User Flow)

  1. Highlight a text like:
    “Team sync on Friday at 10am in Walker Hall”
  2. content.js shows the floating card: Quick Create / Edit & Create
  3. Quick Create → Sends message:
chrome.runtime.sendMessage({ action: "analyzeText", text })
  1. Background handles it:
    • Gets OAuth token
    • Optionally calls Gemini (if key present)
    • Creates Calendar event
    • Sends result back (snackbar → “Event created”)
  2. Edit & Create → Sends:
chrome.runtime.sendMessage({ action: "parseTextToEvent", text })

Build & Load in Chrome

npm run build

Load in Chrome

  1. Go to chrome://extensions/
  2. Turn on Developer mode
  3. Click “Load unpacked”
  4. Select dist/ folder

Troubleshooting


Permissions

"permissions": [
  "storage",
  "activeTab",
  "scripting",
  "tabs",
  "identity"
],
"host_permissions": [
  "<all_urls>"
]

Google scope used:
https://www.googleapis.com/auth/calendar.events


Future Enhancements


Contributors

Name Email
Prasannadatta Kawadkar prasannadatta2k23@gmail.com
Devang Borkar devangborkar3@gmail.com
Leeha Rachabattuni lrachabattuni@ucdavis.edu
Hetvi Bhadani hbhadani@ucdavis.edu

GitHub handles (optional):



License

This project is licensed under the terms described in the LICENSE file in this repository.