Skip to content

sanjayriram44/glimpse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Glimpse

Glimpse (prev. OneLook) is an intelligent SaaS platform designed to declutter your inbox by transforming individual newsletter subscriptions into a single, comprehensive daily digest. By leveraging Google Gemini 3, Glimpse reduces complex emails into concise summaries, allowing users to stay informed while saving time.

Usage

Link to the web app: https://glimpse-digest.vercel.app/

  1. Sign Up/Login: Access the frontend and log in. (Restricted right now since app isn't published through Google)
  2. Connect Gmail: Use the Google OAuth flow to login.
  3. Dashboard: View your daily digests (generated by Google Gemini 3) and sorted newsletters.
  4. Audio Experience: Click the "Play" button on your digest to generate and listen to an audio summary (powered by ElevenLabs / Gemini 1.5 TTS).
  5. Email Notifications: Check your inbox daily (maybe in spam / junk folder !!) for a summary of your subscriptions.

Since the login is restricted right now, you can use the demo button to view the experience on a pre logged in account.

Features

Core Experience

  • Automated Ingestion: Seamlessly integrates with Gmail to identify and collect newsletter emails.
  • Intelligent Summarization: Utilizes Google Gemini 3 (with custom thinking levels) to generate high-quality, concise summaries of long-form content.
  • Daily Digest: Aggregates all processed newsletters into a single, easy-to-read daily report.
  • Analytics & Tracking: Monitors token usage, model performance, and ingestion metrics.

Advanced Capabilities

  • Audio Digests: Listen to your newsletters on the go. Glimpse converts your daily summary into an audio briefing using ElevenLabs (for premium realistic voices) or Gemini TTS.
  • Email Updates: Receive a beautifully formatted summary directly in your inbox every morning, ensuring you never miss a beat even if you don't log in to the dashboard.

Architecture

The system follows a modern asynchronous architecture to handle high-volume email processing and AI tasks efficiently.

graph TD
    User((User))
    Web[Frontend: Next.js]
    API[Backend API: FastAPI]
    Worker[Celery Workers]
    Redis[(Task Queue: Redis)]
    DB[(Database: PostgreSQL)]
    LLM[AI Layer: Gemini]
    S3[Object Storage: S3/R2]
    TTS[TTS: ElevenLabs/Gemini]

    User <--> Web
    Web <--> API
    API <--> DB
    API --> Redis
    Redis <--> Worker
    Worker --> DB
    Worker <--> LLM
    Worker --> S3
    Worker --> TTS
Loading

AI & Background Processing

Glimpse uses Celery to orchestrate complex AI workflows, ensuring the API remains responsive.

  1. Parallel Summarization: When a digest is triggered, summarize_emails_batch processes multiple emails concurrently to reduce latency.
  2. Context Synthesis: A final summarize_digest_overall task aggregates individual summaries into a cohesive narrative.
  3. Token Tracking: Every interaction with Gemini is logged with input/output token counts to monitor cost and performance.

Tech Stack

  • Backend: Python 3.11+, FastAPI, Celery, SQLAlchemy
  • Frontend: Next.js 14, TypeScript, Tailwind CSS
  • Database: PostgreSQL (Supabase/Local)
  • Task Queue: Redis
  • AI/LLM: Google Gemini 3
  • Audio: ElevenLabs / Gemini 1.5 TTS
  • Infrastructure: Docker, Google Cloud (OAuth, Gmail API)

Getting Started

Follow these instructions to set up Glimpse on your local machine.

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • PostgreSQL (Local or cloud instance)
  • Redis (Local or cloud instance)
  • Google Cloud Credentials:
    • OAuth 2.0 Client ID
    • API Key for Gemini
  • AWS Credentials (for S3 storage)
  • ElevenLabs API Key (Optional, for high-quality audio)

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies: We use uv for fast dependency management.

    pip install uv
    uv sync
  3. Configure Environment: Create a .env file in the backend/ directory with the following variables:

    DATABASE_URL=<url to postgresql database>
    SECRET_KEY = <secret key here> (for Fernet encryption)
    SYSTEM_EMAIL_REFRESH_TOKEN=<refresh token for system email> (system email for sending email notifs)
    
    GOOGLE_CLIENT_ID = <google client id of cloud project>
    GOOGLE_CLIENT_SECRET = <client secret of cloud project>
    GOOGLE_REDIRECT_URI = http://127.0.0.1:8000/auth/google/callback
    GOOGLE_API_KEY = <api key of cloud project>
    
    ELEVENLABS_API_KEY = <elevenlabs api key here>
    
    AWS_SECRET_ACCESS_KEY=<aws secret access key here>
    AWS_ACCESS_KEY_ID=<aws access key id here>
    AWS_REGION=<aws region here>
    S3_BUCKET_NAME=<s3 bucket name here>
  4. Run the Services: You will need to run the web server and the Celery workers. (or use poe to run these tasks, check pyproject.toml)

    Terminal 1: Web Server

    uv run uvicorn main:app --reload

    Terminal 2: Celery Worker

    uv run celery -A celery_app worker --loglevel=info

    Terminal 3: Celery Beat (Scheduler)

    uv run celery -A celery_app beat --loglevel=info

    Optional: Use redis-server to run a local Redis instance.

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Configure Environment: Create a .env.local file in the frontend/ directory:

    NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
  4. Start the Development Server:

    npm run dev

    The application will be available at http://localhost:3000.

Project Structure

glimpse/
├── backend/
│   ├── app/                 # Main application logic
│   │   ├── ai/              # AI summarization & TTS logic
│   │   ├── api/             # API dependencies
│   │   ├── core/            # Config and settings
│   │   ├── db/              # Database models and migrations
│   │   ├── routes/          # API endpoints
│   │   └── tasks/           # Celery background tasks (Sync/Digest/Audio)
│   ├── main.py              # Application entry point
│   ├── celery_app.py        # Celery configuration
│   ├── Dockerfile           # Backend container definition
│   └── pyproject.toml       # Python dependencies
├── frontend/
│   ├── app/                 # Next.js App Router pages
│   ├── components/          # Reusable UI components
│   └── lib/                 # Utilities and API clients
└── README.md                # Project documentation

Deployment

Frontend

The frontend is a standard Next.js application and is optimized for Vercel.

  1. Push your code to a Git repository.
  2. Import the project into Vercel.
  3. Set the NEXT_PUBLIC_BACKEND_URL environment variable in the Vercel dashboard.

Backend & Infrastructure

The backend is containerized and stateless, making it easy to deploy on any cloud provider.

  1. Compute: Deploy the Docker container to Google Cloud Run.
  2. Database: Use a managed PostgreSQL instance (we use Supabase).
  3. Task Queue: Use Redis Cloud (or a managed Redis instance) for the Celery broker. This is critical for production reliability.
  4. Configuration: Ensure all environment variables (DATABASE_URL, GOOGLE_API_KEY, ELEVENLABS_API_KEY, etc.) are set in your production environment.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors