Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM Module for managing application flow as state machine #17

Open
lorenyu opened this issue Jul 21, 2023 · 2 comments
Open

NPM Module for managing application flow as state machine #17

lorenyu opened this issue Jul 21, 2023 · 2 comments
Labels
project New project idea that doesn't fit into existing repos

Comments

@lorenyu
Copy link
Contributor

lorenyu commented Jul 21, 2023

More complex user-facing applications, especially ones that intake claims/applications/cases often need to manage the application flow. A best practice is to manage this with a state machine and abstract it into a flow management module. This approach also provides useful product development tools like visualizing the application flow as a flowchart diagram.

This issue is to capture the idea of making a reusable module for this functionality. The current vision for the implementation approach would be to implement this as a separate npm module, and it could be imported by default in https://github.com/navapbc/template-application-nextjs. That would make it easier to rip out than if the code was baked into the application template itself.

Scope

Scope of this ticket should include designing the npm module (e.g. in a tech spec) prior to implementation

@lorenyu lorenyu added the project New project idea that doesn't fit into existing repos label Jul 28, 2023
@KevinJBoyer
Copy link

Leaving a couple of drive-by thoughts here:
1 - this seems like a fairly universal need, is there an existing library that we could use rather than build something custom?
2 - if we do use a custom technical approach similar to what was used for PFML, it might be worth first documenting it as an ADR or tech spec so we can revisit some of the approach (for example, I don't think we use guards in the state machine appropriately.)

@lorenyu
Copy link
Contributor Author

lorenyu commented Nov 22, 2023

@KevinJBoyer PFML we'd probably be using xstate library similar to PFML, so i guess i wouldn't really consider that particularly custom. i haven't seen any library that captures the higher level need — i think treating application flow as a state machine is maybe still somewhat niche. in any case, i agree that we need to flesh out and refine the design, which should be part of the work for this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project New project idea that doesn't fit into existing repos
Projects
None yet
Development

No branches or pull requests

2 participants