This guide will walk you through setting up and running the GitStream project locally and deploying to Base Sepolia testnet.
Before you begin, ensure you have the following installed:
- Node.js >= 18.0.0
- pnpm >= 8.0.0
- Git
- MongoDB (local or MongoDB Atlas account)
You'll need to set up accounts and obtain API keys for:
- GitHub OAuth App - For repository access
- MongoDB - Database for storing project data
- Privy - For wallet authentication (privy.io)
- Yellow Network - For payment streaming (testnet access)
- Alchemy or Infura - For Base Sepolia RPC access
- Base Sepolia Testnet Wallet - With some ETH for gas
# From the project root
cd /Users/bashybaranaba/gitstreamer
pnpm installOption A: Local MongoDB
# Install MongoDB Community Edition
brew install mongodb-community
brew services start mongodb-community
# MongoDB will be available at: mongodb://localhost:27017Option B: MongoDB Atlas (Recommended for production)
- Go to mongodb.com/atlas
- Create a free cluster
- Get your connection string
- Replace in
.envfiles
- Go to GitHub Settings > Developer settings > OAuth Apps
- Click "New OAuth App"
- Fill in:
- Application name: GitStream Local Dev
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/github/callback
- Click "Register application"
- Copy the Client ID and Client Secret
- Go to privy.io and sign up
- Create a new app
- Configure:
- Add Base Sepolia as supported chain
- Enable Wallet login method
- Copy your App ID from the dashboard
- Contact Yellow Network for testnet access
- Get your API key for the sandbox environment
- Documentation: Yellow Network Docs
Backend API (apps/api/.env):
# Server
PORT=3001
# MongoDB
MONGODB_URI=mongodb://localhost:27017/gitstream
# Or for Atlas: mongodb+srv://username:password@cluster.mongodb.net/gitstream
# GitHub OAuth
GITHUB_CLIENT_ID=your_github_client_id_here
GITHUB_CLIENT_SECRET=your_github_client_secret_here
GITHUB_CALLBACK_URL=http://localhost:3000/api/auth/github/callback
# Yellow Network
YELLOW_API_KEY=your_yellow_api_key_here
YELLOW_NETWORK_URL=wss://clearnet-sandbox.yellow.com/ws
# Contracts (will be filled after deployment)
GITSTREAM_RECEIVER_ADDRESS=
USDC_ADDRESS=
DEPLOYER_PRIVATE_KEY=your_wallet_private_key_here
# Chain
CHAIN_ID=84532
RPC_URL=https://base-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_KEY
# Auth
JWT_SECRET=change-this-to-a-secure-random-string-in-production
# Frontend
FRONTEND_URL=http://localhost:3000
# Optional: Allow wallet header for testing
ALLOW_WALLET_HEADER=trueFrontend Web (apps/web/.env.local):
# API URL (Backend)
NEXT_PUBLIC_API_URL=http://localhost:3001
# Privy Configuration
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id_here
# Chain Configuration
NEXT_PUBLIC_CHAIN_ID=84532
# Contract Addresses (will be filled after deployment)
NEXT_PUBLIC_GITSTREAM_RECEIVER_ADDRESS=
NEXT_PUBLIC_USDC_ADDRESS=cd contracts
# Compile contracts
pnpm hardhat compile
# Deploy to Base Sepolia
pnpm hardhat run ignition/modules/GitStreamReceiver.ts --network base-sepolia
# The script will output contract addresses - copy them!Update your .env files with the deployed contract addresses:
- Add
GITSTREAM_RECEIVER_ADDRESSto both API and Web.envfiles - Add
USDC_ADDRESS(MockUSDC address for testnet)
- Go to Alchemy Base Sepolia Faucet
- Connect your wallet
- Request testnet ETH for gas fees
The indexes will be created automatically when you start the API server for the first time. The createIndexes function runs on startup.
Terminal 1 - Start Backend API:
cd /Users/bashybaranaba/gitstreamer
pnpm --filter api devYou should see:
GitStream API running on http://localhost:3001
Frontend URL: http://localhost:3000
Terminal 2 - Start Frontend:
cd /Users/bashybaranaba/gitstreamer
pnpm --filter web devYou should see:
▲ Next.js 16.1.6
- Local: http://localhost:3000
Terminal 3 - Start Event Listener (Optional):
cd /Users/bashybaranaba/gitstreamer/apps/api
pnpm tsx src/services/contracts/listener.tscurl http://localhost:3001/healthExpected response:
{
"status": "ok",
"timestamp": "2026-02-08T..."
}mongosh
use gitstream
show collectionsYou should see collections: projects, contributors, contributorMetrics, revenue
- Open http://localhost:3000
- You should see the GitStream landing page
- Click "Connect Wallet" - Privy modal should appear
- Navigate to dashboard (after connecting wallet)
- Try to create a new project
- GitHub OAuth should redirect correctly
-
Connect Wallet
- Click "Connect Wallet" on homepage
- Connect via Privy (MetaMask, Coinbase Wallet, etc.)
-
Link GitHub
- Go to Dashboard
- Click "Create Project"
- Authorize GitHub access
- Select a repository
-
Configure Tiers
- GitStream will analyze contributors
- You'll see suggested tier assignments
- Assign contributors to tiers:
- Core Maintainers (40% revenue)
- Active Contributors (35% revenue)
- Community (15% revenue)
- Treasury (10% reserved)
-
Contributors Claim Wallets
- Contributors visit
/claim - Sign in with GitHub
- Connect their wallet
- Now they can receive payments!
- Contributors visit
-
Receive Revenue
- When your app generates revenue and sends it to GitStreamReceiver
- The event listener detects it
- Revenue is stored in database
-
Create Streaming Session
- Go to project streams page
- Click "Create Stream"
- Yellow session is created
- Payments stream to tier members!
To demonstrate revenue flow:
-
Deploy TipJar Contract (separate demo repo)
# In tipjar-demo repo pnpm hardhat run scripts/deploy.ts --network base-sepolia -
Connect TipJar to GitStream
- TipJar should be configured with GitStreamReceiver address
- Register the tipjar-demo repo in GitStream
-
Send a Tip
- Use the TipJar UI to send USDC
- Watch GitStream detect the revenue
- See tier-based allocations
- Create stream and watch payments flow!
- Check MongoDB is running:
brew services list | grep mongodb - Verify
.envfile exists inapps/api/ - Check MongoDB connection string is correct
- Verify API is running on port 3001
- Check
NEXT_PUBLIC_API_URLinapps/web/.env.local - Check CORS settings in
apps/api/src/index.ts
- Verify callback URL matches exactly in GitHub OAuth App settings
- Check
GITHUB_CALLBACK_URLin backend.env - Make sure you're using the correct Client ID and Secret
- Verify API key is correct
- Check Yellow Network status
- Ensure you're using sandbox URL for testnet
- Ensure wallet has Base Sepolia ETH
- Check RPC URL is correct
- Verify network in
hardhat.config.ts
gitstreamer/
├── apps/
│ ├── api/ # Hono backend (port 3001)
│ │ ├── src/
│ │ │ ├── routes/ # API endpoints
│ │ │ ├── services/ # Business logic
│ │ │ ├── db/ # MongoDB models
│ │ │ └── middleware/ # Auth, validation, etc.
│ │ └── .env
│ │
│ └── web/ # Next.js frontend (port 3000)
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks
│ └── .env.local
│
├── contracts/ # Solidity contracts
│ ├── contracts/ # Smart contract source
│ ├── test/ # Contract tests
│ └── ignition/ # Deployment scripts
│
└── packages/ # Shared packages (future)
/project/[id]/page.tsx- Project overview dashboard/project/[id]/contributors/page.tsx- Contributor management/project/[id]/streams/page.tsx- Stream visualization/project/new/page.tsx- Project creation form
- ProvenanceKit integration for on-chain provenance
- Multi-chain support (Ethereum, Arbitrum, Optimism)
- Advanced tier governance (voting, councils)
- Non-code contribution tracking
- Real-time WebSocket updates for stream visualization
- Plan Document - Full implementation plan
- GitStream Contracts
- Yellow Network Docs
- Base Sepolia Explorer
This is a hackathon project. Contributions are welcome!
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
ISC
Need Help? Check the troubleshooting section or review the plan document for detailed architecture information.