Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gr7800/live_cricket_scoring_app
https://github.com/gr7800/live_cricket_scoring_app
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gr7800/live_cricket_scoring_app
- Owner: gr7800
- Created: 2024-08-21T10:02:42.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T14:26:49.000Z (3 months ago)
- Last Synced: 2024-08-23T16:06:41.333Z (3 months ago)
- Language: JavaScript
- Homepage: https://khel-ai-assignment.netlify.app
- Size: 261 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Live Cricket Scoring Application
## Overview
The Live Cricket Scoring Application is a comprehensive platform for simulating real-world cricket scoring. It includes features for real-time updates, interactive scoreboards, user management, and more. The application is built with a Node.js backend using Express and MongoDB for data management, and it supports real-time communication using WebSockets or Server-Sent Events (SSE).
## Features
- **Real-Time Updates**: Seamless score updates without page refreshes using WebSockets or SSE.
- **Interactive Scoreboard**: Dynamic display of multiple innings, overs, runs, wickets, run rates, and other metrics.
- **User Interface**: Intuitive and responsive design for easy interaction.
- **Authentication**: Basic user authentication to protect match data.
- **Error Handling**: Robust error handling for invalid inputs and unexpected responses.
- **Optional Features**:
- Commentary
- Player Statistics
- Match History
- Mobile Optimization
- Social Sharing## Installation
### Prerequisites
- [Node.js](https://nodejs.org/) (version 14.x or later)
- [MongoDB](https://www.mongodb.com/) (version 4.x or later)
- [npm](https://www.npmjs.com/) (Node package manager)### Setup
1. **Clone the Repository**
```bash
git clone https://github.com/your-username/cricket-scoring-app.git
cd cricket-scoring-app
```2. **Install Dependencies**
```bash
npm install
```3. **Configure Environment Variables**
Create a `.env` file in the root directory with the following content:
```
MONGO_URI=
PORT=5000
```4. **Run the Application**
For development:
```bash
npm run dev
```For production:
```bash
npm start
```## API Endpoints
### Create a New Match
- **URL**: `/api/matches`
- **Method**: `POST`
- **Body**:
```json
{
"teamA": "Team A",
"teamB": "Team B",
"overs": 20
}
```
- **Response**:
```json
{
"_id": "matchId",
"teams": {
"teamA": "Team A",
"teamB": "Team B"
},
"overs": 20,
"innings": [],
"currentInning": 0,
"matchStatus": "not started"
}
```### Get Match Details
- **URL**: `/api/matches/:id`
- **Method**: `GET`
- **Response**:
```json
{
"_id": "matchId",
"teams": {
"teamA": "Team A",
"teamB": "Team B"
},
"overs": 20,
"innings": [
{
"battingTeam": "Team A",
"runs": 10,
"wickets": 2,
"oversBowled": 5,
"balls": 30
}
],
"currentInning": 1,
"matchStatus": "in progress"
}
```## Real-Time Updates
Real-time updates are handled using WebSockets or Server-Sent Events (SSE). Ensure your frontend is set up to connect to the WebSocket or SSE endpoint to receive live match updates.
## Contributing
1. **Fork the Repository**
2. **Create a Feature Branch**
3. **Commit Your Changes**
4. **Push to the Branch**
5. **Open a Pull Request**## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [Express](https://expressjs.com/) - Fast, unopinionated, minimalist web framework for Node.js
- [MongoDB](https://www.mongodb.com/) - NoSQL database for storing match data
- [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) - For real-time communicationFor more details and updates, check out our [documentation](https://your-project-docs-link).
```Feel free to customize the details according to your project specifics and any additional instructions or features you may have.