{"id":18498959,"url":"https://github.com/sjdonado/nestjs-bull-github","last_synced_at":"2026-05-06T04:07:45.720Z","repository":{"id":206391107,"uuid":"716533700","full_name":"sjdonado/nestjs-bull-github","owner":"sjdonado","description":"An endpoint that returns the GitHub top-rated repositories","archived":false,"fork":false,"pushed_at":"2023-11-09T10:39:34.000Z","size":557,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T04:24:42.147Z","etag":null,"topics":["docker","nestjs","redis","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sjdonado.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":"2023-11-09T10:37:29.000Z","updated_at":"2023-11-09T10:38:21.000Z","dependencies_parsed_at":"2023-11-16T02:45:34.963Z","dependency_job_id":null,"html_url":"https://github.com/sjdonado/nestjs-bull-github","commit_stats":null,"previous_names":["sjdonado/nestjs-bull-github"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sjdonado/nestjs-bull-github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjdonado%2Fnestjs-bull-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjdonado%2Fnestjs-bull-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjdonado%2Fnestjs-bull-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjdonado%2Fnestjs-bull-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjdonado","download_url":"https://codeload.github.com/sjdonado/nestjs-bull-github/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjdonado%2Fnestjs-bull-github/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"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":["docker","nestjs","redis","sqlite3"],"created_at":"2024-11-06T13:43:04.973Z","updated_at":"2026-05-06T04:07:45.697Z","avatar_url":"https://github.com/sjdonado.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Architecture\n\n```mermaid\ngraph TD\n  subgraph \"Client Browser\"\n    A[http://localhost:3000/search]\n  end\n\n  subgraph \"Nest.js Application\"\n    B[Search Controller]\n    C[GitHub Data Controller]\n    D[Job Queue]\n    E[SQLite Database]\n    F[GitHub Raw Files CSV]\n  end\n\n  subgraph \"Dispatch Github Jobs\"\n    G[http://localhost:3000/github-data/sync]\n  end\n\n  A --\u003e|HTTP Request| B\n  C --\u003e|HTTP Request| D\n  D --\u003e|Job Processing| E\n  F --\u003e|Data Sync| D\n  E --\u003e|Data Retrieval| B\n  G --\u003e|HTTP Request| D\n\n  style A fill:#FFD700\n  style B fill:#87CEEB\n  style C fill:#87CEEB\n  style D fill:#90EE90\n  style E fill:#90EE90\n  style F fill:#FFA07A\n  style G fill:#FFD700\n```\n\n- The application has two main controllers: Search Controller for handling search requests and GitHub Data Controller for triggering data sync jobs.\n- The GitHub Data Controller interacts with a job queue (using nestjs/bull with Redis) to enqueue jobs for downloading and processing GitHub data for specific dates.\n- The Job Queue (Job Queue (Bull/Redis)) processes jobs asynchronously, downloading CSV files from the GitHub API (GitHub API), parsing the data, and storing it in an SQLite database (SQLite Database).\n- The Search Controller retrieves data from the SQLite database based on user queries through the search endpoint (http://localhost:3000/search).\n- Users interact with the application through the client browser, sending HTTP requests to the appropriate endpoints.\n\n# Endpoints\n\n| Endpoint         | Method | URL                                                                              | Description                                                                                                                                    | Query Parameters                                                                                                                                                                                                                   |\n| ---------------- | ------ | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Search           | GET    | [http://localhost:3000/search](http://localhost:3000/search)                     | Retrieve and filter repositories based on specific criteria.                                                                                   | - `date`: The date of the ranking in the format \"YYYY-MM-DD\" (e.g., 2019-02-22).\u003cbr/\u003e- `language`: The programming language to filter by (case-insensitive).\u003cbr/\u003e- `limit`: The maximum number of values the endpoint will return. |\n| GitHub Data Sync | POST   | [http://localhost:3000/github-data/sync](http://localhost:3000/github-data/sync) | Start jobs that download CSV files from the [GitHub Ranking](https://raw.githubusercontent.com/EvanLi/Github-Ranking/master/Data/) repository. | - None                                                                                                                                                                                                                             |\n\n### Responses\n\n`POST http://localhost:3000/github-data/sync`\n\n```json\n{\n  \"message\": \"1787 jobs created.\"\n}\n```\n\n`GET http://localhost:3000/search?date=2018-12-30\u0026language=javaScript\u0026limit=5`\n\n```json\n[\n  {\n    \"id\": 113446,\n    \"rank\": 1,\n    \"item\": \"top-100-stars\",\n    \"repoName\": \"freeCodeCamp\",\n    \"stars\": 296724,\n    \"forks\": 20675,\n    \"language\": \"JavaScript\",\n    \"repoUrl\": \"https://github.com/freeCodeCamp/freeCodeCamp\",\n    \"username\": \"freeCodeCamp\",\n    \"issues\": 5969,\n    \"lastCommit\": \"2018-12-30T03:33:39Z\",\n    \"description\": \"The https://www.freeCodeCamp.org open source codebase and curriculum. Learn to code for free together with millions of people.\",\n    \"reportDate\": \"2018-12-30\"\n  },\n  {\n    \"id\": 113448,\n    \"rank\": 3,\n    \"item\": \"top-100-stars\",\n    \"repoName\": \"vue\",\n    \"stars\": 123494,\n    \"forks\": 17666,\n    \"language\": \"JavaScript\",\n    \"repoUrl\": \"https://github.com/vuejs/vue\",\n    \"username\": \"vuejs\",\n    \"issues\": 207,\n    \"lastCommit\": \"2018-12-29T12:27:43Z\",\n    \"description\": \"🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.\",\n    \"reportDate\": \"2018-12-30\"\n  },\n  {\n    \"id\": 113449,\n    \"rank\": 4,\n    \"item\": \"top-100-stars\",\n    \"repoName\": \"react\",\n    \"stars\": 118660,\n    \"forks\": 21514,\n    \"language\": \"JavaScript\",\n    \"repoUrl\": \"https://github.com/facebook/react\",\n    \"username\": \"facebook\",\n    \"issues\": 527,\n    \"lastCommit\": \"2018-12-29T01:11:04Z\",\n    \"description\": \"A declarative, efficient, and flexible JavaScript library for building user interfaces.\",\n    \"reportDate\": \"2018-12-30\"\n  },\n  {\n    \"id\": 113454,\n    \"rank\": 9,\n    \"item\": \"top-100-stars\",\n    \"repoName\": \"d3\",\n    \"stars\": 81304,\n    \"forks\": 20205,\n    \"language\": \"JavaScript\",\n    \"repoUrl\": \"https://github.com/d3/d3\",\n    \"username\": \"d3\",\n    \"issues\": 9,\n    \"lastCommit\": \"2018-12-19T13:16:30Z\",\n    \"description\": \"Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:\",\n    \"reportDate\": \"2018-12-30\"\n  },\n  {\n    \"id\": 113455,\n    \"rank\": 10,\n    \"item\": \"top-100-stars\",\n    \"repoName\": \"javascript\",\n    \"stars\": 79991,\n    \"forks\": 15287,\n    \"language\": \"JavaScript\",\n    \"repoUrl\": \"https://github.com/airbnb/javascript\",\n    \"username\": \"airbnb\",\n    \"issues\": 133,\n    \"lastCommit\": \"2018-12-28T22:32:13Z\",\n    \"description\": \"JavaScript Style Guide\",\n    \"reportDate\": \"2018-12-30\"\n  }\n]\n```\n\n# Setup\n\n## Dependencies\n\n- Redis (if not installed locally run `docker-compose up`)\n\n## Installation\n\n```bash\n$ yarn\n```\n\n## Env variables\n\n```bash\n$ cp .env.example .env\n```\n\n## Running the app\n\nMake sure to run first `POST http://localhost:3000/github-data/sync` before to query data.\n\n```bash\n# development\n$ yarn start\n\n# watch mode\n$ yarn start:dev\n\n# production mode\n$ yarn start:prod\n```\n\n## Test\n\n```bash\n# unit tests\n$ npm run test\n\n# e2e tests\n$ npm run test:e2e\n\n# test coverage\n$ npm run test:cov\n```\n\n## Future work\n\n- Consistent schema responses `(erros: { message }, success: { data })`.\n- Cache fetch request\n- Sync endpoint fetch the missing data (check first in the DB which dates are missing)\n- The fetch endpoint allows for a range of dates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjdonado%2Fnestjs-bull-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjdonado%2Fnestjs-bull-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjdonado%2Fnestjs-bull-github/lists"}