{"id":23773863,"url":"https://github.com/StyraOSS/styra-demo-tickethub","last_synced_at":"2025-09-05T18:31:30.116Z","repository":{"id":62085042,"uuid":"546333494","full_name":"StyraOSS/styra-demo-tickethub","owner":"StyraOSS","description":"The TicketHub sample application for Styra's OPA SDKs.","archived":false,"fork":false,"pushed_at":"2025-08-14T20:05:22.000Z","size":3461,"stargazers_count":3,"open_issues_count":22,"forks_count":3,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-08-15T04:44:00.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.styra.com/sdk","language":"Java","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/StyraOSS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2022-10-05T23:19:49.000Z","updated_at":"2025-08-14T20:03:31.000Z","dependencies_parsed_at":"2025-06-17T12:22:01.032Z","dependency_job_id":"faeded30-9af6-4ce3-9a45-7e3943abe5ca","html_url":"https://github.com/StyraOSS/styra-demo-tickethub","commit_stats":null,"previous_names":["styrainc/styra-demo-tickethub","styraoss/styra-demo-tickethub"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/StyraOSS/styra-demo-tickethub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraOSS%2Fstyra-demo-tickethub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraOSS%2Fstyra-demo-tickethub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraOSS%2Fstyra-demo-tickethub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraOSS%2Fstyra-demo-tickethub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StyraOSS","download_url":"https://codeload.github.com/StyraOSS/styra-demo-tickethub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraOSS%2Fstyra-demo-tickethub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273799062,"owners_count":25170307,"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-09-05T02:00:09.113Z","response_time":402,"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":[],"created_at":"2025-01-01T05:46:06.415Z","updated_at":"2025-09-05T18:31:29.666Z","avatar_url":"https://github.com/StyraOSS.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TicketHub Sample App\n\nThe TicketHub sample application to show off using the Styra OPA SDKs:\n\n* [SDK Documentation](https://docs.styra.com/sdk)\n* [Java SDK repository](https://github.com/StyraInc/opa-java)\n* [Typescript / Javascript SDK repository](https://github.com/StyraInc/opa-typescript)\n* [C# SDK repository](https://github.com/StyraInc/opa-csharp)\n\n## Running the Tickethub app\n\nTo run the Tickethub app you need to select which server and client implementations to use when running `docker compose up`\n\n```\ndocker compose --profile \u003cSERVER_IMPLEMENTATION\u003e --profile \u003cCLIENT_IMPLEMENTATION\u003e up\n```\n\nThe list of `\u003cSERVER_IMPLEMENTATION\u003e` is:\n- `node`\n- `csharp`\n- `aspnetcore`\n- `java`\n- `springboot`\n\nThe list of `\u003cCLIENT_IMPLEMENTATION\u003e` is:\n- `html`\n- `react`\n\nSo for example, running the `node` server with `react` would result in:\n\n```\ndocker compose --profile node --profile react up\n```\n\nThen open the browser at `http://localhost:3000`\n\n\u003e [!WARNING]\n\u003e Using docker compose requires `networking_mode: host`.\n\u003e This is disabled by default on MacOS and Windows for Docker Desktop.\n\u003e See the [Docker Desktop documentation](https://docs.docker.com/network/drivers/host/) for information on how to enable this mode.\n\n## Reason Support\n\nSome TicketHub servers and clients support displaying reason information to the user. This can be helpful for informing the user why their request failed. Reason information is accessed via `data.tickets.reason`. For purposes of this demo app, the `reason_admin` value is assigned to `reason`, though in a more production-ready application `reason_user` would be more appropriate. TicketHub backends which support reasons should provide a `reason` field in their JSON response body during HTTP 403 forbidden responses.\n\nFor an example of how this works, consider the following curl commands:\n\n```plain\n$ curl -LSs 'http://localhost:4000/api/tickets/1/resolve' -H 'Cookie: user=acmecorp / bob' -H 'content-type: application/json'  --data-raw '{\"resolved\":true}' | jq\n{\n  \"reason\": \"resolver role is required to resolve\",\n  \"message\": \"access denied by policy\"\n}\n$ curl -LSs 'http://localhost:4000/api/tickets/1/resolve' -H 'Cookie: user=acmecorp / alice' -H 'content-type: application/json'  --data-raw '{\"resolved\":true}' | jq\n{\n  \"description\": \"Dooms day device needs to be refactored\",\n  \"id\": 1,\n  \"customer\": \"Globex\",\n  \"resolved\": true,\n  \"last_updated\": \"2024-10-08T16:45:57.557846723Z\"\n}\n```\n\nReason support for clients:\n* ✅ HTML\n* ✅ React (for resolving tickets)\n\nReason support for servers:\n* ✅ Java\n* ❌ Spring Boot\n* ❌ C#\n* ❌ ASP.NET\n* ✅ Node\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStyraOSS%2Fstyra-demo-tickethub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStyraOSS%2Fstyra-demo-tickethub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStyraOSS%2Fstyra-demo-tickethub/lists"}