{"id":22337806,"url":"https://github.com/boweihan/redux-hypercube","last_synced_at":"2025-10-07T20:00:02.608Z","repository":{"id":98803594,"uuid":"136759308","full_name":"boweihan/redux-hypercube","owner":"boweihan","description":"Redux state machine generator backed by an in-memory hypercube. Model checking for the front end.","archived":false,"fork":false,"pushed_at":"2018-06-11T01:17:17.000Z","size":278,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T08:28:33.094Z","etag":null,"topics":["automated-tests","hypercube","javascript","js","olap","react","react-automation","redux","redux-automation","state-machine","state-management"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boweihan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-06-09T21:26:40.000Z","updated_at":"2023-07-07T20:24:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3b5f4f1-2b0d-4a1c-b275-420a03e7a1eb","html_url":"https://github.com/boweihan/redux-hypercube","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/boweihan/redux-hypercube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boweihan%2Fredux-hypercube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boweihan%2Fredux-hypercube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boweihan%2Fredux-hypercube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boweihan%2Fredux-hypercube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boweihan","download_url":"https://codeload.github.com/boweihan/redux-hypercube/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boweihan%2Fredux-hypercube/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278838467,"owners_count":26054721,"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-10-07T02:00:06.786Z","response_time":59,"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":["automated-tests","hypercube","javascript","js","olap","react","react-automation","redux","redux-automation","state-machine","state-management"],"created_at":"2024-12-04T06:11:47.367Z","updated_at":"2025-10-07T20:00:02.588Z","avatar_url":"https://github.com/boweihan.png","language":"JavaScript","readme":"# redux-hypercube\n\n\u003cimg src='./hypercube.png' width=300 /\u003e\n\nA state machine library for Redux that is backed by a hypercube.\n\n\u003ca\u003ehttps://en.wikipedia.org/wiki/Hypercube\u003c/a\u003e\n\nCommonly used in BI as an OLAP cube:\n\u003ca\u003ehttps://en.wikipedia.org/wiki/OLAP_cube\u003c/a\u003e\n\n### Modelling all possible UI states\n\nIn theory, all possible states of a user interface can be modelled as a hypercube with a finite number of dimensions.\n\n\u003cb\u003e\u003cu\u003eExample: User Login Flow\u003c/u\u003e\u003c/b\u003e\n\nDimensions: [status, request, validations]\u003cbr/\u003e\nMembers: [ \u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[LOGGED_OUT,LOGGED_IN],\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[LOGIN_IDLE,LOGIN_PENDING],\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[VALID,INVALID],\u003cbr/\u003e\n]\n\nthis results in a 3D cube with 16 possibilities:\n\n* LOGGED_OUT / LOGIN_IDLE / VALID\n* LOGGED_OUT / LOGIN_IDLE / INVALID\n* LOGGED_OUT / LOGIN_PENDING / VALID\n* LOGGED_OUT / LOGIN_PENDING / INVALID\n* LOGGED_IN / LOGIN_IDLE / VALID\n* LOGGED_IN / LOGIN_IDLE / INVALID\n* LOGGED_IN / LOGIN_PENDING / VALID\n* LOGGED_IN / LOGIN_PENDING / INVALID\n\nEach of these possibilities corresponds to a certain UI state.\n\n* LOGGED_OUT / LOGIN_IDLE / VALID - shows a standard login screen.\n* LOGGED_OUT / LOGIN_PENDING / VALID - shows a spinner indicating login in progress.\n\nIn typical front-end applications it's a challenge to identify all possible application states - forgetting to handle a certain state is often one of the main causes of UI bugs. This is where a hypercube representation of application state comes in quite handy. Modelling application state (along with their possible transitions) as intersections in a hypercube gives us:\n\n1. The ability to identify and query all possible application states in an application with varying levels of granularity.\n2. The ability to model application state and their transitions as a graph.\n3. Hypercube slice operations\n4. Basis for a data visualization framework.\n5. A state-first viewpoint that translates directly into mockups.\n6. The potential for auto-generated snapshot tests\n\nOnce we have populated a hypercube with application states and their transitions as intersections, we can simply generate a state machine.\n\n### Generating a state machine\n\nThe next step after creating a hypercube is to generate a (Mealy) state machine with it. The implementation of a state machine can be framework agnostic but this experiment aims to provide a Redux adaptation.\n\nThis process, in theory, would be fully automated because we have all the states and their transitions already specified in the hypercube.\n\nImplementing a state machine in Redux may involve generating appropriate Redux actions creators to be consumed by a view layer (i.e. using a framework such as React). Reducers, rather than returning their own state slices, will query the in-memory hypercube for app state.\n\n### Vision\n\nI have a dream that one day we will be further empowered to spend most of our time building beautiful user experiences - as bugs will be much harder to write.\n\nThis project is currently in the \"fun thought experiment\" phase. Implementation ideas are always welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboweihan%2Fredux-hypercube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboweihan%2Fredux-hypercube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboweihan%2Fredux-hypercube/lists"}