A web application that analyzes uploaded codebases and automatically generates system architecture diagrams, dependency graphs, and data flow visualizations.
- File Upload & Processing: Support for .zip, .tar.gz uploads
- Code Analysis Engine: Parses Python, JavaScript, and Java files
- Architecture Diagram Generation: Auto-detects architectural patterns
- Dependency Graph: Module-level dependency mapping
- Data Flow Diagram: Traces function call chains and data transformations
- Interactive Visualization: Click nodes to see code snippets, filter by component
- Insights & Metrics: Cyclomatic complexity, code coupling metrics, dead code detection
- Backend: Django 5.x with Django REST Framework
- Frontend: HTML5, CSS3 (Tailwind CSS), Vanilla JavaScript
- Visualization: D3.js, Cytoscape.js, Mermaid.js
- Code Analysis: ast (Python), esprima (JavaScript), javalang (Java)
- Database: SQLite (default Django)
-
Clone the repository:
git clone <repository-url> cd code_visualizer
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Visit
http://127.0.0.1:8000in your browser
- Upload a codebase archive (.zip or .tar.gz)
- The system will automatically analyze the code
- View generated architecture diagrams, dependency graphs, and data flow visualizations
- Explore code metrics and insights
For a streamlined experience with just the essentials:
- Navigate to
/simple/ - Upload your code files or zip folder
- Choose either "Analyze Code Flow" or "Database Relations"
- View the generated visualizations
See README_SIMPLIFIED.md for more details on the simplified interface.
POST /api/upload/- Upload a codebaseGET /api/projects/- List all analyzed projectsGET /api/analyze/<project_id>/- Trigger analysis for a projectGET /api/diagram/<project_id>/<diagram_type>/- Get diagram dataGET /api/export/<project_id>/<diagram_type>/- Export diagramGET /api/metrics/<project_id>/- Get code metrics
code_visualizer/
├── analyzer/
│ ├── models.py
│ ├── views.py
│ ├── urls.py
│ └── utils/
│ ├── analyzer.py
│ ├── file_handler.py
│ ├── graph_generator.py
│ ├── mermaid_generator.py
│ └── metrics_calculator.py
├── templates/
│ └── index.html
├── static/
├── manage.py
├── requirements.txt
└── README.md
This project is licensed under the MIT License.