Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions CodeViz-new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Build outputs
dist/
dist-ssr/
build/
*.local

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt

# Storybook build outputs
.out
.storybook-out

# Temporary folders
tmp/
temp/

# Lock files (keep only one)
# package-lock.json
# yarn.lock
# pnpm-lock.yaml

# Bun
bun.lockb

# TypeScript
*.tsbuildinfo
212 changes: 212 additions & 0 deletions CodeViz-new/CODEVIZ_INTEGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# πŸš€ CodeViz Integration Guide for CodeClarity

## πŸ“‹ Table of Contents

1. [Project Overview](#project-overview)
2. [Core Features](#core-features)
3. [Technical Architecture](#technical-architecture)
4. [Integration Benefits](#integration-benefits)
5. [Project Structure](#project-structure)
6. [Installation & Setup](#installation--setup)
7. [Documentation](#documentation)

---

## 🎯 Project Overview

**CodeViz** is a revolutionary AI-powered code visualization and analysis platform designed to make programming education accessible, interactive, and engaging. As a core component of the CodeClarity project, CodeViz transforms complex code into visual, interactive learning experiences that help developers and learners of all levels understand how code works.

### 🌟 Vision Statement

**"Democratizing code understanding through intelligent visualization and AI-powered explanations"**

We believe that everyone should be able to understand code, regardless of their experience level. CodeViz bridges the gap between complex programming concepts and intuitive understanding by providing:

- **Visual Learning**: Interactive diagrams and flowcharts
- **AI-Powered Explanations**: Adaptive explanations for different learning levels
- **Hands-On Experience**: Safe, sandboxed code execution simulation
- **Real-World Context**: Practical examples and analogies

---

## ✨ Core Features

### **🎯 Primary Capabilities**
- **Multi-Language Support**: Python, JavaScript, Java, C++, C
- **AI-Powered Analysis**: Intelligent code explanations and optimization suggestions
- **Interactive Visualizations**: Flowcharts, data structures, execution flow diagrams
- **Step-by-Step Execution**: Real-time code simulation with variable tracking
- **Adaptive Learning**: Simplified vs. technical explanations (10-year-old to advanced)

### **πŸ”§ Advanced Features**
- **"Why?" Mode**: Click any line for detailed reasoning
- **Bug Detection**: Automatic identification of common issues
- **Optimization Suggestions**: AI-generated improvement recommendations
- **Complexity Analysis**: Time and space complexity assessment
- **Export Capabilities**: Multiple format support (PNG, SVG, PDF)

### **πŸŽ“ Educational Features**
- **Real-World Analogies**: Relating code to everyday situations
- **Interactive Quizzes**: Auto-generated learning assessments
- **Progressive Difficulty**: Adapting to user learning pace
- **Voice Narration**: Natural language explanations (future enhancement)

---

## πŸ—οΈ Technical Architecture

### **Technology Stack**
- **Frontend Framework**: React 18 with TypeScript
- **Build Tool**: Vite for fast development and building
- **Styling**: Tailwind CSS with custom design system
- **UI Components**: shadcn/ui component library
- **State Management**: React Hooks and Context API
- **Routing**: React Router for navigation
- **Charts**: Recharts for data visualization
- **Icons**: Lucide React icon library

### **Component Architecture**
```
CodeClarity Main Platform
↓
CodeViz Dashboard
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Code Editor β”‚ ← Multi-language support
β”‚ Visualizer β”‚ ← Step-by-step execution
β”‚ Analysis β”‚ ← AI-powered insights
β”‚ Visualization β”‚ ← Interactive charts
β”‚ Tools β”‚ ← Optimization tools
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### **Data Flow Architecture**
```
User Input β†’ Code Editor β†’ AI Analysis β†’ Visualization Engine β†’ Output
↓ ↓ ↓ ↓ ↓
Validation β†’ Language β†’ Structure β†’ Charts/Diagrams β†’ Export
Detection Analysis Analysis
```

### **State Management**
- **Shared State**: Code, language, and mode settings synchronized across features
- **Centralized Dashboard**: Single point of control for all CodeViz features
- **Event Propagation**: Changes in one component automatically update others

---

## 🎯 Integration Benefits

### **For CodeClarity Users**
- **Enhanced Learning**: Visual understanding of complex code concepts
- **Better Debugging**: AI-powered analysis and optimization suggestions
- **Interactive Experience**: Hands-on code exploration and experimentation
- **Multi-Level Support**: Content adapted to different skill levels

### **For CodeClarity Platform**
- **Feature Completeness**: Advanced code visualization capabilities
- **User Engagement**: Longer session times and higher retention
- **Educational Value**: Stronger positioning in programming education
- **Community Growth**: Expanded contributor base and user community

### **For Developers**
- **Modern Tech Stack**: React 18, TypeScript, Vite
- **Component Library**: Reusable UI components and patterns
- **Performance**: Optimized for production use
- **Extensibility**: Modular architecture for future enhancements

---

## πŸ“ Project Structure

```
CodeViz/
β”œβ”€β”€ src/ # Source code
β”‚ β”œβ”€β”€ components/ # Feature components
β”‚ β”‚ β”œβ”€β”€ features/ # Core feature components
β”‚ β”‚ β”‚ β”œβ”€β”€ CodeEditor.tsx
β”‚ β”‚ β”‚ β”œβ”€β”€ CodeVisualizer.tsx
β”‚ β”‚ β”‚ β”œβ”€β”€ AnalysisPanel.tsx
β”‚ β”‚ β”‚ β”œβ”€β”€ VisualizationPanel.tsx
β”‚ β”‚ β”‚ └── ToolsPanel.tsx
β”‚ β”‚ β”œβ”€β”€ layout/ # Layout components
β”‚ β”‚ β”‚ β”œβ”€β”€ Dashboard.tsx # Main orchestrator
β”‚ β”‚ β”‚ └── Header.tsx
β”‚ β”‚ └── ui/ # Reusable UI components
β”‚ β”œβ”€β”€ hooks/ # Custom React hooks
β”‚ β”œβ”€β”€ lib/ # Utility functions and services
β”‚ β”œβ”€β”€ pages/ # Page components
β”‚ └── assets/ # Static assets
β”œβ”€β”€ public/ # Public assets (cleaned)
β”œβ”€β”€ package.json # Dependencies and scripts
β”œβ”€β”€ .gitignore # Enhanced exclusion patterns
β”œβ”€β”€ README.md # Comprehensive integration guide
β”œβ”€β”€ vite.config.ts # Vite configuration
β”œβ”€β”€ tailwind.config.ts # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json # TypeScript configuration
└── eslint.config.js # ESLint configuration
```

---

## πŸš€ Installation & Setup

### **Prerequisites**
- Node.js 18+
- npm or yarn package manager
- Modern web browser

### **Quick Start**
```bash
# Clone the CodeClarity repository
git clone https://github.com/Sushma-1706/CodeClarity.git

# Navigate to CodeViz
cd CodeClarity/CodeViz

# Install dependencies
npm install

# Start development server
npm run dev
```

The application will be available at `http://localhost:5173`

### **Build Commands**
```bash
# Development
npm run dev

# Production Build
npm run build

# Preview Build
npm run preview

# Clean Build Artifacts
npm run clean

# Type Checking
npm run type-check
```

---

## πŸ“š Documentation

### **Comprehensive Guides**
- **README.md**: Complete project overview and setup instructions
- **Integration Details**: Technical architecture and component communication
- **Project Overview**: Feature breakdown and technology stack
- **Deployment Guide**: Production deployment and configuration
- **Integration Summary**: Complete integration overview

### **Key Information**
- **Multi-Language Support**: Python, JavaScript, Java, C++, C
- **AI Capabilities**: Code analysis, bug detection, optimization suggestions
- **Visualization Types**: Flowcharts, data structures, execution flow
- **Learning Modes**: Simplified vs. technical explanations
- **Export Options**: PNG, SVG, PDF formats

**Made with ❀️ for the CodeClarity Community**
38 changes: 38 additions & 0 deletions CodeViz-new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# πŸš€ CodeViz - AI-Powered Code Visualization Platform

**CodeViz** is a revolutionary AI-powered code visualization and analysis platform designed to make programming education accessible, interactive, and engaging. As a core component of the CodeClarity project, CodeViz transforms complex code into visual, interactive learning experiences.

## πŸ“š Documentation

**πŸ“– [Complete Integration Guide](CODEVIZ_INTEGRATION_GUIDE.md)** - Everything you need to know about CodeViz and how to integrate it with CodeClarity!

## 🎯 Quick Overview

- **Multi-Language Support**: Python, JavaScript, Java, C++, C
- **AI-Powered Analysis**: Intelligent code explanations and optimization suggestions
- **Interactive Visualizations**: Flowcharts, data structures, execution flow diagrams
- **Step-by-Step Execution**: Real-time code simulation with variable tracking
- **Adaptive Learning**: Simplified vs. technical explanations (10-year-old to advanced)

## πŸš€ Quick Start

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build
```

## πŸ”— Integration with CodeClarity

This project is designed to be integrated as a core feature of the [CodeClarity](https://github.com/Sushma-1706/CodeClarity) project.

**For complete integration instructions, see: [CODEVIZ_INTEGRATION_GUIDE.md](CODEVIZ_INTEGRATION_GUIDE.md)**

---

**Ready to enhance CodeClarity with AI-powered code visualization! πŸŽ‰**
20 changes: 20 additions & 0 deletions CodeViz-new/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
Loading