Loading
Run Opentip locally, self-host, or contribute to the open-source codebase.
git clone https://github.com/opentip/opentip.git
cd opentip
npm installThis installs dependencies for both the frontend and indexer via npm workspaces.
Copy the example env file and fill in your values:
cd frontend
cp .env.example .env| Variable | Required | Description |
|---|---|---|
| DATABASE_URL | Yes | PostgreSQL connection string |
| GITHUB_ID | Yes | GitHub OAuth app client ID |
| GITHUB_SECRET | Yes | GitHub OAuth app client secret |
| NEXTAUTH_SECRET | Yes | Session encryption key (random string) |
| NEXTAUTH_URL | Yes | Base URL (http://localhost:3000 for dev) |
| NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID | Yes | Reown/WalletConnect project ID |
| NEXT_PUBLIC_CHAIN | Yes | baseSepolia or base |
| NEXT_PUBLIC_BASE_SEPOLIA_CONTRACT | Yes | Contract address on Base Sepolia |
| NEXT_PUBLIC_BASE_CONTRACT | For mainnet | Contract address on Base mainnet |
| PRIVATE_KEY | Yes | Owner wallet private key (admin transactions) |
| REGISTRAR_PRIVATE_KEY | Yes | Registrar signer key (EIP-712 registration) |
| OWNER_ADDRESS | Yes | Owner wallet address (admin role check) |
| NEXT_PUBLIC_OWNER_ADDRESS | Yes | Owner address (client-side) |
| RESEND_API_KEY | Optional | Resend API key (password reset emails) |
| RESEND_FROM | Optional | From address for emails |
| AZURE_STORAGE_ACCOUNT | Optional | Azure Blob Storage account (image uploads) |
| AZURE_STORAGE_KEY | Optional | Azure Blob Storage key |
| NEXT_PUBLIC_RELAY_API_KEY | Optional | Relay API key (ETH tips) |
| GROQ_API_KEY | Optional | Groq API key (AI-generated repo summaries) |
| GITHUB_TOKEN | Optional | GitHub token (higher API rate limits) |
| Variable | Description |
|---|---|
| DATABASE_URL | Same PostgreSQL connection as frontend |
| CONTRACT_ADDRESS | Deployed Opentip contract address |
| RPC_URL | Base RPC endpoint |
| START_BLOCK | Block to start scanning from (if no checkpoint) |
| POLL_MS | Poll interval in ms (default 12000) |
| NEXT_PUBLIC_CHAIN | baseSepolia or base |
cd frontend
npx prisma migrate dev
npx prisma generateThis creates all tables in your PostgreSQL database. The Prisma schema is shared between the frontend and indexer.
cd frontend
npm run devStarts the Next.js dev server at http://localhost:3000
cd indexer
npx prisma generate
npx tsx src/index.tsStarts the event indexer polling loop
cd contracts
forge install
forge testThe contract has 36 tests covering registration, tipping, claiming, admin functions, and edge cases. Run forge test -vvv for verbose output.
Deploy to Base Sepolia:
forge script script/Deploy.s.sol:Deploy \
--rpc-url baseSepolia \
--broadcast \
--verifyOpentip is open-source software. The smart contract is MIT licensed. See the repository for full license details.