A social prediction market for friend groups: create markets on questions your group cares about, place wagers in shared in-app coins, and let the group resolve outcomes by majority vote.
Built for UCLA CS 130 — Software Engineering, Spring 2026 (Team 11).
- Web app: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS 4
- Auth + database: Firebase (Authentication + Firestore)
- Server logic: Next.js API routes using the Firebase Admin SDK
- Hosting: Vercel (auto-deploys from
main, preview deploys per PR) - Tests: Vitest (unit) + a Node integration test against the Firestore emulator
- CI: GitHub Actions — typecheck, lint, unit tests, and build on every PR
.
├── web/ # Next.js app — almost all the code lives here
│ ├── src/ # App Router pages, API routes, lib, components
│ ├── tests/ # Integration tests (Node, not Vitest)
│ ├── README.md # Dev setup, scripts, troubleshooting
│ └── .env.example # Required environment variables, documented
├── firebase.json # Firebase project + emulator config
├── firestore.rules # Firestore security rules (deployed manually)
├── firestore.indexes.json # Firestore composite indexes (deployed manually)
└── .github/
├── workflows/ci.yml # Typecheck, lint, unit tests, build
├── ISSUE_TEMPLATE/ # Feature / bug / tech-debt
└── pull_request_template.md
For dev setup, scripts, and troubleshooting, see web/README.md.
Quick version:
git clone https://github.com/wimaan3/BetBat-CS130.git
cd BetBat-CS130/web
npm install
cp .env.example .env.local # then fill in Firebase config
npm run devThe non-negotiable rules from the design doc:
- All coin operations run inside Firestore atomic transactions. Bet placement, payouts, and refunds either succeed completely or roll back completely — coins are never created or destroyed outside a transaction.
- Markets, bets, votes, and transactions are server-side writes only.
Client SDK writes are denied by
firestore.rules; the Next.js API routes perform all coin-touching writes using the Admin SDK. - Resolution requires a 2/3 supermajority within 48 hours. Otherwise the market enters a DISPUTED state and stakes are refunded.
Team 11, CS 130 Spring 2026:
- Imaan Soltanalipour
- Arnav Jain
- Maanas Gantla
- Skylar Shi
- Dhruv Saran
This is an in-progress class project, not a production service. Issues tracked in the GitHub repo's Issues tab. Milestones: W6 Presentation 1 (done) and W10 Final Demo + Report.