{"id":17675676,"url":"https://github.com/hasantezcan/perfanalytics-api","last_synced_at":"2026-05-11T06:01:44.597Z","repository":{"id":100580448,"uuid":"387154519","full_name":"hasantezcan/PerfAnalytics-API","owner":"hasantezcan","description":"PerfAnalytics API, record metric comes from PerfAnalytics JS. And serves to PerfAnalytics Dashboard for display them.","archived":false,"fork":false,"pushed_at":"2021-07-25T10:48:43.000Z","size":1153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T19:01:03.452Z","etag":null,"topics":["analytics","expressjs","rest-api","typescript"],"latest_commit_sha":null,"homepage":"https://perfanalytics-api-ht.herokuapp.com/api","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/hasantezcan.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-07-18T11:02:24.000Z","updated_at":"2023-03-08T23:22:12.000Z","dependencies_parsed_at":"2023-05-16T01:15:22.930Z","dependency_job_id":null,"html_url":"https://github.com/hasantezcan/PerfAnalytics-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasantezcan%2FPerfAnalytics-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasantezcan%2FPerfAnalytics-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasantezcan%2FPerfAnalytics-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasantezcan%2FPerfAnalytics-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasantezcan","download_url":"https://codeload.github.com/hasantezcan/PerfAnalytics-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246351017,"owners_count":20763232,"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","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":["analytics","expressjs","rest-api","typescript"],"created_at":"2024-10-24T07:23:06.846Z","updated_at":"2026-05-11T06:01:44.518Z","avatar_url":"https://github.com/hasantezcan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PerfAnalytics API\n\nPerfAnalytics API is part of PerfAnalytics ecosystem which collects and criticizes web performance data.\n\n**PerfAnalytics API,** record metric comes from [**PerfAnalytics JS**](https://github.com/hasantezcan/PerfAnalytics-js). And serves to [PerfAnalytics Dashboard](https://github.com/hasantezcan/PerfAnalytics-Dashboard) for display them.\n\n## Tech Stack\n\n- Developed with [ExpressJs](http://expressjs.com/)\n- Used [Typescript](https://www.typescriptlang.org/).\n- Used [MongoDB](https://www.mongodb.com) to record metrics.\n- Deployed with [Heroku](https://www.heroku.com/).\n  - [Click for](https://github.com/hasantezcan/PerfAnalytics-API/deployments/activity_log?environment=perfanalytics-api-ht) Deployment logs!  \n\n\u003e **Dockerfile** is ready if you want to use the dockerized version you can use it!\n---\n# REST API\n\n## `POST` Create metric\n\n### Request\n\n`POST /api/metrics`\n\n```bash\n curl -X POST -H \"Content-Type: text/plain\" \\\n    -d '{\n    \"URL\": \"https://hasantezcan.dev\",\n    \"UserAgent\": \"Iphone 12\",\n    \"FCP\": 1.11,\n    \"TTFB\": 1.12,\n    \"DomLoad\": 0.0510,\n    \"WindowLoad\": 0.512,\n    \"Entries\": []\n}' \\\n    https://perfanalytics-api-ht.herokuapp.com/api/metrics\n```\n### Response\n\n```bash\n{\n  \"_id\": \"60fac5c7941cbc0015ae1715\",\n  \"URL\": \"https://hasantezcan.dev\",\n  \"UserAgent\": \"Iphone 12\",\n  \"FCP\": 1.11,\n  \"TTFB\": 1.12,\n  \"DomLoad\": 0.051,\n  \"WindowLoad\": 0.512,\n  \"Entries\": [],\n  \"createdAt\": \"2021-07-23T13:36:07.602Z\",\n  \"updatedAt\": \"2021-07-23T13:36:07.602Z\",\n  \"__v\": 0\n}\n\n```\n\n## `GET` Get all metrics\n\n### Request\n\n`GET /api/metrics`\n\n```bash\ncurl -i -H 'Accept: application/json' https://perfanalytics-api-ht.herokuapp.com/api/metrics\n```\n\n- **`start:`** **ISO 8601 Date** \n- **`end:`** **ISO 8601 Date** \n\n```bash\ncurl -G --data-urlencode \"start=2021-07-23T13:26:26.166Z\" --data-urlencode \"end=2021-07-23T14:26:26.166Z\" https://perfanalytics-api-ht.herokuapp.com/api/metrics\n```\n\n### Response\n\n```bash\nHTTP/1.1 200 OK\nServer: Cowboy\nConnection: keep-alive\nX-Powered-By: Express\nVary: Origin\nContent-Type: application/json; charset=utf-8\nContent-Length: 13011\nEtag: W/\"32d3-WY5+bz9yxUPt+/f8gpTAF62L5Og\"\nDate: Fri, 23 Jul 2021 13:17:56 GMT\nVia: 1.1 vegur\n\n\n[\n    {\n        \"_id\": \"60fabed8941cbc0015ae1705\",\n        \"UserAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36\",\n        \"URL\": \"https://react-metrics.netlify.app/\",\n        \"TTFB\": 0.056530000001657754,\n        \"DomLoad\": 0.5764300000009825,\n        \"WindowLoad\": 0.5764699999999721,\n        \"FCP\": 0.4420200000022305,\n        \"Entries\": [\n            {\n                \"name\": \"https://react-metrics.netlify.app/static/css/main.8c8b27cf.chunk.css\",\n                \"initiatorType\": \"link\",\n                \"responseEnd\": 0.2477900000012596,\n                \"transferSize\": 910\n            },\n            {\n                \"name\": \"https://hasantezcan.github.io/PerfAnalytics-Js/src/index.js\",\n                \"initiatorType\": \"script\",\n                \"responseEnd\": 0.24904000000242377,\n                \"transferSize\": 0\n            },\n            {\n                \"name\": \"https://react-metrics.netlify.app/static/js/2.0f1148b1.chunk.js\",\n                \"initiatorType\": \"script\",\n                \"responseEnd\": 0.24632500000006985,\n                \"transferSize\": 40789\n            },\n            {\n                \"name\": \"https://react-metrics.netlify.app/static/js/main.5113f01c.chunk.js\",\n                \"initiatorType\": \"script\",\n                \"responseEnd\": 0.29684500000439584,\n                \"transferSize\": 714\n            },\n            {\n                \"name\": \"https://react-metrics.netlify.app/static/media/logo.6ce24c58.svg\",\n                \"initiatorType\": \"img\",\n                \"responseEnd\": 0.49205000000074506,\n                \"transferSize\": 1331\n            },\n            {\n                \"name\": \"https://react-metrics.netlify.app/favicon.ico\",\n                \"initiatorType\": \"img\",\n                \"responseEnd\": 0.5317900000009104,\n                \"transferSize\": 3979\n            }\n        ],\n        \"createdAt\": \"2021-07-23T13:06:32.288Z\",\n        \"updatedAt\": \"2021-07-23T13:06:32.288Z\",\n        \"__v\": 0\n    }\n]\n```\n\n## `GET` Geta all URL metrics\n\n\u003e Get all metrics record sorted by URL\n\n### Request\n\n`GET /api/metrics-by-url`\n\n```bash\ncurl -i -H 'Accept: application/json' https://perfanalytics-api-ht.herokuapp.com/api/metrics-by-url\n```\n\n- **`start:`** **ISO 8601 Date** \n- **`end:`** **ISO 8601 Date** \n\n```bash\ncurl -G --data-urlencode \"start=2021-07-23T13:26:26.166Z\" --data-urlencode \"end=2021-07-23T14:26:26.166Z\" https://perfanalytics-api-ht.herokuapp.com/api/metrics-by-url\n```\n### Response\n\n```bash\nHTTP/1.1 200 OK\nServer: Cowboy\nConnection: keep-alive\nX-Powered-By: Express\nVary: Origin\nContent-Type: application/json; charset=utf-8\nContent-Length: 2625\nEtag: W/\"a41-naajhMnCdRUUgBtb6dnWLmnE9a8\"\nDate: Fri, 23 Jul 2021 13:17:30 GMT\nVia: 1.1 vegur\n\n\n[\n    {\n        \"URL\": \"https://react-metrics.netlify.app/\",\n        \"TTFB\": [\n            {\n                \"time\": \"2021-07-23T13:06:20.621Z\",\n                \"value\": 0.11462000000028638\n            }\n        ],\n        \"FCP\": [\n            {\n                \"time\": \"2021-07-23T13:06:32.288Z\",\n                \"value\": 0.4420200000022305\n            }\n        ],\n        \"DomLoad\": [\n            {\n                \"time\": \"2021-07-23T13:06:20.621Z\",\n                \"value\": 1.187725000003411\n            }\n        ],\n        \"WindowLoad\": [\n            {\n                \"time\": \"2021-07-23T13:06:20.621Z\",\n                \"value\": 1.1877750000057858\n            }\n        ]\n    }\n]\n```\n\n\n## `GET` Health check\n\n### Request\n\n`GET /api/healthcheck`\n\n```bash\ncurl -i -H 'Accept: application/json' https://perfanalytics-api-ht.herokuapp.com/api/healthcheck\n```\n### Response\n\n```bash\nHTTP/1.1 200 OK\nServer: Cowboy\nConnection: keep-alive\nX-Powered-By: Express\nVary: Origin\nContent-Type: application/json; charset=utf-8\nContent-Length: 13011\nEtag: W/\"32d3-WY5+bz9yxUPt+/f8gpTAF62L5Og\"\nDate: Fri, 23 Jul 2021 13:17:56 GMT\nVia: 1.1 vegur\n\n\nOK\n```\n\n---\n\n## Dev Logs\n\nYou can reach my [**`dev logs`**](DEVLOGS.md) about this project! \n\n## Commit message convention\n\nI use [this](https://www.conventionalcommits.org) commit message conventions standard in this project.\n\u003e https://www.conventionalcommits.org\n \n## License\n\n[MIT](/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasantezcan%2Fperfanalytics-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasantezcan%2Fperfanalytics-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasantezcan%2Fperfanalytics-api/lists"}