Snap2GCal lets you turn screenshots and PDFs into Google Calendar events in a few clicks.
- Upload screenshots/PDFs of event flyers, emails, or chat messages.
- Extract event details (title, date, time, location, notes) using your AWS Bedrock-powered Lambda.
- Review and edit the extracted fields in the UI.
- Add to Google Calendar via a one-click “Add to Google Calendar” button.
-
Frontend (
client/)- Vite + React UI
- Google OAuth via
@react-oauth/google - Protected routes:
/signin– Google sign-in page/– main Snap2GCal dashboard (screenshot upload + event details)
- Calls your Lambda via
VITE_API_URL:POST /upload-url– get S3 presigned URLPOST /ingest– ingest PDF into the RAG indexPOST /query-calendar– extract calendar event fields
-
Backend (
lambda_handler.py)- AWS Lambda (container image) + Nova 2 Lite for image detail extraction
- Ingests PDFs from S3, chunks + embeds them into a FAISS index stored back in S3.
- Handles
/ingest,/query, and/query-calendarroutes for RAG and event extraction.
-
Local Google Calendar helper (
client/google_api_calendar.py)- CLI helper for creating events via the Google Calendar API using OAuth credentials (
client-secret.json/token.json). - Not used by the web UI directly; the UI uses the “Add to Google Calendar” URL flow instead.
- CLI helper for creating events via the Google Calendar API using OAuth credentials (
- Node.js 18+ and npm
- Python 3.10+ (for Lambda/dev tooling)
- An AWS account with:
- S3 bucket for RAG artifacts and uploads
- Bedrock access (embedding + generation models)
- A Google Cloud project with:
- OAuth 2.0 Web client for the frontend (client ID only)
- Authorized JavaScript origin:
http://localhost:5173(for local dev)
-
Install dependencies:
cd client npm install -
Configure environment:
cp .env.example .env
Fill in:
VITE_API_URL=https://<your-lambda-or-apigw-url>
-
Start the dev server:
npm run dev
Open
http://localhost:5173.
- Build and push your Lambda container image (contains
lambda_handler.pyand dependencies). - Configure environment variables on the function:
RAG_BUCKET– S3 bucket nameINDEX_PREFIX– optional prefix (defaultindex/)EMBED_MODEL_ID,GEN_MODEL_ID– Bedrock model IDs- Any other tuning variables (
TOP_K,CHUNK_SIZE, etc.).
- Expose the Lambda via Function URL or API Gateway and use that URL as
VITE_API_URL.
- The frontend uses
GoogleOAuthProviderandGoogleLoginfrom@react-oauth/google. - The client ID must match your Google Cloud Web OAuth client.
- User information is stored in
sessionStorageand used only for gating the protected routes and personalizing the UI.
-
The “Add to Google Calendar” button builds a URL like:
https://calendar.google.com/calendar/render?action=TEMPLATE&text=...&dates=...&location=...&details=... -
Google opens the user’s calendar with the fields pre-filled; they can review and save the event.
From client/:
python google_api_calendar.pyThis script uses client-secret.json and token.json to talk directly to the Google Calendar API for testing and debugging; it is not required for the main web flow.