# How Understand Anything Performs Framework-Specific Analysis for Django, React, Express, and Spring

> Understand Anything analyzes Django React Express and Spring by detecting frameworks and applying metadata to guide LLM architectural analysis.

- Repository: [Egonex/Understand-Anything](https://github.com/Egonex-AI/Understand-Anything)
- Tags: deep-dive
- Published: 2026-06-28

---

**Understand Anything performs framework-specific analysis by detecting frameworks through dependency manifests and keywords, then applying `FrameworkConfig` metadata to guide an LLM with architectural layer hints.**

The `Egonex-AI/Understand-Anything` repository implements a polyglot static analysis engine that automatically recognizes Django, React, Express, and Spring Boot projects. By combining manifest file scanning with framework-specific configuration objects, the tool maps codebase artifacts to generic architectural layers (UI, API, Data, Config) regardless of the underlying programming language.

## Framework Detection Architecture

The detection pipeline relies on declarative metadata definitions that separate framework identification from analysis logic. This allows the engine to support new frameworks by adding configuration objects without modifying the core analysis code.

### FrameworkConfig Objects

Each supported framework is described by a `FrameworkConfig` object located in `packages/core/src/languages/frameworks/`. These configuration objects contain four critical properties:

- **`detectionKeywords`** – Strings that appear in source files or dependency manifests (e.g., `django`, `react`, `"express":`).
- **`manifestFiles`** – Files scanned for those keywords (e.g., [`requirements.txt`](https://github.com/Egonex-AI/Understand-Anything/blob/main/requirements.txt), [`package.json`](https://github.com/Egonex-AI/Understand-Anything/blob/main/package.json), [`pom.xml`](https://github.com/Egonex-AI/Understand-Anything/blob/main/pom.xml)).
- **`entryPoints`** – Typical entry-point files ([`manage.py`](https://github.com/Egonex-AI/Understand-Anything/blob/main/manage.py), [`src/index.tsx`](https://github.com/Egonex-AI/Understand-Anything/blob/main/src/index.tsx), [`Application.java`](https://github.com/Egonex-AI/Understand-Anything/blob/main/Application.java)) used for graph-building.
- **`layerHints`** – A mapping from framework-specific concepts to generic graph layers, such as Django views mapping to **api** layers or React components mapping to **ui** layers.

### The PluginRegistry and LanguageRegistry

The core engine's **`PluginRegistry`** ([`packages/core/src/plugins/registry.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/plugins/registry.ts)) orchestrates framework detection by coordinating with the **`LanguageRegistry`**. The detection process follows these steps:

1. **File extension mapping** – The `LanguageRegistry` maps file extensions to languages (e.g., `.py` → Python, `.tsx` → TypeScript).
2. **Manifest scanning** – For each file, the engine checks if the basename matches any `manifestFiles` defined in the framework configs for that language.
3. **Keyword detection** – If a manifest file is found, the engine searches its contents for `detectionKeywords`.
4. **Framework registration** – When keywords match, the framework's `id` (e.g., `django`, `react`, `express`, `spring`) is added to the project's **`frameworks`** list in the analysis context.

## Supported Framework Configurations

The following configurations define how Understand Anything recognizes and interprets each major web framework.

### Django

**Configuration file:** [`packages/core/src/languages/frameworks/django.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/languages/frameworks/django.ts)

The Django configuration targets Python projects through multiple dependency management formats:

- **Keywords:** `django`, `djangorestframework`, `django-rest-framework`
- **Manifest files:** [`requirements.txt`](https://github.com/Egonex-AI/Understand-Anything/blob/main/requirements.txt), [`pyproject.toml`](https://github.com/Egonex-AI/Understand-Anything/blob/main/pyproject.toml), [`setup.py`](https://github.com/Egonex-AI/Understand-Anything/blob/main/setup.py), `Pipfile`
- **Entry points:** [`manage.py`](https://github.com/Egonex-AI/Understand-Anything/blob/main/manage.py), [`wsgi.py`](https://github.com/Egonex-AI/Understand-Anything/blob/main/wsgi.py), [`asgi.py`](https://github.com/Egonex-AI/Understand-Anything/blob/main/asgi.py)
- **Layer hints:** Views map to **api**, models to **data**, templates to **ui**, and settings to **config**

### React

**Configuration file:** [`packages/core/src/languages/frameworks/react.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/languages/frameworks/react.ts)

The React configuration identifies TypeScript/JavaScript component-based architectures:

- **Keywords:** `react`, `react-dom`, `@types/react`
- **Manifest file:** [`package.json`](https://github.com/Egonex-AI/Understand-Anything/blob/main/package.json)
- **Entry points:** [`src/App.tsx`](https://github.com/Egonex-AI/Understand-Anything/blob/main/src/App.tsx), [`src/index.tsx`](https://github.com/Egonex-AI/Understand-Anything/blob/main/src/index.tsx), [`src/main.tsx`](https://github.com/Egonex-AI/Understand-Anything/blob/main/src/main.tsx)
- **Layer hints:** Components map to **ui**, hooks to **service**, and pages to **ui**

### Express

**Configuration file:** [`packages/core/src/languages/frameworks/express.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/languages/frameworks/express.ts)

The Express configuration recognizes Node.js server applications:

- **Keywords:** `"express":`, `express-validator`, `express-session`
- **Manifest file:** [`package.json`](https://github.com/Egonex-AI/Understand-Anything/blob/main/package.json)
- **Entry points:** [`src/index.js`](https://github.com/Egonex-AI/Understand-Anything/blob/main/src/index.js), [`server.js`](https://github.com/Egonex-AI/Understand-Anything/blob/main/server.js), [`app.js`](https://github.com/Egonex-AI/Understand-Anything/blob/main/app.js)
- **Layer hints:** Routes map to **api**, controllers to **service**, and middleware to **middleware**

### Spring Boot

**Configuration file:** [`packages/core/src/languages/frameworks/spring.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/languages/frameworks/spring.ts)

The Spring configuration handles JVM-based enterprise applications:

- **Keywords:** `spring-boot`, `spring-boot-starter`, `org.springframework`
- **Manifest files:** [`pom.xml`](https://github.com/Egonex-AI/Understand-Anything/blob/main/pom.xml), `build.gradle`, `build.gradle.kts`
- **Entry points:** `**/Application.java`, `**/App.java`
- **Layer hints:** Controllers map to **api**, services to **service**, repositories to **data**, and security configurations to **middleware**

## LLM-Guided Analysis Pipeline

Once frameworks are detected, the **`LlmAnalyzer`** ([`packages/core/src/analyzer/llm-analyzer.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/analyzer/llm-analyzer.ts)) constructs a specialized system prompt that includes:

1. The detected framework IDs as a JSON array: `"frameworks": ["Django", "React", "Express", "Spring Boot"]`
2. A framework-specific prompt snippet referenced by `promptSnippetPath` (e.g., [`frameworks/django.md`](https://github.com/Egonex-AI/Understand-Anything/blob/main/frameworks/django.md))
3. The `layerHints` mapping, which instructs the LLM how to classify code artifacts according to the framework's architectural conventions

The LLM generates a **knowledge graph** where each node is annotated with the appropriate layer. The **[`graph-builder.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/graph-builder.ts)** ([`packages/core/src/analyzer/graph-builder.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/packages/core/src/analyzer/graph-builder.ts)) consumes this output and applies the `layerHints` mapping to assign visual categories in the dashboard.

## Implementation Example

The following TypeScript example demonstrates how the registries detect frameworks in a project:

```typescript
import { PluginRegistry } from '@understand-anything/core';
import { LanguageRegistry } from '@understand-anything/core';
import * as path from 'path';

// Initialize registries
const langReg = LanguageRegistry.createDefault();
const pluginReg = new PluginRegistry(langReg);

// Scan project files
const files = await glob('**/*', { path: projectPath });
const detectedFrameworks = new Set<string>();

for (const file of files) {
  const ext = path.extname(file);
  const lang = langReg.getForExtension(ext);
  if (!lang) continue;

  const content = await readFile(file, 'utf8');
  for (const fw of lang.frameworks ?? []) {
    const cfg = fw.config;
    if (cfg.manifestFiles.includes(path.basename(file))) {
      if (cfg.detectionKeywords.some(k => content.includes(k))) {
        detectedFrameworks.add(cfg.id);
      }
    }
  }
}

console.log('Detected frameworks:', Array.from(detectedFrameworks));

```

After detection, the framework list is injected into the LLM prompt:

```typescript
const systemPrompt = `
You are analyzing a codebase. Detected frameworks: ${Array.from(detectedFrameworks).join(', ')}.
Use the framework-specific snippet (e.g., frameworks/react.md) to shape your response.
Map all components to their respective architectural layers based on the provided hints.
`;

const result = await llm.analyze(systemPrompt, sourceFiles);

```

## Summary

- **Framework detection** relies on `FrameworkConfig` objects that define `detectionKeywords`, `manifestFiles`, and `entryPoints` for each supported technology.
- **The PluginRegistry** coordinates with the LanguageRegistry to scan dependency manifests and source files, storing detected frameworks in the project context.
- **Layer hints** map framework-specific concepts (Django views, React components, Express routes, Spring controllers) to generic architectural layers (API, UI, Data, Service).
- **The LlmAnalyzer** uses detected framework IDs and markdown prompt snippets to generate framework-aware knowledge graphs.
- **The graph builder** visualizes these layers with appropriate color-coding, providing architectural insights that respect framework conventions.

## Frequently Asked Questions

### How does Understand Anything detect multiple frameworks in a single repository?

The detection system iterates through all files in the project and maintains a `Set` of discovered framework IDs. When scanning files like [`package.json`](https://github.com/Egonex-AI/Understand-Anything/blob/main/package.json) or [`requirements.txt`](https://github.com/Egonex-AI/Understand-Anything/blob/main/requirements.txt), it checks for keywords associated with every configured framework. If a file contains keywords for both React and Express, both frameworks are added to the detection list, allowing the LLM to analyze full-stack applications with appropriate context for each layer.

### What happens if a framework is not explicitly supported?

If no `detectionKeywords` match and no frameworks are registered, the `LlmAnalyzer` falls back to generic analysis patterns. The system will still generate a knowledge graph, but without the `layerHints` mapping, the LLM must infer architectural layers from code structure alone rather than framework conventions. This produces less accurate layer classification for framework-specific concepts.

### Where are the framework-specific prompt prompts stored?

Framework-specific prompt snippets reside in the `packages/core/src/languages/frameworks/` directory as Markdown files (e.g., [`django.md`](https://github.com/Egonex-AI/Understand-Anything/blob/main/django.md), [`react.md`](https://github.com/Egonex-AI/Understand-Anything/blob/main/react.md)). The `FrameworkConfig` objects reference these via the `promptSnippetPath` property, and the `LlmAnalyzer` loads them dynamically when constructing the system prompt for the LLM.

### Can the layer hints be customized for enterprise coding standards?

While the base `layerHints` are defined in the framework configuration files (e.g., [`spring.ts`](https://github.com/Egonex-AI/Understand-Anything/blob/main/spring.ts)), the architecture supports extension through the plugin system. Enterprises can fork the repository and modify the `layerHints` mappings in the respective `FrameworkConfig` objects to align with internal architectural standards, such as mapping specific package patterns to custom layer categories.