commanded_events_map
commanded_events_map copied to clipboard
Tool for analysing commanded projects and representing in flow diagram.
Commanded Process Map
This tool is meant to help people which are working with elixir Commanded apps. The solution isn't some silver bullet and is based on as simple (and silly) solution as was possible to quickly get some satisfying result related to projects I am working with.
I was build this tool on project which is including now 65 nodes (aggregates, handlers, ...) and I hope this could help us get better picture about whole system.
Example
This example is generated for https://github.com/slashdotdash/conduit

Installation
-
copy config/dev.tmp.exs as
config/dev.exsand set properly path to your project. Thepath_wildcardis used to get better files what we want to analyse. -
execute
./bin/setup. Setup mix and install required node packages for frontend client. -
execute
./bin/generate_data. This command will generate required json file for FE infrontend_clientfolder. -
execute
./bin/run_client. Will run server (serving generated json file to FE) and open FE react application in browser.
Configuration & Base Logic
The main app logic is based on configuration and regular expressions. In config/dev.exs you can play with it.
-
config :commanded_process_map, :projectpath:set path to your projectpath_wildcard:set wildcard pattern to anaylyse only files which matters. (eg./lib/**/*.exor/apps/*/lib/**/*.exin umbrella apps)
-
config :commanded_process_map, :typesare representing nodes if FE flow graph. Thekeyis type of node and following areregexpregular expression to regognise nodenot_one_oflist of regular expressions to exclude file if some is evaluated astrueoutputwhat type of output is node emittingtargetswhat types of nodes are receiving output from this type of node
-
config :commanded_process_map, :regexpare used for analysing each node what edges (commands and events) are they using. It is including regexp for named capturing and parsing and for scan parsing.
You can define as many nodes as want. They will be automatically grouped by colour in graph and edged by rules in config (output, targets). You can even create your own pseudo language for spiking ideas and update config regexp by it. It will generate you graph for presenting that logic/structure.*
TODO
- [x] after regenerating data let server returning new data (no needs to restart)
- [x] get rid of react compile warnings
- [ ] investigation/play with graph options to reach better UX
- [ ] update README by UI possibilities description (selecting, source code view, ...)
- [ ] improve selectors (suggestion filter, ...)