{"id":15377340,"url":"https://github.com/alpgokcek/perfanalyticsapi","last_synced_at":"2026-04-08T20:50:37.260Z","repository":{"id":100748478,"uuid":"369827473","full_name":"alpgokcek/PerfAnalyticsAPI","owner":"alpgokcek","description":"PerfAnalytics.API is a restful API which saves data, posted from PerfAnalytics.JS and returns time specific filtered data.","archived":false,"fork":false,"pushed_at":"2021-05-23T10:03:54.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T22:18:56.926Z","etag":null,"topics":["docker","jest","mongodb","nodejs","postman","travis-ci","typescript"],"latest_commit_sha":null,"homepage":"https://api-perf-analytics.herokuapp.com","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/alpgokcek.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":"2021-05-22T14:23:39.000Z","updated_at":"2021-05-23T10:09:48.000Z","dependencies_parsed_at":"2023-06-09T13:15:29.941Z","dependency_job_id":null,"html_url":"https://github.com/alpgokcek/PerfAnalyticsAPI","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"469584f9a6b8633a5b23cef1b1d46a994912d946"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alpgokcek/PerfAnalyticsAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpgokcek%2FPerfAnalyticsAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpgokcek%2FPerfAnalyticsAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpgokcek%2FPerfAnalyticsAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpgokcek%2FPerfAnalyticsAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alpgokcek","download_url":"https://codeload.github.com/alpgokcek/PerfAnalyticsAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpgokcek%2FPerfAnalyticsAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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","jest","mongodb","nodejs","postman","travis-ci","typescript"],"created_at":"2024-10-01T14:10:43.339Z","updated_at":"2026-04-08T20:50:37.238Z","avatar_url":"https://github.com/alpgokcek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Typescript](https://img.shields.io/badge/Typescript-4.2.4-72147e?style=flat-square\u0026logo=typescript\u0026logoColor=white)\n![Docker](https://img.shields.io/badge/Docker-3.3.2-f21170?style=flat-square\u0026logo=docker\u0026logoColor=white)\n![Node.js](https://img.shields.io/badge/Node.js-14.4-fa9905?style=flat-square\u0026logo=javascript\u0026logoColor=white)\n![npm](https://img.shields.io/badge/npm-7.6-ff5200?style=flat-square\u0026logo=npm\u0026logoColor=white)\n![yarn](https://img.shields.io/badge/yarn-1.22.4-72147e?style=flat-square\u0026logo=yarn\u0026logoColor=white)\n![swagger](https://img.shields.io/badge/swagger-2.0-f21170?style=flat-square\u0026logo=swagger\u0026logoColor=white)\n![express](https://img.shields.io/badge/express-4.17.1-fa9905?style=flat-square\u0026logo=express\u0026logoColor=white)\n![MongoDB](https://img.shields.io/badge/MongoDB-4.4.6-ff5200?style=flat-square\u0026logo=mongodb\u0026logoColor=white)\n\n# PerfAnalyticsAPI\n\nPerfAnalytics.API is a restful API which saves data, posted from PerfAnalytics.JS and returns time specific filtered data. Application is deployed to Heroku and could be found on [api-perf-analytics.herokuapp.com](https://api-perf-analytics.herokuapp.com).\n\n## Table of Contents:\n\n- [Getting Started](#getting-started)\n  - [Requirements](#requirements)\n  - [With Docker](#with-docker)\n  - [Without Docker](#without-docker)\n- [Building the Project](#building-the-project)\n- [Running the Tests](#running-the-tests)\n- [Environment Variables](#environment-variables)\n- [API Endpoints and Documentations](#api-endpoints-and-documentations)\n  - [GET `/metrics`](#get-metrics)\n  - [POST `/metrics`](#post-metrics)\n- [Contact Information](#contact-information)\n- [License](#license)\n\n\u003cbr/\u003e\n\n## Getting Started\n\n\u003chr/\u003e\n\n### Requirements:\n\n\u003chr/\u003e\n\n- MongoDB v4.4 or higher -\u003e [mongoDB Installation Page](https://docs.mongodb.com/manual/installation)\n- Node v12 or higher (with npm) -\u003e [Node.js Downloads Page](https://nodejs.org/en/download)\n- Yarn Package Manager -\u003e Install yarn with npm: `npm install -g yarn`\n- Docker v3.3.2 or higher (optional) -\u003e [Docker Get Started Page](https://www.docker.com/get-started)\n  \u003cbr/\u003e\n\n  Before starting the application, fork/download/clone this repo. There are two different ways to run the application:\n\n\u003chr/\u003e\n\n### With Docker\n\n\u003chr/\u003e\n\n- Build the docker image with the following code:\n\n```\n./docker-build.sh  # for mac users\n./docker-build.bat  # for windows users\n```\n\n- To run the application on [localhost:8080](http://localhost:8080):\n\n```\ndocker-compose up -d --build\n```\n\n- To stop the application:\n\n```\ndocker-compose stop\n```\n\n### Without Docker\n\n\u003chr/\u003e\n\n- Install the required dependencies:\n\n```\nyarn install\n```\n\n- To run the application in dev mode on [localhost:5000](http://localhost:5000):\n\n```\nyarn run dev\n```\n\n- To run the application with the production build on [localhost:5000](http://localhost:5000):\n\n```\nyarn build  # producing a production build\ncp -r src/swagger dist/src  # copy swagger config to dist\nyarn start  # running the server\n```\n\n\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## Building the Project\n\n\u003chr/\u003e\n\n- To create an optimized production build:\n\n```\nnpm run build\n```\n\nor\n\n```\nyarn build\n```\n\n\u003cbr/\u003e\n\n## Running the Tests\n\n\u003chr/\u003e\n\n- To run the unit tests:\n\n```\nnpm test\n```\n\nor\n\n```\nyarn test\n```\n\n- To run the load tests:\n\n```\nnpm run artillary-local  # use artillary-prod for heroku app\n```\n\nor\n\n```\nyarn run artillary-local  # use artillary-prod for heroku app\n```\n\n\u003cbr/\u003e\n\n## Environment Variables\n\n\u003chr/\u003e\n\n- `DB_URI`: MongoDB URI. An example could be found below.\n\n```\nmongodb+srv://\u003cdb-user\u003e:\u003cdb-pass\u003e@\u003ccluster-address\u003e/\u003cdb-name\u003e?retryWrites=true\u0026w=majority\n```\n\n- `PORT`: Port of the server.\n\n\u003cbr/\u003e\n\u003chr/\u003e\n\n## API Endpoints and Documentations\n\nREST API endpoints documentation. For further information, you can check out the Postman Collections \u0026 Environments at `postman` directory and the Swagger Documentation from `/swagger` endpoint.\n`/metrics` endpoint can handle 266.67 requests per second on a:\n\n- MacBook Pro (16-inch, 2019)\n  - Processor: 2,3 GHz 8-Core Intel Core i9\n  - Memory: 16 GB 2667 MHz\n  - Number of Processors: 1\n  - Total Number of Cores: 8\n  - L2 Cache (per Core): 256 KB\n  - L3 Cache: 16 MBDDR4\n\nFor further information, checkout `load-testing-report.json` file.\n\n\u003chr/\u003e\n\n### GET `/metrics`\n\n- Description: Get Metrics from last 30 minutes or within a time range.\n- Query Parameters:\n  - `startDate`: Start date of the time range. Must be in ISO8601 format. E.g. 2021-05-10T00:00:00.000Z\n  - `endDate`: End date of the time range. Must be in ISO8601 format. E.g. 2021-05-10T00:00:00.000Z\n\n#### Reponse:\n\n```\n{\n    \"data\": [\n        {\n            \"id\": string,\n            \"url\": string,\n            \"ttfb\": number,\n            \"fcp\": number,\n            \"domLoad\": number,\n            \"windowLoadEvents\": number,\n            \"resources\": [\n                {\n                    \"name\": string\n                    \"source\": string\n                    \"responseTime\": number\n                    \"executionTime\": number\n                    \"fetchTime\": number\n                }\n            ],\n            \"timestamp\": string\n        }\n    ]\n}\n```\n\n\u003chr/\u003e\n\n### POST `/metrics`\n\n- Description: Create new Metric.\n\n\u003cbr/\u003e\n\n#### Request Body:\n\n```\n{\n    \"url\": string,\n    \"ttfb\": number,\n    \"fcp\": number,\n    \"domLoad\": number,\n    \"windowLoadEvents\": number,\n    \"resources\": [\n        {\n            \"name\": string\n            \"source\": string\n            \"responseTime\": number\n            \"executionTime\": number\n            \"fetchTime\": number\n        }\n    ],\n    \"timestamp\": string\n}\n```\n\n\u003cbr/\u003e\n\n#### Reponse:\n\n```\n{\n    \"id\": string\n}\n```\n\n\u003chr/\u003e\n\n## Contact Information\n\n\u003chr/\u003e\n\n#### Author: Alp Gökçek\n\n#### Github: alpgokcek\n\n#### Email: alp.gokcek1@gmail.com\n\n#### Date: May, 2021\n\n\u003cbr/\u003e\n\n## License\n\n\u003chr/\u003e\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpgokcek%2Fperfanalyticsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falpgokcek%2Fperfanalyticsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpgokcek%2Fperfanalyticsapi/lists"}