{"id":25477027,"url":"https://github.com/sahil-172002/player","last_synced_at":"2026-04-07T21:32:02.637Z","repository":{"id":277511740,"uuid":"932653301","full_name":"sahil-172002/player","owner":"sahil-172002","description":"Cricket Player Management API using Node.js, Express.js, and MySQL for creating, reading, updating, and deleting player information.","archived":false,"fork":false,"pushed_at":"2025-02-14T10:14:44.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T04:42:20.834Z","etag":null,"topics":["api","backend","curd","express","js","mysql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sahil-172002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T09:21:25.000Z","updated_at":"2025-05-12T06:11:18.000Z","dependencies_parsed_at":"2025-02-14T10:38:29.715Z","dependency_job_id":null,"html_url":"https://github.com/sahil-172002/player","commit_stats":null,"previous_names":["sahil-172002/player"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sahil-172002/player","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahil-172002%2Fplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahil-172002%2Fplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahil-172002%2Fplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahil-172002%2Fplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahil-172002","download_url":"https://codeload.github.com/sahil-172002/player/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahil-172002%2Fplayer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31530641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","curd","express","js","mysql"],"created_at":"2025-02-18T13:29:26.772Z","updated_at":"2026-04-07T21:32:02.611Z","avatar_url":"https://github.com/sahil-172002.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏏 Cricket Player Management API\n\nThis is a backend API built with **Node.js**, **Express.js**, and **MySQL** for managing cricket player data, including creating, retrieving, updating, and deleting player information.\n\n---\n\n## 🚀 Features\n\n- **Create Player:** Add new players with details like name, age, team, and position.  \n- **Retrieve Players:** Get all players or a specific player by ID.  \n- **Update Player:** Modify existing player details.  \n- **Delete Player:** Remove a player from the database.\n\n---\n\n## 🛠️ Tech Stack\n\n- **Backend:** Node.js, Express.js  \n- **Database:** MySQL  \n- **Environment Variables:** dotenv  \n- **Dev Tools:** Nodemon  \n\n---\n\n## 📂 Project Structure\n\n\n---\n\n## ⚙️ Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/your-username/player-backend.git\n    cd player-backend\n    ```\n\n2. Install dependencies:\n    ```bash\n    npm install\n    ```\n\n3. Create a `.env` file in the root directory with the following:\n    ```env\n    DB_HOST=your_host\n    DB_USER=your_username\n    DB_PASSWORD=your_password\n    DB_NAME=your_database_name\n    PORT=5000\n    ```\n\n4. Start the development server:\n    ```bash\n    npm run dev\n    ```\n\n---\n\n## 📋 API Endpoints\n\n### ➕ Create a Player\n- **URL:** `/api/players`\n- **Method:** `POST`\n- **Payload (JSON):**\n    ```json\n    {\n      \"name\": \"John Doe\",\n      \"age\": 25,\n      \"team\": \"Team A\",\n      \"position\": \"Batsman\"\n    }\n    ```\n- **Response:**\n    ```json\n    {\n      \"message\": \"Player created successfully\",\n      \"playerId\": 1\n    }\n    ```\n\n---\n\n### 🔍 Get All Players\n- **URL:** `/api/players`\n- **Method:** `GET`\n- **Response:**\n    ```json\n    [\n      {\n        \"id\": 1,\n        \"name\": \"John Doe\",\n        \"age\": 25,\n        \"team\": \"Team A\",\n        \"position\": \"Batsman\"\n      }\n    ]\n    ```\n\n---\n\n### 🔍 Get Player by ID\n- **URL:** `/api/players/:id`\n- **Method:** `GET`\n- **Example:** `/api/players/1`\n- **Response:**\n    ```json\n    {\n      \"id\": 1,\n      \"name\": \"John Doe\",\n      \"age\": 25,\n      \"team\": \"Team A\",\n      \"position\": \"Batsman\"\n    }\n    ```\n\n---\n\n### ✏️ Update Player\n- **URL:** `/api/players/:id`\n- **Method:** `PUT`\n- **Payload (JSON):**\n    ```json\n    {\n      \"name\": \"Jane Doe\",\n      \"age\": 26\n    }\n    ```\n- **Response:**\n    ```json\n    {\n      \"message\": \"Player updated successfully\"\n    }\n    ```\n\n---\n\n### ❌ Delete Player\n- **URL:** `/api/players/:id`\n- **Method:** `DELETE`\n- **Response:**\n    ```json\n    {\n      \"message\": \"Player deleted successfully\"\n    }\n    ```\n\n---\n\n## 🗃️ Database Schema\n\n```sql\nCREATE TABLE players (\n  id INT PRIMARY KEY AUTO_INCREMENT,\n  name VARCHAR(100),\n  age INT,\n  team VARCHAR(100),\n  position VARCHAR(100),\n  matches_played INT DEFAULT 0,\n  runs_scored INT DEFAULT 0,\n  wickets_taken INT DEFAULT 0,\n  batting_average FLOAT DEFAULT 0,\n  bowling_average FLOAT DEFAULT 0,\n  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahil-172002%2Fplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahil-172002%2Fplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahil-172002%2Fplayer/lists"}