Prerequisites
Before you begin, ensure you have the following installed:- Bun v1.0 or higher (install Bun)
- PostgreSQL v14 or higher
- Node.js v18 or higher (for compatibility)
- Git for version control
This project uses Bun as the JavaScript runtime and package manager. The
packageManager is set to bun@1.2.17 in package.json.Clone the Repository
Clone and Install Dependencies
Set Up PostgreSQL Database
You have two options for the database:
- Local PostgreSQL
- Neon (Recommended)
If running PostgreSQL locally:
Configure Environment Variables
Create a
This is your PostgreSQL connection string from Step 2.
Setup Steps:
Only needed if you want to test GitHub issue/PR integrations locally.
Required for testing payment flows. Get test keys from the Stripe Dashboard.
.env file in the root directory by copying .env.example:Required Environment Variables
Database Configuration
Database Configuration
Authentication (Better Auth)
Authentication (Better Auth)
GitHub OAuth
GitHub OAuth
- Go to GitHub Developer Settings
- Click “New OAuth App”
- Fill in the details:
- Application name: Bounty Local
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Click “Register application”
- Copy the Client ID and generate a Client Secret
- Add both to your
.envfile
GitHub App (Optional - for integrations)
GitHub App (Optional - for integrations)
Stripe (Optional - for payments)
Stripe (Optional - for payments)
Other Optional Services
Other Optional Services
The following are optional for local development:The app will function without these services, though some features will be disabled.
App Configuration
App Configuration
Initialize the Database
Push the database schema to your PostgreSQL instance:This uses Drizzle ORM to create all necessary tables. The schema includes:
- User authentication tables (via Better Auth)
- Bounty management tables
- Organizations and invites
- Submissions and applications
- Comments, votes, and bookmarks
- GitHub and Linear integration tables
- Payment and transaction records
For development,
db:push synchronizes your schema without migrations. For production, use bun db:generate and bun db:migrate to create and apply migrations.Start the Development Server
The
dev script runs all workspace packages in development mode using Turborepo, excluding the Discord bot.Available Scripts
The project includes several useful npm scripts:Project Structure
The repository is a Turborepo monorepo with the following structure:Accessing Drizzle Studio
Drizzle Studio provides a GUI for inspecting and managing your database:- Browse all tables and relationships
- Run custom SQL queries
- Edit records directly
- Inspect indexes and constraints
Troubleshooting
Database connection errors
Database connection errors
- Verify your
DATABASE_URLis correct - Ensure PostgreSQL is running
- Check that the database exists
- Confirm URL-encoded special characters in credentials
- For Neon, ensure
sslmode=requireis in the connection string
GitHub OAuth not working
GitHub OAuth not working
- Verify callback URL is exactly:
http://localhost:3000/api/auth/callback/github - Check that Client ID and Secret are correct
- Ensure the OAuth app is not suspended
- Clear browser cookies and try again
Bun installation issues
Bun installation issues
- Update Bun:
bun upgrade - Clear Bun cache:
rm -rf ~/.bun/install/cache - Try deleting
node_modulesand reinstalling:rm -rf node_modules && bun install
Port 3000 already in use
Port 3000 already in use
Change the port in your Next.js config or kill the process:
TypeScript errors
TypeScript errors
- Run type checking:
bun check-types - Ensure all workspace packages are built
- Try restarting your IDE/editor
Next Steps
Now that you have Bounty running locally:Quickstart Guide
Learn how to create bounties and submit work
API Documentation
Explore the tRPC API endpoints
Self-Hosting Guide
Host Bounty on your own infrastructure
Deployment
Deploy Bounty to production