# Project Structure ## ๐Ÿ“ Organized File Structure ``` strands-agents/agent-core/code-interpreter/ โ”œโ”€โ”€ ๐Ÿ“‚ backend/ # FastAPI Backend โ”‚ โ”œโ”€โ”€ main.py # Main application server โ”‚ โ””โ”€โ”€ requirements.txt # Python dependencies โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ frontend/ # React Frontend โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ src/ โ”‚ โ”‚ โ”œโ”€โ”€ App.js # Main React application โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ components/ # React components โ”‚ โ”‚ โ”œโ”€โ”€ CodeEditor.js # Monaco code editor โ”‚ โ”‚ โ”œโ”€โ”€ CodeDisplay.js # Code output display โ”‚ โ”‚ โ”œโ”€โ”€ ExecutionResults.js # Execution results โ”‚ โ”‚ โ””โ”€โ”€ SessionHistory.js # Session management โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ public/ # Static assets โ”‚ โ”œโ”€โ”€ package.json # Node.js dependencies โ”‚ โ””โ”€โ”€ package-lock.json # Dependency lock file โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ tests/ # Test Suite โ”‚ โ”œโ”€โ”€ run_all_tests.py # Comprehensive test runner โ”‚ โ”œโ”€โ”€ verify_setup.py # Setup verification โ”‚ โ”œโ”€โ”€ test_model_fallback.py # Model fallback testing โ”‚ โ”œโ”€โ”€ test_execution_fix.py # Execution result testing โ”‚ โ””โ”€โ”€ debug_code_generation.py # Code generation debugging โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ docs/ # Documentation โ”‚ โ”œโ”€โ”€ ARCHITECTURE.md # System architecture โ”‚ โ”œโ”€โ”€ SETUP.md # Setup instructions โ”‚ โ”œโ”€โ”€ OVERVIEW.md # Project overview โ”‚ โ””โ”€โ”€ [historical docs] # Previous iteration docs โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ venv/ # Python Virtual Environment โ”‚ โ”œโ”€โ”€ bin/ # Executables โ”‚ โ”œโ”€โ”€ lib/ # Python packages โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง Configuration Files โ”‚ โ”œโ”€โ”€ .env # Environment variables โ”‚ โ”œโ”€โ”€ .env.example # Environment template โ”‚ โ””โ”€โ”€ .gitignore # Git ignore rules โ”‚ โ”œโ”€โ”€ ๐Ÿš€ Scripts โ”‚ โ”œโ”€โ”€ setup.sh # Automated setup โ”‚ โ”œโ”€โ”€ start.sh # Application launcher โ”‚ โ””โ”€โ”€ cleanup.sh # Cleanup script โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ Documentation โ”‚ โ”œโ”€โ”€ README.md # Main documentation โ”‚ โ””โ”€โ”€ PROJECT_STRUCTURE.md # This file โ”‚ โ””โ”€โ”€ ๐Ÿ“Š Logs (Generated) โ”œโ”€โ”€ backend.log # Backend logs โ”œโ”€โ”€ frontend.log # Frontend logs โ””โ”€โ”€ *.pid # Process ID files ``` ## ๐ŸŽฏ Key Directories ### `/backend/` **Purpose**: FastAPI server with Strands-Agents integration - **main.py**: Core application with REST APIs and WebSocket handlers - **requirements.txt**: Python dependencies including strands-agents and bedrock-agentcore ### `/frontend/` **Purpose**: React application with AWS Cloudscape UI - **src/App.js**: Main application with tabbed interface - **src/components/**: Reusable React components - **package.json**: Node.js dependencies and scripts ### `/tests/` **Purpose**: Comprehensive testing and verification - **run_all_tests.py**: Full test suite for all components - **verify_setup.py**: Quick setup verification - **test_*.py**: Specific component tests - **debug_*.py**: Debugging utilities ### `/docs/` **Purpose**: Project documentation - **ARCHITECTURE.md**: System design and component details - **SETUP.md**: Detailed setup instructions - **OVERVIEW.md**: Project overview and use cases ## ๐Ÿ”ง Configuration ### Environment Variables (`.env`) ```bash # AWS Configuration AWS_PROFILE=default AWS_REGION=us-east-1 # Application Configuration BACKEND_HOST=0.0.0.0 BACKEND_PORT=8000 REACT_APP_API_URL=http://localhost:8000 ``` ### Scripts - **setup.sh**: Automated environment setup - **start.sh**: Launch backend and frontend - **cleanup.sh**: Clean up processes and temporary files ## ๐Ÿงช Testing Structure ### Test Categories 1. **Environment Tests**: Dependencies, AWS config, file structure 2. **Model Tests**: AI model initialization and fallback 3. **Agent Tests**: Strands-Agents integration 4. **API Tests**: REST endpoints and WebSocket handlers 5. **Integration Tests**: End-to-end functionality ### Running Tests ```bash # Quick verification python tests/verify_setup.py # Comprehensive testing python tests/run_all_tests.py # Specific component testing python tests/test_model_fallback.py ``` ## ๐Ÿ“Š Logging and Monitoring ### Log Files - **backend.log**: FastAPI server logs, agent responses, errors - **frontend.log**: React development server logs - ***.pid**: Process ID files for cleanup ### Health Monitoring - **Health Endpoint**: `GET /health` - System status - **Agent Status**: `GET /api/agents/status` - Agent information - **Model Info**: Current model and fallback status ## ๐Ÿš€ Quick Commands ### Setup and Start ```bash ./setup.sh # Initial setup ./start.sh # Start application ./cleanup.sh # Clean up and reset ``` ### Testing ```bash python tests/verify_setup.py # Verify setup python tests/run_all_tests.py # Run all tests ``` ### Development ```bash # Backend only source venv/bin/activate python backend/main.py # Frontend only cd frontend && npm start ``` ## ๐Ÿ“‹ File Organization Benefits ### โœ… **Improved Maintainability** - Clear separation of concerns - Logical grouping of related files - Easy navigation and discovery ### โœ… **Better Testing** - Centralized test suite - Comprehensive coverage - Easy test execution ### โœ… **Enhanced Documentation** - Organized documentation structure - Clear setup instructions - Architecture overview ### โœ… **Streamlined Development** - Automated setup and cleanup - Consistent project structure - Easy onboarding for new developers This organized structure provides a solid foundation for development, testing, and deployment of the AgentCore Code Interpreter.