# bakunin95/wavi architecture

> Architecture diagram of the GitHub repository bakunin95/wavi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bakunin95/wavi
- Repository: https://github.com/bakunin95/wavi

## Overview

WAVI statically analyzes a web-code folder and turns the discovered files, declarations, and references into architecture artifacts. Its main workflow is CLI input → analysis orchestration → language parsing and model construction → diagram/data output, with optional static recommendations and dashboard use. The graph also preserves CSS/HTML/JavaScript parsing, folder diagrams, and graph-based recommendation capabilities. Relationships are limited to README statements, shown excerpts, and SOURCE INDEX references; unsampled wiring is omitted.

Main entry points: [`src/lib/analyzerMediator.js`](https://github.com/bakunin95/wavi/blob/master/src/lib/analyzerMediator.js) (Analysis mediator), [`src/parsers/javascript.js`](https://github.com/bakunin95/wavi/blob/master/src/parsers/javascript.js) (JavaScript parser), [`src/lib/database.js`](https://github.com/bakunin95/wavi/blob/master/src/lib/database.js) (Analysis model), [`src/parsers/registry.js`](https://github.com/bakunin95/wavi/blob/master/src/parsers/registry.js) (Parser registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Analysis orchestration"]
  node_entry["Package entry<br/>[index.js]"]
  node_mediator["Analysis mediator"]
  node_config["Configuration<br/>[config.js]"]
  node_cache[("Analysis cache<br/>[cache.js]")]
  node_fileid["File identification<br/>[fileIdentifier.js]"]
end

subgraph group_parsing["Parsing and model"]
  node_facade["Parser facade<br/>[facade.js]"]
  node_registry["Parser registry<br/>[registry.js]"]
  node_javascript["JavaScript parser<br/>[javascript.js]"]
  node_importer["Import resolver<br/>[importExtractor.js]"]
  node_css["CSS parser<br/>[css.js]"]
  node_cssrules["CSS rule handler<br/>[ruleHandler.js]"]
  node_html["HTML parser<br/>[html.js]"]
  node_model[("Analysis model<br/>[database.js]")]
  node_tree["Model tree<br/>[tree.js]"]
  node_jsast["JavaScript AST<br/>[parseJs.js]"]
  node_astwalk["AST traversal<br/>[astWalk.js]"]
end

subgraph group_artifacts["Diagram and artifacts"]
  node_writer["Artifact writer<br/>[outputWriter.js]"]
  node_graph["Diagram graph<br/>[graph.js]"]
  node_folders["Folder diagrams<br/>[folderDiagrams.js]"]
end

subgraph group_insights["Recommendations and dashboard"]
  node_recommendations["Recommendation engine"]
  node_rules["Graph recommendations<br/>[graphRules.js]"]
  node_source_rules["Source-code rules<br/>[sourceCodeRules.js]"]
  node_dashboard["Dashboard server<br/>[server.js]"]
end

node_cli(("CLI user"))
node_dashboard_user(("Dashboard user"))

node_cli -->|"generates or checks"| node_entry
node_entry -->|"starts analysis"| node_mediator
node_mediator -->|"loads settings"| node_config
node_mediator -->|"uses cache"| node_cache
node_mediator -->|"identifies files"| node_fileid
node_mediator -->|"dispatches parsing"| node_facade
node_mediator -->|"builds model"| node_model
node_mediator -->|"writes artifacts"| node_writer
node_facade -->|"selects parser"| node_registry
node_registry -->|"registers parser"| node_javascript
node_registry -->|"registers parser"| node_css
node_registry -->|"registers parser"| node_html
node_javascript -->|"records declarations"| node_model
node_javascript -->|"resolves imports"| node_importer
node_javascript -->|"parses source"| node_jsast
node_javascript -->|"walks syntax tree"| node_astwalk
node_css -->|"records CSS"| node_model
node_css -->|"handles rules"| node_cssrules
node_html -->|"records markup"| node_model
node_model -->|"stores classes"| node_tree
node_writer -->|"renders diagram"| node_graph
node_writer -->|"creates folder views"| node_folders
node_writer -->|"runs recommendations"| node_recommendations
node_recommendations -->|"runs graph rules"| node_rules
node_recommendations -->|"runs code rules"| node_source_rules
node_dashboard_user -->|"requests analysis"| node_dashboard
node_dashboard -->|"invokes analyzer"| node_entry

click node_entry "https://github.com/bakunin95/wavi/blob/master/src/index.js"
click node_mediator "https://github.com/bakunin95/wavi/blob/master/src/lib/analyzerMediator.js"
click node_config "https://github.com/bakunin95/wavi/blob/master/src/lib/config.js"
click node_cache "https://github.com/bakunin95/wavi/blob/master/src/lib/cache.js"
click node_fileid "https://github.com/bakunin95/wavi/blob/master/src/lib/fileIdentifier.js"
click node_facade "https://github.com/bakunin95/wavi/blob/master/src/parsers/facade.js"
click node_registry "https://github.com/bakunin95/wavi/blob/master/src/parsers/registry.js"
click node_javascript "https://github.com/bakunin95/wavi/blob/master/src/parsers/javascript.js"
click node_importer "https://github.com/bakunin95/wavi/blob/master/src/parsers/javascript/importExtractor.js"
click node_css "https://github.com/bakunin95/wavi/blob/master/src/parsers/css.js"
click node_cssrules "https://github.com/bakunin95/wavi/blob/master/src/parsers/css/ruleHandler.js"
click node_html "https://github.com/bakunin95/wavi/blob/master/src/parsers/html.js"
click node_model "https://github.com/bakunin95/wavi/blob/master/src/lib/database.js"
click node_tree "https://github.com/bakunin95/wavi/blob/master/src/lib/tree.js"
click node_jsast "https://github.com/bakunin95/wavi/blob/master/src/lib/parseJs.js"
click node_astwalk "https://github.com/bakunin95/wavi/blob/master/src/lib/astWalk.js"
click node_writer "https://github.com/bakunin95/wavi/blob/master/src/lib/outputWriter.js"
click node_graph "https://github.com/bakunin95/wavi/blob/master/src/lib/graph.js"
click node_folders "https://github.com/bakunin95/wavi/blob/master/src/lib/folderDiagrams.js"
click node_recommendations "https://github.com/bakunin95/wavi/blob/master/src/lib/recommendationEngine.js"
click node_rules "https://github.com/bakunin95/wavi/blob/master/src/lib/recommendationEngine/graphRules.js"
click node_source_rules "https://github.com/bakunin95/wavi/blob/master/src/lib/sourceCodeRules.js"
click node_dashboard "https://github.com/bakunin95/wavi/blob/master/dashboard/server.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_mediator,node_config,node_cache,node_fileid,node_cli,node_dashboard_user toneBlue
class node_facade,node_registry,node_javascript,node_importer,node_css,node_cssrules,node_html,node_model,node_tree,node_jsast,node_astwalk toneAmber
class node_writer,node_graph,node_folders toneMint
class node_recommendations,node_rules,node_source_rules,node_dashboard toneRose
```

## Components

### Analysis orchestration

- [Package entry](https://github.com/bakunin95/wavi/blob/master/src/index.js): `src/index.js`
- [Analysis mediator](https://github.com/bakunin95/wavi/blob/master/src/lib/analyzerMediator.js): `src/lib/analyzerMediator.js`
- [Configuration](https://github.com/bakunin95/wavi/blob/master/src/lib/config.js): `src/lib/config.js`
- [Analysis cache](https://github.com/bakunin95/wavi/blob/master/src/lib/cache.js): `src/lib/cache.js`
- [File identification](https://github.com/bakunin95/wavi/blob/master/src/lib/fileIdentifier.js): `src/lib/fileIdentifier.js`

### Parsing and model

- [Parser facade](https://github.com/bakunin95/wavi/blob/master/src/parsers/facade.js): `src/parsers/facade.js`
- [Parser registry](https://github.com/bakunin95/wavi/blob/master/src/parsers/registry.js): `src/parsers/registry.js`
- [JavaScript parser](https://github.com/bakunin95/wavi/blob/master/src/parsers/javascript.js): `src/parsers/javascript.js`
- [Import resolver](https://github.com/bakunin95/wavi/blob/master/src/parsers/javascript/importExtractor.js): `src/parsers/javascript/importExtractor.js`
- [CSS parser](https://github.com/bakunin95/wavi/blob/master/src/parsers/css.js): `src/parsers/css.js`
- [CSS rule handler](https://github.com/bakunin95/wavi/blob/master/src/parsers/css/ruleHandler.js): `src/parsers/css/ruleHandler.js`
- [HTML parser](https://github.com/bakunin95/wavi/blob/master/src/parsers/html.js): `src/parsers/html.js`
- [Analysis model](https://github.com/bakunin95/wavi/blob/master/src/lib/database.js): `src/lib/database.js`
- [Model tree](https://github.com/bakunin95/wavi/blob/master/src/lib/tree.js): `src/lib/tree.js`
- [JavaScript AST](https://github.com/bakunin95/wavi/blob/master/src/lib/parseJs.js): `src/lib/parseJs.js`
- [AST traversal](https://github.com/bakunin95/wavi/blob/master/src/lib/astWalk.js): `src/lib/astWalk.js`

### Diagram and artifacts

- [Artifact writer](https://github.com/bakunin95/wavi/blob/master/src/lib/outputWriter.js): `src/lib/outputWriter.js`
- [Diagram graph](https://github.com/bakunin95/wavi/blob/master/src/lib/graph.js): `src/lib/graph.js`
- [Folder diagrams](https://github.com/bakunin95/wavi/blob/master/src/lib/folderDiagrams.js): `src/lib/folderDiagrams.js`

### Recommendations and dashboard

- [Recommendation engine](https://github.com/bakunin95/wavi/blob/master/src/lib/recommendationEngine.js): `src/lib/recommendationEngine.js`
- [Graph recommendations](https://github.com/bakunin95/wavi/blob/master/src/lib/recommendationEngine/graphRules.js): `src/lib/recommendationEngine/graphRules.js`
- [Source-code rules](https://github.com/bakunin95/wavi/blob/master/src/lib/sourceCodeRules.js): `src/lib/sourceCodeRules.js`
- [Dashboard server](https://github.com/bakunin95/wavi/blob/master/dashboard/server.js): `dashboard/server.js`

### Other components

- **CLI user**
- **Dashboard user**

## Connections

- CLI user → Package entry: generates or checks
- Package entry → Analysis mediator: starts analysis (evidence: `src/index.js`)
- Analysis mediator → Configuration: loads settings (evidence: `src/lib/analyzerMediator.js`)
- Analysis mediator → Analysis cache: uses cache (evidence: `src/lib/analyzerMediator.js`)
- Analysis mediator → File identification: identifies files (evidence: `src/lib/analyzerMediator.js`)
- Analysis mediator → Parser facade: dispatches parsing (evidence: `src/lib/analyzerMediator.js`)
- Analysis mediator → Analysis model: builds model (evidence: `src/lib/analyzerMediator.js`)
- Analysis mediator → Artifact writer: writes artifacts (evidence: `src/lib/analyzerMediator.js`)
- Parser facade → Parser registry: selects parser (evidence: `src/parsers/facade.js`)
- Parser registry → JavaScript parser: registers parser (evidence: `src/parsers/registry.js`)
- Parser registry → CSS parser: registers parser (evidence: `src/parsers/registry.js`)
- Parser registry → HTML parser: registers parser (evidence: `src/parsers/registry.js`)
- JavaScript parser → Analysis model: records declarations (evidence: `src/parsers/javascript.js`)
- JavaScript parser → Import resolver: resolves imports (evidence: `src/parsers/javascript.js`)
- JavaScript parser → JavaScript AST: parses source (evidence: `src/parsers/javascript.js`)
- JavaScript parser → AST traversal: walks syntax tree (evidence: `src/parsers/javascript.js`)
- CSS parser → Analysis model: records CSS (evidence: `src/parsers/css.js`)
- CSS parser → CSS rule handler: handles rules (evidence: `src/parsers/css.js`)
- HTML parser → Analysis model: records markup (evidence: `src/parsers/html.js`)
- Analysis model → Model tree: stores classes (evidence: `src/lib/database.js`)
- Artifact writer → Diagram graph: renders diagram (evidence: `src/lib/outputWriter.js`)
- Artifact writer → Folder diagrams: creates folder views (evidence: `src/lib/outputWriter.js`)
- Artifact writer → Recommendation engine: runs recommendations (evidence: `src/lib/outputWriter.js`)
- Recommendation engine → Graph recommendations: runs graph rules (evidence: `src/lib/recommendationEngine.js`)
- Recommendation engine → Source-code rules: runs code rules (evidence: `src/lib/recommendationEngine.js`)
- Dashboard user → Dashboard server: requests analysis (evidence: `dashboard/server.js`)
- Dashboard server → Package entry: invokes analyzer (evidence: `dashboard/server.js`)
