diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ecefa2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Virtual Environment +venv/ +ENV/ +env/ +.venv/ + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ +.DS_Store + +# Testing +.pytest_cache/ +.coverage +htmlcov/ + +# Data +data/processed/ +data/raw/ diff --git a/Project/project_exercise.pdf b/Project/project_exercise.pdf deleted file mode 100644 index 920afa4..0000000 Binary files a/Project/project_exercise.pdf and /dev/null differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..abc56b1 --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# AISE AI Code Editor + +AI-Supported Lightweight Code Editor built with Streamlit (AISE501 Spring 2026) + +## Project Structure + +``` +AISE_AIAgent/ +├── frontend/ # Streamlit UI Components +│ ├── __init__.py +│ ├── app.py # Main Streamlit application +│ ├── sidebar.py # File navigation sidebar +│ ├── editor.py # Code editor pane +│ └── chat.py # Chat interface +│ +├── backend/ # Backend Logic Modules +│ ├── __init__.py +│ └── managers/ # Business logic managers +│ ├── __init__.py +│ ├── file_manager.py # File I/O operations +│ ├── chat_manager.py # AI chat management +│ ├── system_prompter.py # System prompts & context +│ ├── search_manager.py # Internet search +│ ├── execution_engine.py # Code execution +│ └── debug_logger.py # Logging & debugging +│ +├── tests/ # Unit tests +│ ├── __init__.py +│ ├── test_file_manager.py +│ ├── test_chat_manager.py +│ └── test_execution_engine.py +│ +├── .gitignore # Git exclusions +├── requirements.txt # Python dependencies +└── README.md # This file +``` + +## Features + +- **File Display & Management**: Browse and edit code files +- **Chat Interface**: AI-powered code assistant +- **Code Execution**: Run Python code with debugging +- **Internet Search**: Fetch documentation and examples +- **System Prompts**: Context-aware AI interactions + +## Setup + +### 1. Activate Virtual Environment + +```bash +# Windows +.\.venv\Scripts\Activate.ps1 + +# macOS/Linux +source .venv/bin/activate +``` + +### 2. Install Dependencies + +```bash +pip install -r requirements.txt +``` + +### 3. Run Application + +```bash +streamlit run frontend/app.py +``` + +### 4. Run Tests + +```bash +pytest tests/ +``` + +## Architecture + +The application follows a frontend-backend split: + +- **Frontend**: Streamlit UI components (sidebar, editor, chat) +- **Backend**: Specialized manager modules + - FileManager: File operations + - ChatManager: AI interaction + - SystemPrompter: Prompt management + - SearchManager: Internet search + - ExecutionEngine: Code execution + - DebugLogger: Error handling & logging + +## Development + +Use Git to track changes: + +```bash +git add . +git commit -m "Your message" +git push origin sturcture +``` diff --git a/backend/__init__.py b/backend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/__init__.py b/backend/managers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/chat_manager.py b/backend/managers/chat_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/debug_logger.py b/backend/managers/debug_logger.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/execution_engine.py b/backend/managers/execution_engine.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/file_manager.py b/backend/managers/file_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/search_manager.py b/backend/managers/search_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/managers/system_prompter.py b/backend/managers/system_prompter.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/__init__.py b/frontend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/app.py b/frontend/app.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/chat.py b/frontend/chat.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/editor.py b/frontend/editor.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/sidebar.py b/frontend/sidebar.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5882de9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,20 @@ +# Core Framework +streamlit>=1.28.0 + +# AI/LLM Integration +openai>=1.0.0 + +# Web & API +requests>=2.31.0 +beautifulsoup4>=4.12.0 + +# Data Processing +numpy>=1.24.0 +pandas>=2.0.0 + +# Testing +pytest>=7.0.0 +pytest-cov>=4.0.0 + +# Development & Utilities +python-dotenv>=1.0.0 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..eb3c09d --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# Test Package diff --git a/tests/test_chat_manager.py b/tests/test_chat_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_execution_engine.py b/tests/test_execution_engine.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_file_manager.py b/tests/test_file_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000..14df880 --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,6 @@ +"""Test cases for the main module.""" + + +def test_placeholder(): + """Placeholder test.""" + assert True