Introduction
Bounty is a modern bounty platform built with Next.js, PostgreSQL, and TypeScript. While Bounty is available as a hosted service, you can self-host your own instance for complete control over your data, infrastructure, and deployment strategy.Why Self-Host?
Control & Privacy- Full control over your data and infrastructure
- Host on your preferred cloud provider or on-premises
- Comply with data residency requirements
- Customize the platform to your specific needs
- Integrate with your existing systems
- Extend functionality with custom features
- Optimize infrastructure costs based on your usage
- Use existing infrastructure resources
- No per-user or transaction fees
Prerequisites
Before self-hosting Bounty, ensure you have:Runtime & Package Manager
Runtime & Package Manager
- Bun v1.2.17 or higher (primary package manager)
- Node.js v18+ (required for some dependencies)
- npm/pnpm (alternative package managers, optional)
Database
Database
- PostgreSQL v14 or higher
- Recommended: Neon for serverless PostgreSQL
- Database with SSL support for production
- At least 1GB storage for initial deployment
Required Services
Required Services
The following services are required for full functionality:
- Better Auth - Authentication (secret key generation)
- GitHub OAuth - User authentication
- GitHub App - Repository integration
- Upstash Redis - Rate limiting and caching
Optional Services
Optional Services
These services enable additional features:
- Discord - Community integration and webhooks
- Stripe or Autumn - Payment processing
- Resend - Transactional emails
- PostHog - Analytics and feature flags
- Sentry - Error tracking and monitoring
- Unkey - API key management
- Marble CMS - Blog and content management
Architecture Overview
Bounty is built as a monorepo using Turborepo with the following structure:Application Structure
Technology Stack
Frontend
- Next.js 16 with App Router
- React 19 with TypeScript
- TailwindCSS 4.x
- Radix UI & shadcn/ui components
Backend
- Next.js API routes
- tRPC for type-safe APIs
- Better Auth for authentication
- Drizzle ORM for database
Database
- PostgreSQL 14+
- Drizzle ORM
- node-postgres (pg) driver
- SSL support for production
Infrastructure
- Vercel (recommended)
- Upstash Redis
- Neon PostgreSQL
- GitHub App webhooks
Data Flow
-
User Authentication
- GitHub OAuth flow via Better Auth
- Session management with PostgreSQL
- Passkey support for passwordless auth
-
Bounty Management
- GitHub App integration for repository access
- Webhook handling for issue synchronization
- Real-time updates via Upstash Realtime
-
Payment Processing
- Stripe Connect for payouts
- Autumn as alternative payment processor
- Automated payment tracking
Security Considerations
Deployment Workflow
The typical self-hosting workflow involves:- Environment Setup - Configure all required environment variables
- Database Setup - Initialize PostgreSQL and run migrations
- Build & Deploy - Build the application and deploy to your platform
- Verification - Test authentication, webhooks, and integrations
- Monitoring - Set up error tracking and analytics
Next Steps
Environment Variables
Configure all required and optional environment variables
Database Setup
Set up PostgreSQL and run Drizzle migrations
Deployment
Deploy to Vercel or your own infrastructure
Installation
Local development setup and installation
Getting Help
If you encounter issues during self-hosting:- Check the GitHub Issues
- Join the GitHub Discussions
- Review the Installation Guide for local setup
Self-hosting requires technical knowledge of web application deployment, database management, and DevOps practices. If you’re not comfortable with these topics, consider using the hosted version of Bounty.