Seamlessly split restaurant bills with cryptocurrency on the blockchain
BillBite is a decentralized application (dApp) that revolutionizes bill splitting for restaurants and dining groups. Built on Ethereum, it enables transparent, secure, and trustless bill management where restaurants can create itemized bills and customers can select and pay for only their ordered items using cryptocurrency.
- Create Itemized Bills: Generate detailed bills with individual menu items and costs
- Direct Payments: Receive payments directly to your wallet address
- Transparent Tracking: Monitor bill status and payment progress in real-time
- Fair Splitting: Select only the items you ordered from the bill
- Cryptocurrency Payments: Pay using ERC-20 tokens
- No Overpaying: Eliminate disputes by paying exactly your share
- Transparency: All transactions are recorded on-chain
- Security: Cryptographically secure payments
- Trustless: No intermediaries or central authority required
- Immutable Records: Permanent transaction history
- Solidity ^0.8.21
- Foundry - Development framework
- OpenZeppelin Contracts - Security standards
- Ethereum Network - Deployed on Sepolia testnet
- Next.js 15.3.3 - React framework
- TypeScript - Type safety
- Tailwind CSS 4.0 - Styling
- Privy - Web3 authentication
- Wagmi - Ethereum interactions
- Viem - Ethereum utilities
- Node.js (v18 or higher)
- npm or yarn
- MetaMask or compatible Web3 wallet
- Foundry (for smart contract development)
-
Clone the repository
git clone https://github.com/your-username/BillBite.git cd BillBite -
Setup Backend (Smart Contract)
cd backend npm install forge install -
Setup Frontend
cd ../frontend npm install
-
Start the frontend development server
cd frontend npm run dev -
Deploy smart contracts (if needed)
cd backend forge script script/Deploy.s.sol --rpc-url <your-rpc-url> --private-key <your-private-key> --broadcast
Create environment variables for:
- RPC endpoints for blockchain networks
- Private keys for deployment (use test networks only)
- Frontend environment variables for Web3 providers
- Connect Wallet: Authenticate using a Web3 wallet
- Create Bill: Add menu items with names and costs
- Share Bill ID: Provide the generated bill ID to customers
- Receive Payment: Get paid directly when customers complete their payments
- Connect Wallet: Authenticate using a Web3 wallet
- Enter Bill ID: Access the shared bill using the ID
- Select Items: Choose only the menu items you ordered
- Pay Share: Pay your portion using ERC-20 tokens
BillBite/
├── backend/ # Smart contract and blockchain logic
│ ├── src/
│ │ └── BillBite.sol # Main smart contract
│ ├── script/
│ │ └── Deploy.s.sol # Deployment script
│ ├── test/ # Contract tests
│ └── foundry.toml # Foundry configuration
├── frontend/ # Next.js web application
│ ├── src/
│ │ ├── app/ # Next.js app router
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom React hooks
│ │ └── lib/ # Utilities and contract ABI
│ └── public/ # Static assets
└── README.md # This file
Contract Address: 0x79086a9930fc1997a3e09859842700d4a806fef8 (Sepolia Testnet)
Run smart contract tests:
cd backend
forge testRun frontend tests:
cd frontend
npm testThe smart contract is deployed on Ethereum Sepolia testnet. For production deployment:
- Configure network settings in
foundry.toml - Set up environment variables
- Deploy using Foundry scripts
- Update frontend contract addresses
- Deploy frontend to Vercel or similar platform
This project is licensed under the MIT License - see the LICENSE file for details.