{"id":15476626,"url":"https://github.com/corajr/servant-state-graph","last_synced_at":"2026-02-04T01:30:16.666Z","repository":{"id":145655161,"uuid":"81022481","full_name":"corajr/servant-state-graph","owner":"corajr","description":"Generate graphs from Servant API types","archived":false,"fork":false,"pushed_at":"2017-04-15T21:33:50.000Z","size":423,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T00:33:15.535Z","etag":null,"topics":["api","graph","hateoas"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corajr.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":"2017-02-05T21:12:17.000Z","updated_at":"2021-04-22T11:49:29.000Z","dependencies_parsed_at":"2023-04-06T09:01:14.037Z","dependency_job_id":null,"html_url":"https://github.com/corajr/servant-state-graph","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/corajr%2Fservant-state-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corajr%2Fservant-state-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corajr%2Fservant-state-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corajr%2Fservant-state-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corajr","download_url":"https://codeload.github.com/corajr/servant-state-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239789006,"owners_count":19697292,"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":["api","graph","hateoas"],"created_at":"2024-10-02T03:40:34.368Z","updated_at":"2026-02-04T01:30:16.632Z","avatar_url":"https://github.com/corajr.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# servant-state-graph\n\nGenerate graphs from [Servant](http://haskell-servant.readthedocs.io) API types.\nInspired by [choclety](https://github.com/mooreniemi/choclety).\n\n[![example graph](docs/img/example_graph.gif)](https://corajr.github.io/servant-state-graph/index.html)\n\n[See a live demo.](https://corajr.github.io/servant-state-graph/viewer.html)\n\n## Purpose\n\nThis library helps you render\nyour [Servant](http://haskell-servant.readthedocs.io) API as a state machine,\nwith representations as states and requests as state transitions. This could be\nuseful, for example, when looking for the shortest path(s) to reach a desired\nstate (such as a revenue-generating action).\n\nIt also includes the beginnings of\na [HAL](http://stateless.co/hal_specification.html) library for Servant, for\nserving a hypermedia API.\n\n## Prerequisites\n- [haskell-stack](https://www.haskellstack.org/): `curl -sSL https://get.haskellstack.org/ | sh`\n    - run `stack setup` to obtain the Haskell compiler\n\n## Docs\n\nSee the [Haddock documentation][haddock].\n\n## Usage\n\nThe library exposes a function `stateGraph` that can generate graph JSON\nsuitable for use with the included [viewer][viewer] or serve the viewer on a\ndesired port.\n\nTo serve up the graph viewer (uses Cytoscape.js)\nat [127.0.0.1:8090](http://127.0.0.1:8090) for a sample API:\n\n`stack build \u0026\u0026 stack exec state-graph`\n\nTo serve up the sample API itself on port 8080:\n\n`stack exec state-graph-server`\n\nOr, to serve up the HAL-supporting version of the API:\n\n`stack exec state-graph-server -- --hyper`\n\nTo run the test suite:\n\n`stack test`\n\n[viewer]: https://corajr.github.io/servant-state-graph/viewer.html\n[haddock]: https://corajr.github.io/servant-state-graph/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorajr%2Fservant-state-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorajr%2Fservant-state-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorajr%2Fservant-state-graph/lists"}