A Next.js dashboard application for viewing Sentry errors with Google OAuth authentication.
- 🔐 Google OAuth authentication using NextAuth.js
- 📊 Dashboard displaying Sentry errors
- 🤖 AI-powered error explanations - Understand errors in plain English
- 🎨 Modern UI with Tailwind CSS
- 🔒 Protected routes with middleware
- Node.js 18+ installed
- A Google Cloud project with OAuth credentials
- A Sentry account with API access
- An OpenAI API key (for AI error explanations)
- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Create a
.env.localfile in the root directory with the following variables:
# NextAuth.js Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret-here-generate-with-openssl-rand-base64-32
# Google OAuth Credentials
# Get these from https://console.cloud.google.com/apis/credentials
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Sentry API Configuration
# Get your auth token from https://sentry.io/settings/account/api/auth-tokens/
SENTRY_AUTH_TOKEN=your-sentry-auth-token
SENTRY_ORG=your-sentry-organization-slug
# For multiple projects (recommended):
SENTRY_FRONTEND_PROJECT=your-frontend-project-slug
SENTRY_BACKEND_PROJECT=your-backend-project-slug
# Or use single project (legacy):
# SENTRY_PROJECT=your-sentry-project-slug
# OpenAI API Configuration (for AI Error Explanations)
# Get your API key from https://platform.openai.com/api-keys
OPENAI_API_KEY=your-openai-api-key- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client ID"
- Set authorized redirect URIs to:
http://localhost:3000/api/auth/callback/google - Copy the Client ID and Client Secret to your
.env.localfile
- Go to Sentry Settings
- Create a new auth token with
project:readandorg:readscopes - Copy the token to
SENTRY_AUTH_TOKENin your.env.localfile - Find your organization slug (visible in your Sentry URL:
sentry.io/organizations/[org-slug]/) - Find your project slug (visible in your Sentry URL:
sentry.io/organizations/[org-slug]/projects/[project-slug]/)
Run this command to generate a secure secret:
openssl rand -base64 32Copy the output to NEXTAUTH_SECRET in your .env.local file.
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 with your browser.
app/login/- Login page with Google OAuthapp/dashboard/- Main dashboard displaying Sentry errorsapp/api/auth/[...nextauth]/- NextAuth.js API route handlerapp/api/sentry/errors/- API route for fetching Sentry errorsmiddleware.ts- Route protection middleware