Gathering detailed insights and metrics for userpravah
Gathering detailed insights and metrics for userpravah
Gathering detailed insights and metrics for userpravah
Gathering detailed insights and metrics for userpravah
UserPravah is a command-line tool for analyzing web applications and generating visual diagrams of user navigation paths and page-to-page flows
npm install userpravah
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (54.51%)
JavaScript (31.82%)
Shell (9.7%)
CSS (3.18%)
HTML (0.78%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
17 Stars
45 Commits
2 Forks
1 Watchers
4 Branches
2 Contributors
Updated on Jun 18, 2025
Latest Version
0.1.4
Package Id
userpravah@0.1.4
Unpacked Size
317.33 kB
Size
65.90 kB
File Count
41
NPM Version
10.9.2
Node Version
23.11.0
Published on
May 28, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Join our Discord server for healthy discussions, to ask questions, share ideas, or to collaborate on UserPravah!
## Overview
UserPravah (where "Pravah" means flow) is a versatile command-line tool for analyzing web applications and generating visual diagrams of user navigation paths and page-to-page flows. It helps developers,tester and all stake holders understand complex application user flows, page to page navigations and document user journeys.
Here's an example of what UserPravah can generate for an Angular application:
This tool is invaluable for:
Currently, UserPravah offers comprehensive support for Angular projects, with plans to expand to other frameworks (see Roadmap).
IFrameworkAnalyzer
interfaceIOutputGenerator
interfaceRouterModule
, provideRouter
, standalone components (loadComponent
), lazy-loaded modules, programmatic navigation (router.navigate
, router.navigateByUrl
), and template links ([routerLink]
)..dot
graph file and a .png
image using Graphviz, showing pages/routes as nodes and navigations/relationships as edges.Before you can use this tool, you need to have the following installed:
dot
command is in your system's PATH.
1brew install graphviz
1choco install graphviz
1winget install graphviz.graphviz
1sudo apt-get update 2sudo apt-get install graphviz -y
1sudo dnf install graphviz -y
1sudo pacman -S graphviz
To install UserPravah globally, run the following command:
1npm install -g userpravah
Once installed, you can run UserPravah from your terminal with various options:
1userpravah <path_to_your_project_root> [options]
UserPravah v0.1.0 introduces enhanced CLI options for greater control over analysis and output:
1Options: 2 --framework <name> Specify framework (auto-detect if not provided) 3 Available: angular, react 4 --output <formats> Output formats (comma-separated, default: dot) 5 Available: dot, json 6 --output-dir <path> Output directory (default: current directory) 7 --theme <theme> Theme for DOT output (default, dark, colorful) 8 --layout <layout> Layout for DOT output (LR, TB, BT, RL) 9 LR=Left-Right, TB=Top-Bottom, BT=Bottom-Top, RL=Right-Left 10 --no-image Skip image generation for DOT output 11 --help, -h Show help message
Basic usage (Auto-detect framework):
1userpravah my-angular-app
Specify framework explicitly:
1userpravah my-react-app --framework react
Multiple output formats:
1userpravah my-app --output dot,json
Custom theme and layout:
1userpravah my-app --theme dark --layout TB
Custom output directory:
1userpravah my-app --output-dir ./analysis-results
Generate only DOT file (skip image):
1userpravah my-app --no-image
Complex example:
1userpravah ./my-project --framework angular --output dot,json --theme colorful --layout LR --output-dir ./reports
DOT Format (.dot
): Graphviz definition file
JSON Format (.json
): Structured data export
Upon completion, UserPravah will generate files in your specified output directory (or current directory by default):
user-flows.dot
: The graph definition file in DOT languageuser-flows.png
: The visual graph image (unless --no-image
is used)user-flows.json
: Structured data export (when JSON format is specified)UserDashboardComponent
becomes "User Dashboard") or from the last segment of the route's path (e.g., /admin/reports
would use "Reports"). CamelCase names are converted to Title Case./admin/users/:id
) is shown in parentheses below the display name./
) is always Orange (#FF8C00
)./settings/...
will share a similar color). This is achieved by generating a consistent color from the first segment of the path (e.g., "settings"), helping to visually group related application areas.#006400
): Programmatic navigation (e.g., router.navigate()
or router.navigateByUrl()
in Angular TypeScript code).
AuthGuard
), the guard names will be displayed as a label on the arrow (e.g., "CanActivateGuard, RoleGuard").#4682B4
): Template-based navigation (e.g., [routerLink]
in Angular HTML templates).redirectTo
in route configurations).#A9A9A9
) with No Arrowhead: Hierarchical parent-child route relationships. These illustrate the structural nesting of routes (e.g., /products
as a parent of /products/details
) and do not represent a direct user navigation click.UserPravah employs a multi-stage process:
ts-morph
for TypeScript-based projects like Angular).ts-graphviz
and Graphviz to render the internal graph model into DOT and image (PNG) formats.UserPravah is an evolving project, and contributions are highly welcome!
Planned Features & Framework Support (Roadmap):
How to Contribute:
If you'd like to contribute to the development of UserPravah, here's how you can set up the project locally:
Clone the repository (or copy the graphgeneratorts
directory):
1# If you have the full project 2git clone https://github.com/[your_username]/userpravah.git # Replace with actual URL once created 3cd userpravah/graphgeneratorts 4# Or if you just have the directory, navigate into it 5# cd graphgeneratorts
Install dependencies:
1npm install
This will install necessary packages like ts-morph
, node-html-parser
, ts-graphviz
, etc.
Open an issue to discuss the change, new feature, or report a bug.
Fork the repository and submit a pull request with your changes.
UserPravah uses a test suite based on mock Angular projects to ensure the accuracy and stability of its analysis and graph generation capabilities. This approach helps verify that the tool correctly interprets various Angular routing configurations and navigation patterns. For a detailed breakdown of specific features covered and planned for future tests, please see the TestCoverage.md
file.
Testing Procedure:
Mock Projects: A collection of small, self-contained mock Angular projects are located in the graphgeneratorts/tests/mock-projects/
directory. Each mock project is designed to test a specific feature or scenario, such as:
simple-app
)lazy-load-app
)Expected Outputs: For each mock project, there is a corresponding "expected" .dot
graph file stored in graphgeneratorts/tests/expected-outputs/
. This file represents the correct visual output UserPravah should generate for that specific mock project.
Test Execution:
graphgeneratorts/run-tests.sh
, automates the testing process.graphgeneratorts
directory and execute:
1chmod +x run-tests.sh 2./run-tests.sh
npm run analyze -- <path_to_mock_project>
command.user-flows.dot
file with the corresponding expected .dot
file from the expected-outputs
directory using diff
.Test Results:
.dot
file exactly matches the expected file, the test case is marked as a "SUCCESS".diff
output is displayed. The script will also provide a command to help update the expected file if the changes in the generated output are intentional and correct (e.g., after improving the graph generator).Why This Testing Approach?
ts-morph
) to route discovery, navigation extraction, and final DOT graph generation. It ensures the entire pipeline works as intended..dot
output, which is the primary artifact used to generate the visual diagrams. This makes it easy to confirm the correctness of the end result..dot
file.diff
output helps pinpoint discrepancies. The ability to easily update the expected output (e.g., cp ./user-flows.dot tests/expected-outputs/my-new-app.dot
) is useful during development iterations.While this integration-focused testing is primary for the core analysis, traditional unit tests can and should be used for any utility functions or isolated logic within the codebase that do not heavily depend on the ts-morph
project context or file system interactions.
Please Note: UserPravah is currently developed and maintained by an individual developer. While every effort is made to ensure its quality and accuracy, it is provided "as-is" and is not recommended for critical production usage at this stage.
Bugs are inevitable in any software project, especially one in active development. If you encounter any issues or unexpected behavior, please report them via the GitHub Issues page for this project. Your feedback and bug reports are invaluable!
With the help of the community through contributions and bug reporting, we can make UserPravah a more robust and reliable tool for everyone.
This project is licensed under the MIT License. See the LICENSE
file for details.
No vulnerabilities found.
No security vulnerabilities found.