{"id":21508580,"url":"https://github.com/aleexcif/github-repository-stats-api","last_synced_at":"2026-04-17T01:03:07.080Z","repository":{"id":262408016,"uuid":"887091016","full_name":"aleexcif/github-repository-stats-api","owner":"aleexcif","description":"This API allows users to track and retrieve statistics for specific GitHub repositories. It will fetch and store data like the number of stars, forks, and open issues, allowing periodic updates to keep stats current. This project will demonstrate CRUD operations, external API integration, and data fetching automation.","archived":false,"fork":false,"pushed_at":"2025-05-12T00:42:20.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T01:30:22.536Z","etag":null,"topics":["api","express","github","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://aleexcif.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleexcif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-12T06:34:36.000Z","updated_at":"2025-05-12T00:42:24.000Z","dependencies_parsed_at":"2025-03-18T22:01:04.519Z","dependency_job_id":null,"html_url":"https://github.com/aleexcif/github-repository-stats-api","commit_stats":null,"previous_names":["aleexcif/github-repository-stats-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aleexcif/github-repository-stats-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleexcif%2Fgithub-repository-stats-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleexcif%2Fgithub-repository-stats-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleexcif%2Fgithub-repository-stats-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleexcif%2Fgithub-repository-stats-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleexcif","download_url":"https://codeload.github.com/aleexcif/github-repository-stats-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleexcif%2Fgithub-repository-stats-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31910584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","express","github","nodejs","typescript"],"created_at":"2024-11-23T21:06:52.617Z","updated_at":"2026-04-17T01:03:07.041Z","avatar_url":"https://github.com/aleexcif.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repository Stats API\n\nA RESTful API built with `TypeScript`, `Node.js`, and `SQLite` to track and retrieve GitHub repository statistics such as stars, forks, and open issues.\n\n## Features\n\n- Track GitHub repositories by owner and name\n- Retrieve statistics (stars, forks, open issues) for each tracked repository\n- Update repository stats periodically with `node-cron`\n- Endpoints for adding, retrieving, and deleting tracked repositories\n\n## Prerequisites\n\n- **`Node.js`** v14 or higher\n- **GitHub Personal Access Token** (optional, if you need higher API rate limits)\n\n## Installation\n\n1. **Clone the Repository**:\n   ```zsh\n   git clone https://github.com/aleexcif/github-repository-stats-api.git\n   cd github-repository-stats-api\n   ```\n2. **Install Dependencies**:\n   ```zsh\n   npm install\n   ```\n3. **Set Up Environment Variables**:\n   - Create a .env file to store environment variables (optional).\n     ```\n     GITHUB_TOKEN=your_github_personal_access_token`\n     ```\n4. **Start the Server**:\n   - In development with auto-restart:\n     ```zsh\n     npx ts-node-dev --respawn src/app.ts\n     ```\n   - In production (compile TypeScript and run `Node.js`):\n     ```zsh\n     npx tsc\n     node dist/app.js\n     ```\n\n## Usage\n\n### Endpoints\n\n1. **Add a Repository to Track**:\n   - Method: `POST`\n   - URL: `http://localhost:3000/api/repositories`\n   - curl Command:\n     ```zsh\n     curl -X POST http://localhost:3000/api/repositories \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"owner\": \"ownerName\", \"name\": \"repositoryName\"}'\n     ```\n   - Example Response:\n     ```json\n     {\n       \"message\": \"Repository added successfully\",\n       \"stats\": {\n         \"stars\": 123,\n         \"forks\": 45,\n         \"openIssues\": 10,\n         \"lastUpdated\": \"2024-11-12T08:09:18.417Z\"\n       }\n     }\n     ```\n\n\u003cbr\u003e\n\n2. **Retrieve All Tracked Repositories**:\n   - Method: `GET`\n   - URL: `http://localhost:3000/api/repositories`\n   - curl Command:\n     ```zsh\n     curl -X POST http://localhost:3000/api/repositories\n     ```\n   - Example Response:\n     ```json\n     [\n       {\n         \"id\": 1,\n         \"name\": \"repositoryName\",\n         \"owner\": \"ownerName\",\n         \"stars\": 123,\n         \"forks\": 45,\n         \"openIssues\": 10,\n         \"lastUpdated\": \"2024-11-12T08:09:18.417Z\"\n       },\n       ...\n     ]\n     ```\n\n\u003cbr\u003e\n\n3. **Retrieve Stats for a Specific Repository**\n   - Method: `GET`\n   - URL: `http://localhost:3000/api/repositories/{id}`\n   - curl Command:\n     ```zsh\n     curl -X GET http://localhost:3000/api/repositories/1\n     ```\n   - Example Response:\n     ```json\n     {\n       \"id\": 1,\n       \"name\": \"repositoryName\",\n       \"owner\": \"ownerName\",\n       \"stars\": 123,\n       \"forks\": 45,\n       \"openIssues\": 10,\n       \"lastUpdated\": \"2024-11-12T08:09:18.417Z\"\n     }\n     ```\n\n\u003cbr\u003e\n\n4. **Delete a Repository**\n   - Method: `DELETE`\n   - URL: `http://localhost:3000/api/repositories/{id}`\n   - curl Command:\n     ```zsh\n     curl -X DELETE http://localhost:3000/api/repositories/1\n     ```\n   - Example Response:\n     ```json\n     {\n       \"message\": \"Repository deleted successfully\"\n     }\n     ```\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n\u003e [!NOTE]\n\u003e This should provide a clear overview and easy-to-follow instructions for anyone interested in using this API. Let me know if you’d like me to clarify any sections further!\n\u003e\n\u003e This project is licensed under the MIT License. See the [LICENSE](https://github.com/aleexcif/github-repository-stats-api/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleexcif%2Fgithub-repository-stats-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleexcif%2Fgithub-repository-stats-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleexcif%2Fgithub-repository-stats-api/lists"}