Skip to content

aryannpanwarr/TrendWatching

Repository files navigation

Trend Watching

Trend Watching is a Next.js trend intelligence dashboard that combines search + social signals with bilingual rendering:

  • Original text + English text for top trend signals
  • Click any signal to open a "Why this trend?" detail page
  • Prompt-based personalized view (subscriber feature)
  • Daily AI newsletter generation (subscriber feature)

Sources

  • Google Trends RSS (live by default)
  • Mastodon trends API (live by default)
  • YouTube Data API (optional via key)
  • X/Twitter recent search API (optional via bearer token)
  • Reddit OAuth API (optional via client credentials)
  • Instagram Graph API hashtag flow (optional via token + business account)

Run locally

npm install
npm run dev

Open http://localhost:3000.

Environment

Copy .env.example to .env.local and fill keys you want to enable.

GOOGLE_TRENDS_MARKETS=US,IN,GB,CA,AU,JP,DE,BR
YOUTUBE_TREND_REGIONS=US,IN,GB,BR,JP
YOUTUBE_API_KEY=
X_BEARER_TOKEN=
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_USER_AGENT=TrendWatching/1.0
INSTAGRAM_ACCESS_TOKEN=
INSTAGRAM_BUSINESS_ACCOUNT_ID=
INSTAGRAM_HASHTAGS=ai,startup,music,f1,fitness
GEMINI_API_KEY=
GEMINI_MODEL=gemini-3-flash
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
NEXT_PUBLIC_APP_URL=http://localhost:3000
CRON_SECRET=
SMTP_HOST=
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=
SMTP_PASS=
SMTP_FROM=TrendWatching <[email protected]>
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=

Hourly refresh

  • The trend fetch layer is cached at 1 hour.
  • You can trigger hourly refresh through GET /api/cron/hourly.
  • If CRON_SECRET is set, pass it in header: x-cron-secret.

Subscription and personalization

  • GET /subscribe opens Razorpay checkout UI.
  • On successful payment, Razorpay signature verification activates subscriber cookie.
  • Subscribers can set a focus prompt with source-balanced results across Google/YouTube/Mastodon and generate a daily AI newsletter.
  • Set SMTP env vars to enable sending the newsletter to email.
  • Set Firebase web config env vars to enable email/password sign in and sign up.

API routes

  • GET /api/trends
  • GET /api/newsletter/daily (subscriber only)
  • POST /api/newsletter/send (subscriber only)
  • POST /api/razorpay/order
  • POST /api/razorpay/activate
  • GET /api/cron/hourly

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors