{"id":23150173,"url":"https://github.com/YadamVinay369/CVE_Server","last_synced_at":"2025-08-17T19:31:56.978Z","repository":{"id":268567487,"uuid":"904748077","full_name":"YadamVinay369/CVE_Server","owner":"YadamVinay369","description":"Backend code providing APIs for CVE dashboard","archived":false,"fork":false,"pushed_at":"2025-01-10T18:00:41.000Z","size":574,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T07:15:25.175Z","etag":null,"topics":["api-rest","cors","expressjs","jest","mongoose","mvc-pattern","nodejs","supertest","unit-testing"],"latest_commit_sha":null,"homepage":"https://securinserver.onrender.com","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/YadamVinay369.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":"2024-12-17T13:31:45.000Z","updated_at":"2025-01-10T18:10:43.000Z","dependencies_parsed_at":"2024-12-17T15:38:25.599Z","dependency_job_id":"a407b635-94f2-476f-a210-ccf08e265d24","html_url":"https://github.com/YadamVinay369/CVE_Server","commit_stats":null,"previous_names":["yadamvinay369/securinserver","yadamvinay369/cve_server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YadamVinay369/CVE_Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YadamVinay369%2FCVE_Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YadamVinay369%2FCVE_Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YadamVinay369%2FCVE_Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YadamVinay369%2FCVE_Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YadamVinay369","download_url":"https://codeload.github.com/YadamVinay369/CVE_Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YadamVinay369%2FCVE_Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270898225,"owners_count":24664700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-rest","cors","expressjs","jest","mongoose","mvc-pattern","nodejs","supertest","unit-testing"],"created_at":"2024-12-17T18:16:37.309Z","updated_at":"2025-08-17T19:31:56.931Z","avatar_url":"https://github.com/YadamVinay369.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CVE server\n\nThis project mainly aims to utilize the CVE data available in National Vulnerability Database, perform data cleansing,data de-duplication and store it in mongoose database and perform daily updates.Provides APIs to fetch, store, and manage CVE (Common Vulnerabilities and Exposures) data.\n\n- API link used: https://services.nvd.nist.gov/rest/json/cves/2.0\n- Fetched the CVE data in chunks of around 2000 records per request synchronously\n- API request is being hit 3 times per each chunk to establish proper connection\n- fetching and auto-update of records will be scheduled automatically daily at 02:00 AM(customizable)\n- stored the data using bulkWrite into monogoDB(mongoose) database.\n\nDeployed link: https://securinserver.onrender.com/\n\n## Salient Features\n\n- RESTful APIs to fetch CVE data.\n- Pagination support for large datasets.\n- Filter data based on parameters\n- Get sorted data based on published year or lastModified year\n- Customizable results per page.\n- Auto-Update of records daily at 02:00 AM using node-cron\n- Data storage using MongoDB(mongoose).\n- Environment variable support for secure configurations\n\n## Tech Stack\n\n- Node.js - JavaScript runtime.\n- Express.js - Web framework for Node.js.\n- MongoDB - NoSQL database.\n- Mongoose - online version of MongoDB.\n- dotenv - Environment variable management.\n- Jest - JavaScript testing framework.\n\n## Install Packages and Run the App\n\n- Clone the repository\n\n```bash\n  git clone https://github.com/YadamVinay369/SecurinServer.git\n```\n\n- Install dependencies\n\n```bash\n  npm install\n```\n\n- Create a `.env` file in the root directory.\n- Add the following configuration:\n\n```bash\n PORT=8000\n MONGODB_URI=your_mongodb_connection_string\n```\n\n- Run the server\n\n```bash\n  npm start\n```\n\n- Or for development:\n\n```bash\n  npm run dev\n```\n\n- Server will run at: http://localhost:8000\n\n## API Reference\n\n#### Get all CVEs\n\n```http\n  GET /api/cve\n```\n\n![Screenshot of getCVE postman ](./screenshots/getCVE.png)\n\n#### Get all CVEs with page and limit\n\n```http\n  GET /api/cve?page=1\u0026limit=10\n```\n\n![Screenshot of getCVEbyPageAndLimit postman ](./screenshots/getCVEbyPageAndLimit.png)\n\n#### Get CVE based on `id`\n\n```http\n  GET /api/cve/:id\n```\n\n| Parameter | Type     | Description                      |\n| :-------- | :------- | :------------------------------- |\n| `id`      | `string` | **Required**. Id of CVE to fetch |\n\n![Screenshot of getCVEbyID postman ](./screenshots/getCVEbyID.png)\n\n#### Get CVE based on published `year`\n\n```http\n  GET /api/cve/year/:year\n```\n\n| Parameter | Type     | Description                         |\n| :-------- | :------- | :---------------------------------- |\n| `year`    | `string` | **Required**. published year of CVE |\n\n![Screenshot of getCVEbyYear postman ](./screenshots/getCVEbyYear.png)\n\n#### Get CVE based on `baseScore`\n\n```http\n  GET /api/cve/score/:score\n```\n\n| Parameter | Type     | Description                    |\n| :-------- | :------- | :----------------------------- |\n| `score`   | `string` | **Required**. baseScore of CVE |\n\n![Screenshot of getCVEbyBaseScore postman ](./screenshots/getCVEbyBaseScore.png)\n\n#### Get CVE based on `range`\n\n```http\n  GET /api/cve/lastModified/:range\n```\n\n| Parameter | Type     | Description                            |\n| :-------- | :------- | :------------------------------------- |\n| `range`   | `string` | **Required**. range of values to fetch |\n\n![Screenshot of getCVEbyBaseScore postman ](./screenshots/getCVEbyRange.png)\n\n#### filter CVEs by passing queries in the API\n\n```http\n  GET /api/cve?page=1\u0026limit=3\u0026score=10\u0026year=1988\u0026days=65\n```\n\n![Screenshot of getCVEbyPageAndLimit postman ](./screenshots/filterCVE.png)\n\n## Running Tests\n\n- Install Jest (if not already installed):\n\n```bash\n  npm install jest --save-dev\n```\n\n- Run the tests:\n\n```bash\n  npm test\n```\n\n- Tests are located in the `__tests__` folder, including:\n\n- Unit tests for `getCVEController` logic is present in `__tests__\\getCVEController.test.js`.\n- Unit tests for `getCVEControllerByID` logic is present in `__tests__\\getCVEControllerByID.test.js`.\n- Unit tests for `getCVEControllerByYear` logic is present in `__tests__\\getCVEControllerByYear.test.js`.\n- Unit tests for `getCVEControllerByScore` logic is present in `__tests__\\getCVEControllerByScore.test.js`.\n- Unit tests for `getCVEControllerByRange` logic is present in `__tests__\\getCVEControllerByRange.test.js`.\n\n![Screenshot of unit tests ](./screenshots/unitTests.png)\n\n## Dependencies\n\n- express: Fast and minimal web framework.\n- mongoose: MongoDB object modeling.\n- dotenv: Load environment variables.\n- axios: For external API requests.\n- jest: JavaScript testing framework for unit testing.\n- supertest: For testing HTTP requests.\n- node-cron: For time-scheduling and auto-update in the database\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYadamVinay369%2FCVE_Server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYadamVinay369%2FCVE_Server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYadamVinay369%2FCVE_Server/lists"}