A full-stack application that implements a swarm-based code generation system with a .NET 8 backend and React frontend. This system enables interactive code generation through a chat interface with support for visualization using Mermaid diagrams.
graph TD
subgraph Frontend [React Frontend]
UI[User Interface]
MI[MessageInput Component]
ML[MessageList Component]
MB[MermaidBlock Component]
EB[ErrorBoundary Component]
UI --> MI
UI --> ML
ML --> MB
UI --> EB
end
subgraph Backend [.NET 8 Backend]
AC[AgentsController]
AS[AgentService]
IAS[IAgentService Interface]
AC --> AS
AS --> IAS
end
subgraph DTOs [Data Transfer Objects]
MD[MessageDto]
TD[TextMessageDto]
SR[SwarmResponseDto]
ER[ErrorResponseDto]
end
Frontend -- HTTP/REST --> Backend
Backend --> DTOs
The project consists of two main parts:
- A React frontend built with Vite for the user interface
- A .NET 8 backend that handles the code generation logic
- .NET 8.0 SDK
- Node.js (16+ recommended) and npm
cd AutogenAgentWorkflow/AutogenAgentWorkflow
dotnet restore
dotnet runcd d:/CodeGenerationSwarm
npm install
npm run devThe frontend will be available at http://localhost:5173, and the backend API at https://localhost:7296.
src/App.jsx- Main application and chat state managementsrc/components/MessageList.jsx- Message history and displaysrc/components/MessageInput.jsx- User input interfacesrc/components/MermaidBlock.jsx- Mermaid diagram renderingsrc/components/ErrorBoundary.jsx- Error handling
Controllers/AgentsController.cs- API endpointsAgents/AgentService.cs- Core swarm logicEntities/- Data transfer objects
- The application communicates with the backend at
/api/Agents/PythonCodingSwarmendpoint - The backend implements a RESTful API using .NET 8
- Supports various message types through DTOs:
MessageDto: Base message structureTextMessageDto: Text-based messagesSwarmResponseDto: Swarm processing resultsErrorResponseDto: Error handling
- The project uses Vite's dev proxy configuration (
vite.config.js) to handle API requests - Proxy forwards
/api/*requests to the backend server - This setup eliminates CORS and certificate issues during development
- For production deployment, ensure proper SSL/TLS certification
- Configure appropriate CORS policies in the backend
- Review and update security settings in
appsettings.json
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License.