BitBuzz is a full-stack Pop Culture Prediction Market constructed with a rigorous Object-Oriented backend and a sleek Vite + React frontend.
Hosted Frontend Link: https://bit-buzz.vercel.app/
- Vite + React
- TailwindCSS for styling and responsive design
- Socket.io-client for real-time price updates
- React-Router-DOM for SPA routing
- Axios for API interactions
- Express.js (Node.js) RESTful API
- PostgreSQL interacting via Prisma ORM
- JSON Web Token (JWT) + bcrypt authentication
- Socket.io for emitting push events per market room
- Strict OOP Design Pattern: Domain Models (
BinaryMarket,TradeProcessor) and Interfaces (PricingStrategy->LMSRStrategy). - All trades execute as atomic Prisma transactions.
- Node.js (v18+)
- PostgreSQL installed and running (or Neon.tech URL)
- Define your connection string in
backend/.env. (Default ispostgresql://postgres:postgres@localhost:5432/bitbuzz) - Navigate to
./backend - Push schema:
npx prisma db push - Seed database:
npm run prisma db seed(Important: Run this to create initial admin, users, and tech/movie binary markets).
- CD into
./backend - Run
npm install - Run
npm run devto start Express with nodemon on port 3001.
- CD into
./frontend - Run
npm install - Run
npm run devto start the frontend application.
| Method | Endpoint | Description | Middleware |
|---|---|---|---|
| POST | /api/auth/register |
Create a user account | - |
| POST | /api/auth/login |
Return JWT | - |
| GET | /api/auth/me |
Fetch User Details | authMiddleware |
| GET | /api/markets |
List open markets | - |
| GET | /api/markets/:id |
Get specific market logic + pool state | - |
| POST | /api/markets |
Create a market | adminMiddleware |
| POST | /api/markets/:id/settle |
Settle market & execute payouts | adminMiddleware |
| POST | /api/trades |
Pass { marketId, outcome, amount }. Deducts limits |
authMiddleware |
| GET | /api/trades/portfolio |
Retrieve P&L positions | authMiddleware |
| GET | /api/leaderboard |
Get Top 10 traders by asset value | - |
All requirements outlined by the evaluation committee (agency tasks) are fulfilled end-to-end, skipping stubs/TODOs in favor of concrete implementations:
- Complex backend architecture powered by robust abstraction (
Market,PricingStrategy). - Valid LMSR calculations based on Robin Hanson's model.
- Fully atomic trade handling and JWT implementation.
- Socket.io broadcasts to connected UI clients.