|
| 1 | +# DeepCode New UI |
| 2 | + |
| 3 | +Modern, intelligent UI for DeepCode - AI-powered code generation platform. |
| 4 | + |
| 5 | +## Technology Stack |
| 6 | + |
| 7 | +- **Backend**: FastAPI (Python) |
| 8 | +- **Frontend**: React 18 + TypeScript + Vite |
| 9 | +- **Styling**: Tailwind CSS + shadcn/ui |
| 10 | +- **State Management**: Zustand |
| 11 | +- **Real-time Communication**: WebSocket |
| 12 | +- **Workflow Visualization**: React Flow |
| 13 | +- **Code Display**: Monaco Editor |
| 14 | + |
| 15 | +## Features |
| 16 | + |
| 17 | +### Intelligent Features |
| 18 | + |
| 19 | +1. **Real-time Streaming Output** - Watch code generation in real-time, like ChatGPT |
| 20 | +2. **Smart Context Awareness** - Remembers conversation history, provides intelligent suggestions |
| 21 | +3. **Adaptive Interface** - Layout adjusts based on task type |
| 22 | +4. **Visual Workflow** - Draggable flow-chart style task visualization |
| 23 | + |
| 24 | +### Design Style |
| 25 | + |
| 26 | +- Clean, modern design inspired by Notion/Linear |
| 27 | +- Light theme with blue accent colors |
| 28 | +- Inter font for text, JetBrains Mono for code |
| 29 | + |
| 30 | +## Project Structure |
| 31 | + |
| 32 | +``` |
| 33 | +new_ui/ |
| 34 | +├── backend/ # FastAPI Backend |
| 35 | +│ ├── main.py # Entry point |
| 36 | +│ ├── config.py # Configuration |
| 37 | +│ ├── api/ |
| 38 | +│ │ ├── routes/ # REST API endpoints |
| 39 | +│ │ └── websockets/ # WebSocket handlers |
| 40 | +│ ├── services/ # Business logic |
| 41 | +│ └── models/ # Pydantic models |
| 42 | +│ |
| 43 | +├── frontend/ # React Frontend |
| 44 | +│ ├── src/ |
| 45 | +│ │ ├── components/ # React components |
| 46 | +│ │ ├── pages/ # Page components |
| 47 | +│ │ ├── hooks/ # Custom hooks |
| 48 | +│ │ ├── stores/ # Zustand stores |
| 49 | +│ │ ├── services/ # API client |
| 50 | +│ │ └── types/ # TypeScript types |
| 51 | +│ ├── package.json |
| 52 | +│ └── vite.config.ts |
| 53 | +│ |
| 54 | +└── scripts/ |
| 55 | + ├── start_dev.sh # Development startup |
| 56 | + └── build.sh # Production build |
| 57 | +``` |
| 58 | + |
| 59 | +## Quick Start |
| 60 | + |
| 61 | +### Prerequisites |
| 62 | + |
| 63 | +- Python 3.10+ |
| 64 | +- Node.js 18+ |
| 65 | +- npm or yarn |
| 66 | + |
| 67 | +### Development |
| 68 | + |
| 69 | +1. **Start both backend and frontend:** |
| 70 | + |
| 71 | +```bash |
| 72 | +cd new_ui |
| 73 | +chmod +x scripts/start_dev.sh |
| 74 | +./scripts/start_dev.sh |
| 75 | +``` |
| 76 | + |
| 77 | +2. **Or start separately:** |
| 78 | + |
| 79 | +Backend: |
| 80 | +```bash |
| 81 | +cd new_ui/backend |
| 82 | +pip install -r requirements.txt # First time only |
| 83 | +uvicorn main:app --reload --port 8000 |
| 84 | +``` |
| 85 | + |
| 86 | +Frontend: |
| 87 | +```bash |
| 88 | +cd new_ui/frontend |
| 89 | +npm install # First time only |
| 90 | +npm run dev |
| 91 | +``` |
| 92 | + |
| 93 | +3. **Access the application:** |
| 94 | + - Frontend: http://localhost:5173 |
| 95 | + - Backend API: http://localhost:8000 |
| 96 | + - API Documentation: http://localhost:8000/docs |
| 97 | + |
| 98 | +### Production Build |
| 99 | + |
| 100 | +```bash |
| 101 | +cd new_ui |
| 102 | +chmod +x scripts/build.sh |
| 103 | +./scripts/build.sh |
| 104 | +``` |
| 105 | + |
| 106 | +## API Endpoints |
| 107 | + |
| 108 | +### REST API |
| 109 | + |
| 110 | +| Method | Endpoint | Description | |
| 111 | +|--------|----------|-------------| |
| 112 | +| POST | `/api/v1/workflows/paper-to-code` | Start paper-to-code workflow | |
| 113 | +| POST | `/api/v1/workflows/chat-planning` | Start chat-based planning | |
| 114 | +| GET | `/api/v1/workflows/status/{task_id}` | Get workflow status | |
| 115 | +| POST | `/api/v1/requirements/questions` | Generate guiding questions | |
| 116 | +| POST | `/api/v1/requirements/summarize` | Summarize requirements | |
| 117 | +| POST | `/api/v1/files/upload` | Upload file | |
| 118 | +| GET | `/api/v1/config/settings` | Get settings | |
| 119 | + |
| 120 | +### WebSocket Endpoints |
| 121 | + |
| 122 | +| Endpoint | Description | |
| 123 | +|----------|-------------| |
| 124 | +| `/ws/workflow/{task_id}` | Real-time workflow progress | |
| 125 | +| `/ws/code-stream/{task_id}` | Streaming code output | |
| 126 | +| `/ws/logs/{session_id}` | Live log streaming | |
| 127 | + |
| 128 | +## Configuration |
| 129 | + |
| 130 | +The new UI reads configuration from the existing DeepCode config files: |
| 131 | + |
| 132 | +- `mcp_agent.config.yaml` - LLM provider, models, MCP server settings |
| 133 | +- `mcp_agent.secrets.yaml` - API keys |
| 134 | + |
| 135 | +## Integration |
| 136 | + |
| 137 | +The new UI integrates with existing DeepCode components: |
| 138 | + |
| 139 | +- `workflows/agent_orchestration_engine.py` - Core workflow execution |
| 140 | +- `workflows/agents/` - Specialized agents |
| 141 | +- `utils/llm_utils.py` - LLM provider management |
| 142 | + |
| 143 | +## Browser Support |
| 144 | + |
| 145 | +- Chrome (recommended) |
| 146 | +- Firefox |
| 147 | +- Safari |
| 148 | +- Edge |
| 149 | + |
| 150 | +## License |
| 151 | + |
| 152 | +MIT License - see main DeepCode license. |
0 commit comments