A feedback widget system that captures screenshots, allows annotations, and automatically creates GitHub issues.
- Node.js >= 24.12.0 < 25.0.0
- pnpm >= 9.0.0
- Docker and Docker Compose (for PostgreSQL)
-
Install dependencies:
pnpm install
Note: If you encounter Node version issues, use
nvmto switch to the correct version:nvm use
-
Set up environment variables: Create a
.envfile in the root directory:# Database DATABASE_URL="postgresql://bugbuddy:bugbuddy@localhost:5432/bugbuddy?schema=public" KV_REST_API_URL="" (upstash redis url) KV_REST_API_TOKEN="" (upstash redis token) # Better Auth BETTER_AUTH_SECRET="your-secret-key-here-change-in-production" # OAuth (for user authentication) GITHUB_CLIENT_ID="your-github-client-id" GITHUB_CLIENT_SECRET="your-github-client-secret" GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # PostHog (optional) NEXT_PUBLIC_POSTHOG_KEY="" NEXT_PUBLIC_POSTHOG_HOST="https://app.posthog.com" # Vercel Blob BLOB_READ_WRITE_TOKEN="your-blob-read-write-token" # Email EMAIL_HOST= EMAIL_PORT= EMAIL_USER= EMAIL_PASSWORD=
-
Start PostgreSQL database:
docker-compose up -d
-
Set up Prisma:
# Generate Prisma client pnpm db:generate # Push schema to database (for development) pnpm db:push # Or run migrations (for production) pnpm db:migrate
-
Start the development server:
pnpm dev
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Go to "Credentials" > "Create Credentials" > "OAuth client ID"
- Choose "Web application"
- Add authorized redirect URIs:
- Development:
http://localhost:3000/api/auth/callback/google - Production:
https://yourdomain.com/api/auth/callback/google
- Development:
- Copy the Client ID and Client Secret to your
.envfile
-
Go to GitHub Settings > Developer settings > OAuth Apps
-
Create a new OAuth App (or edit your existing one)
-
Set Authorization callback URL:
- Development:
http://localhost:3000/api/auth/callback/github - Production:
https://yourdomain.com/api/auth/callback/github
Note: This single callback URL handles both authentication and account linking. The system automatically detects which flow to use.
- Development:
-
Copy the Client ID and Client Secret to your
.envfile
Important: The OAuth app is configured to request the repo scope, which allows creating GitHub issues. When users sign in with GitHub, they'll need to authorize your app to access their repositories.
Note: Users can sign in with Google and then link their GitHub account in the account settings to enable GitHub integration features. The account linking uses the same callback URL but with a special parameter to avoid changing the user's login method.
The webhook allows Bug Buddy to sync GitHub issue status changes and comments back to your dashboard.
-
Go to your GitHub repository:
- Navigate to the repository where issues are created
- Go to Settings > Webhooks
-
Add a new webhook:
- Click "Add webhook"
- Payload URL:
- Development:
http://localhost:3000/api/github/webhook - Production:
https://yourdomain.com/api/github/webhook
- Development:
- Content type:
application/json - Events: Select "Let me select individual events" and choose:
- ✅ Issues
- ✅ Issue comments
- Active: ✅ (checked)
- Click "Add webhook"
-
Verify webhook is working:
- After creating the webhook, GitHub will send a test ping
- You should see it in the webhook's "Recent Deliveries" section
- When you close or comment on an issue in GitHub, the status will automatically sync to Bug Buddy
- Issue State Changes: When an issue is closed or reopened in GitHub, the feedback status is updated in Bug Buddy
- Comments: New comments on GitHub issues are synced to Bug Buddy as activity
- Bidirectional Sync: Keeps your Bug Buddy dashboard in sync with GitHub
- Sign in with Google or GitHub at
http://localhost:3000 - If you signed in with Google, you'll be prompted to connect your GitHub account for integration features
- Create a project in the dashboard
- Copy the embed script from the project page
- Add the script to your website
- Configure GitHub integration in settings
- Start receiving feedback!
Add this script to your website:
<script
src="http://localhost:3000/widget.js"
data-project-key="YOUR_API_KEY"
data-app-url="http://localhost:3000"
></script>Replace YOUR_API_KEY with the API key from your project.
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm db:generate- Generate Prisma clientpnpm db:push- Push schema changes to database (development)pnpm db:migrate- Create and run migrations (production)pnpm db:studio- Open Prisma Studio