A production-ready, real-time cricket scoring web application inspired by Cricheroes. Built with React, Node.js, MongoDB, and Socket.IO.
- ⚡ Real-time Scoring - Ball-by-ball live updates with Socket.IO
- 📊 Complete Statistics - Detailed batting, bowling and match statistics
- 👥 Team Management - Create and manage teams with full squads
- 🔐 Role-based Access - Admin, Scorer, and Viewer roles
- 🔗 Share Live Scores - Public links for spectators
- ↩️ Undo Functionality - Full ball-by-ball audit trail
- 📱 Mobile First - Responsive design optimized for all devices
- Node.js with Express.js
- MongoDB with Mongoose ODM
- Socket.IO for real-time updates
- JWT for authentication
- bcryptjs for password hashing
- express-validator for input validation
- React 18 with Vite
- React Router v6 for navigation
- Axios for API calls
- socket.io-client for real-time updates
- Context API for state management
BoundaryBytes/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── auth/ # Login, Register, ProtectedRoute
│ │ │ ├── home/ # Home dashboard
│ │ │ ├── layout/ # Navbar, Layout
│ │ │ ├── match/ # Match list, create, setup, details
│ │ │ ├── scoring/ # Scoring panel
│ │ │ └── team/ # Team management
│ │ ├── context/ # AuthContext, MatchContext
│ │ ├── hooks/ # useSocket
│ │ ├── services/ # API services
│ │ └── App.jsx # Main app with routes
│ ├── .env # Environment variables
│ └── package.json
│
└── server/ # Node.js backend
├── src/
│ ├── config/ # Database, constants
│ ├── controllers/ # Business logic
│ ├── middleware/ # Auth, error handling
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API routes
│ ├── socket/ # Socket.IO handlers
│ ├── utils/ # Helper functions
│ └── index.js # Server entry point
├── .env # Environment variables
└── package.json
- Node.js 18+
- MongoDB Atlas account (or local MongoDB)
- npm or yarn
-
Navigate to the server directory:
cd server -
Install dependencies:
npm install
-
Configure environment variables in
.env:PORT=5000 NODE_ENV=development MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/boundarybytes JWT_SECRET=your-super-secret-jwt-key-min-32-chars JWT_EXPIRE=7d CLIENT_URL=http://localhost:5173
-
Start the server:
npm run dev
-
Navigate to the client directory:
cd client -
Install dependencies:
npm install
-
Configure environment variables in
.env:VITE_API_URL=http://localhost:5000/api VITE_SOCKET_URL=http://localhost:5000
-
Start the development server:
npm run dev
-
Open http://localhost:5173 in your browser.
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user profile
GET /api/teams- Get all teamsPOST /api/teams- Create team (admin/scorer)GET /api/teams/:id- Get team by IDGET /api/teams/:id/players- Get team players
POST /api/players- Create playerPOST /api/players/bulk- Bulk create playersGET /api/players/:id- Get player details
GET /api/matches- Get all matchesPOST /api/matches- Create match (admin/scorer)GET /api/matches/:id- Get match detailsPOST /api/matches/:id/setup- Setup match (select players)POST /api/matches/:id/toss- Record tossPOST /api/matches/:id/start- Start match
POST /api/matches/:id/score/ball- Record ballPOST /api/matches/:id/score/undo- Undo last ballPOST /api/matches/:id/score/batter- Set new batterPOST /api/matches/:id/score/bowler- Set new bowlerPOST /api/matches/:id/score/swap- Swap battersPOST /api/matches/:id/score/second-innings- Start 2nd innings
join_match- Subscribe to match updatesleave_match- Unsubscribe from match
ball_update- Ball recordedwicket- Wicket fellover_complete- Over completedinnings_complete- Innings finishedmatch_complete- Match finished
| Role | Permissions |
|---|---|
| Admin | Full access - create teams, matches, score |
| Scorer | Create teams, matches, and score |
| Viewer | View matches only |
The app handles all cricket scoring scenarios:
- Runs: 0-6 runs per ball
- Extras: Wide, No-ball, Bye, Leg-bye
- Wickets: All dismissal types with proper crediting
- Strike Rotation: Automatic on odd runs and over completion
- Undo: Full reversal of any ball
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Built with ❤️ for cricket enthusiasts