A complete web application for managing and tracking cricket player points with bonus/penalty system.
✅ Player Management - View all players and their current points ✅ Bonus/Penalty System - Add bonus (negative) or penalty (positive) points to players ✅ Transaction History - Track all point additions with descriptions and timestamps ✅ Search Functionality - Search players by name ✅ Export Options:
- Copy table to clipboard
- Export to PDF
- Export to CSV ✅ Database - SQLite database for persistent data storage ✅ Responsive Design - Works on desktop and mobile devices
- Node.js (v14 or higher)
- npm (comes with Node.js)
npm installThis will install:
- Express.js (web server)
- SQLite3 (database)
- CORS (cross-origin requests)
- Body-parser (JSON parsing)
npm startOr in development mode:
node server.jsYou should see:
Cricket Point Calculator Server running on http://localhost:3000
Connected to the SQLite database.
Open your web browser and go to:
http://localhost:3000
- Select a Player from the dropdown menu
- Enter Points:
- Use negative numbers (-) for bonus points (GOOD)
- Use positive numbers (+) for penalty points (NOT GOOD)
- Select Type: Choose from Bonus, Penalty, Performance Adjustment, or Other
- Add Description (Optional): Explain why points are being added
- Click "Add Points" button
- All players are displayed in a table sorted by points
- Green badge = Good (negative points)
- Red badge = Penalty (positive points)
- Use the search box to filter by player name
- Copy Table: Copies the table to clipboard (paste into Excel)
- Export PDF: Downloads a PDF file of the current table
- Export CSV: Downloads a CSV file for use in Excel/Sheets
id - Unique player ID
name - Player name
points - Current total points
created_at - Date created
id - Unique transaction ID
player_id - Reference to player
player_name - Player name (for easy lookup)
points_added - Points added (can be negative)
type - Type (Bonus, Penalty, etc.)
description - Description of transaction
timestamp - When transaction occurred
The application comes pre-loaded with 42 cricket players and their initial points from your demo data.
CRICKETAPP/
├── server.js # Express server and API endpoints
├── package.json # Project dependencies
├── cricketapp.db # SQLite database (created on first run)
└── public/
├── index.html # HTML interface
├── styles.css # Styling
└── script.js # Frontend JavaScript
GET /api/players
Returns: Array of all players with points
GET /api/players/:id
Returns: Single player object
POST /api/transactions
Body: {
"player_id": 1,
"player_name": "Ashok Ch",
"points_added": -50,
"type": "Bonus",
"description": "Good performance"
}
GET /api/transactions
Returns: Array of all transactions
GET /api/export/csv
Returns: CSV file download
- Negative Points = Good Performance ✓
- Positive Points = Penalty ✗
- Data is saved to SQLite database (
cricketapp.db) - The application runs on
localhost:3000by default - To stop the server, press
Ctrl+Cin the terminal
Run: npm install
Either:
- Close the application using that port
- Change PORT in server.js to another number (e.g., 3001)
The database file (cricketapp.db) is created automatically on first run.
For issues or questions, check that:
- Node.js is installed:
node --version - npm is installed:
npm --version - Dependencies are installed:
npm install - Server is running: Open http://localhost:3000
Enjoy using the Cricket Points Calculator! 🏏