editing this readme from my phone in HomeGoods:
basically this does the following:
- receives a semantic search, gets most relevent parts from codebase
- uses that as entrypoints into the codebase's function call graph
- using pathfinding between the entrypoints, as well as neighbors N hops away and the inheritance graph, build a context string (access to inheritance graph allows for various levels of detail for context to allow for wide understanding of codebase with mimimal context bloat)
enjoy the rest of the readme, which is certified AI slop tier:
A code analysis and visualization tool that extracts Abstract Syntax Trees (AST) from Python code and visualizes them as graphs.
The app is designed to draw graphs about code meta information, including:
- Class inheritance hierarchy
- Functional call graph
- Abstract syntax tree (AST)
This is a full-stack application with:
- Backend: Python Flask server for AST extraction
- Frontend: TypeScript Express server serving a web interface
- Communication: REST API between backend and frontend
- Python 3.8+
- Node.js 16+
- npm
- Navigate to the backend directory:
cd backend- Create and activate a virtual environment:
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Start the backend server:
python app.pyThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Build and start the frontend:
npm run devThe frontend will run on http://localhost:3000
- Open your browser and go to
http://localhost:3000 - Enter Python code in the left textarea
- Click "Extract AST" to see the Abstract Syntax Tree
- The AST will be displayed as JSON in the right panel
- The Flask app provides REST API endpoints
- Main endpoint:
POST /api/ast- extracts AST from Python code - Health check:
GET /api/health
- Express server serves a single-page web application
- Built with TypeScript
- Communicates with backend via fetch API
prism/
├── backend/
│ ├── app.py # Flask application
│ ├── requirements.txt # Python dependencies
│ └── .venv/ # Virtual environment
├── frontend/
│ ├── src/
│ │ └── index.ts # Express server & web interface
│ ├── package.json # Node.js dependencies
│ ├── tsconfig.json # TypeScript configuration
│ └── dist/ # Compiled JavaScript
└── README.md # This file
- AST Extraction: Parse Python code and extract Abstract Syntax Trees
- Web Interface: Beautiful, responsive UI for code input and AST visualization
- Error Handling: Graceful error handling for syntax errors and connection issues
- Real-time Processing: Instant AST extraction and display
- Interactive graph visualization using D3.js or similar
- Support for more programming languages
- Call graph analysis
- Class inheritance hierarchy visualization
- Export capabilities (PNG, SVG, etc.)
This is a basic implementation focused on getting the AST → graph visualization pipeline working. The code is designed to be extensible for future features.
This project is for educational and development purposes.