{"id":34525173,"url":"https://github.com/kiva/protocol-reporting","last_synced_at":"2026-05-28T22:31:37.749Z","repository":{"id":39583059,"uuid":"415986651","full_name":"kiva/protocol-reporting","owner":"kiva","description":"Service for various reporting requirements","archived":false,"fork":false,"pushed_at":"2023-02-12T03:14:03.000Z","size":2486,"stargazers_count":1,"open_issues_count":9,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-12-25T16:29:17.307Z","etag":null,"topics":["protocol","protocol-backend"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiva.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":"SECURITY.txt","support":null}},"created_at":"2021-10-11T15:33:09.000Z","updated_at":"2022-01-17T04:18:42.000Z","dependencies_parsed_at":"2022-08-28T22:51:47.533Z","dependency_job_id":null,"html_url":"https://github.com/kiva/protocol-reporting","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kiva/protocol-reporting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiva%2Fprotocol-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiva%2Fprotocol-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiva%2Fprotocol-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiva%2Fprotocol-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiva","download_url":"https://codeload.github.com/kiva/protocol-reporting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiva%2Fprotocol-reporting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33629560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["protocol","protocol-backend"],"created_at":"2025-12-24T05:07:40.173Z","updated_at":"2026-05-28T22:31:37.732Z","avatar_url":"https://github.com/kiva.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protocol-reporting\n\nThis service handles the various reporting requirements that may be required by a specific implementation\nIt is not required for the baseline protocol to work, but is just to facilitate compliance with regulations\nIt provides a DB implementation for storing credential exchange metadata, such as timestamps, auth methods, etc\nwith out exposing any underlying credential data itself.\nIt also exposes a GraphQL API to handle searching, filtering, sorting, etc for accessing the exchange data.\nIt uses the library Nestjs-query which has great [documentation](https://doug-martin.github.io/nestjs-query/docs/graphql/getting-started/)\n\n## Setup\n\nRun:\n```bash\nnpm install\ncp dummy.env .env\n```\n\n## Developing\n\nFor local development it's easiest to run the service directly from your computer and connect to a dockerized DB\n\nYou will also need to update your .env file to reference the DB host using localhost, not the docker network name\n```\nPOSTGRES_HOST=localhost\n```\n\nIn first tab start the DB with ports exposed\n```bash\ndocker compose -f docker-compose.local.yml up\n```\n\nIn second tab start server in dev mode which uses nodemon to auto-restart when it detects changes\n```bash\nnpm run start:dev\n```\n\nThe server will be exposed locally on localhost:3022 and will connect to the dockerized DB\n\n## Production\n\nTo get an idea of how the server will run in production you can spin up the docker-compose which has the production image\nRight now we don't test the production image in circle ci because it takes quite a long time to set up, however, if we \nsee any issues with the production image in the future we can add a prod-test job, and spin up docker-compose with --abort-on-container-exit\nwhich will inform us if there's an issue with the production image\n\nAnd then build and run the docker compose files\n```bash\ndocker compose build\ndocker compose up --abort-on-container-exit\n```\n\n## Graphql\n\nYou can access a convenient graphql GUI at ```localhost:3022/graphql```\nHere are some sample queries\n\nAdd a report:\n```\nmutation {\n  createOneReport(input: {\n    report: {\n      auth_method: \"FINGERPRINT\",\n      verifier_id: \"1\",\n      verifier_user_id: \"abc\",\n      request_id: \"1\",\n      session_id: \"1\",\n      result_code:\"SUCCESS\",\n      success: true\n    }\n  }) {\n    id,\n    create_time\n  }\n}\n```\n\nQuery reports with filter getting a cursor:\n```\n{\n  reports (filter: { auth_method: { eq: \"FINGERPRINT\" } } ) {\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    edges {\n      node {\n      \tid\n    \t\tcreate_time\n    \t\tauth_method\n      }\n      cursor\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiva%2Fprotocol-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiva%2Fprotocol-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiva%2Fprotocol-reporting/lists"}