diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index 396bf97..0000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,136 +0,0 @@ -# Development Guide - -## Prerequisites - -- Node.js 18+ installed -- npm or yarn package manager - -## Project Structure - -``` -agora-ai/ -├── frontend/ # Vue.js 3 + Vite application -├── backend/ # Node.js + Express API server -├── LICENSE # MIT License -└── README.md # Project documentation -``` - -## Getting Started - -### 1. Backend Setup - -```bash -cd backend - -# Install dependencies -npm install - -# Create .env file (copy from .env.example) -cp .env.example .env - -# Edit .env and add your Mistral API key -# MISTRAL_API_KEY=your_key_here - -# Start the backend server -npm run dev -``` - -The backend will run on `http://localhost:3000` - -### 2. Frontend Setup - -```bash -cd frontend - -# Install dependencies -npm install - -# Create .env file (copy from .env.example) -cp .env.example .env - -# Start the development server -npm run dev -``` - -The frontend will run on `http://localhost:5173` - -## Available Scripts - -### Backend - -- `npm start` - Start the server -- `npm run dev` - Start the server with auto-reload (Node.js --watch) - -### Frontend - -- `npm run dev` - Start development server with HMR -- `npm run build` - Build for production -- `npm run preview` - Preview production build - -## API Endpoints - -### Health Check -``` -GET /api/health -``` - -### Create Debate -``` -POST /api/debate -Body: { "prompt": "Your project description" } -``` - -### Get Debate -``` -GET /api/debate/:id -``` - -### Add Response -``` -POST /api/debate/:id/response -Body: { "agentRole": "architect", "content": {...} } -``` - -## WebSocket Connection - -The backend supports WebSocket connections for real-time updates. Connect to: -``` -ws://localhost:3000 -``` - -## Database - -The project uses SQLite for data storage. The database file is automatically created at: -``` -backend/data/agora.db -``` - -Schema: -- `debates` - Stores project prompts and debate metadata -- `responses` - Stores AI agent responses for each debate - -## Technology Stack - -### Frontend -- Vue.js 3 (Composition API) -- Vite -- Pinia (State Management) -- Radix Vue (Headless UI Components) -- Mermaid.js (Diagrams) -- VueUse (Utilities) - -### Backend -- Node.js + Express -- WebSocket (ws) -- SQLite (better-sqlite3) -- Helmet (Security) -- CORS -- Express Rate Limit - -## Next Steps - -1. Implement Mistral AI integration for agent responses -2. Add WebSocket real-time communication -3. Implement Mermaid diagram rendering -4. Add voting and consensus mechanisms -5. Create export functionality (JSON, Markdown, PDF) diff --git a/README.md b/README.md index fdc78b7..11522bf 100644 --- a/README.md +++ b/README.md @@ -75,23 +75,27 @@ graph TD --- -## Fonctionnalités implémentées ✅ +## Fonctionnalités -- ✅ Saisie d'un texte décrivant le projet -- ✅ Sélection automatique des agents IA selon le contexte -- ✅ Visualisation des échanges IA en temps réel -- ✅ Intégration Mistral AI pour génération de réponses -- ✅ WebSocket pour mises à jour temps réel -- ✅ Système de consensus avec vote pondéré -- ✅ Rendu de diagrammes Mermaid -- ✅ Stockage SQLite des débats et réponses +### Système multi-agents IA +- **4 agents spécialisés** : Architecte logiciel, Ingénieur backend, Ingénieur frontend, Designer UI/UX +- **Sélection automatique** des agents pertinents selon le contexte du projet +- **Débat collaboratif** : Les agents échangent et négocient pour converger vers la meilleure solution +- **Système de consensus** avec vote pondéré (l'architecte a une voix prépondérante) +- **Intégration Mistral AI** pour génération de réponses intelligentes et contextuelles -## Fonctionnalités à venir +### Interface et visualisation +- **Saisie de prompt** décrivant le projet souhaité +- **Visualisation en temps réel** des échanges entre agents via WebSocket +- **Affichage structuré** des propositions avec justifications et niveaux de confiance +- **Rendu automatique** de diagrammes Mermaid intégrés dans les réponses +- **Indicateurs de progression** et statuts du débat -- [ ] Support upload de documents PDF -- [ ] Exportation JSON, Markdown ou PDF -- [ ] Thème clair/sombre -- [ ] Historique des débats précédents +### Architecture et stockage +- **API REST** pour gestion des débats et récupération des résultats +- **WebSocket** pour streaming temps réel des réponses des agents +- **Base SQLite** pour persistance des débats et historique +- **Gestion d'erreurs** avec fallbacks et réponses de secours --- @@ -148,16 +152,6 @@ sequenceDiagram --- -## Guide de développement - -Consultez [DEVELOPMENT.md](./DEVELOPMENT.md) pour les détails complets sur : -- Structure du projet -- API endpoints -- Architecture des agents IA -- Configuration WebSocket - ---- - ## Licence MIT License — Open-source diff --git a/TESTING.md b/TESTING.md deleted file mode 100644 index adc179a..0000000 --- a/TESTING.md +++ /dev/null @@ -1,226 +0,0 @@ -# Testing Report - Project Agora - -## Test Date: 2025-10-17 - -### ✅ System Status: FULLY FUNCTIONAL - ---- - -## Tests Performed - -### 1. Backend API Tests ✅ - -**Health Check Endpoint** -```bash -curl http://localhost:3000/api/health -# Result: {"status":"ok","message":"Agora AI Backend is running"} -``` - -**Create Debate** -```bash -curl -X POST http://localhost:3000/api/debate \ - -H "Content-Type: application/json" \ - -d '{"prompt":"Create a simple blog platform"}' - -# Result: -{ - "debateId": 2, - "prompt": "Create a simple blog platform", - "agents": ["architect","backend_engineer","frontend_engineer"], - "status": "ongoing" -} -``` - -**Get Debate Results** -```bash -curl http://localhost:3000/api/debate/2 - -# Result: Full debate with detailed AI responses from all agents -# Status: completed -# All agents responded successfully -``` - -### 2. Mistral AI Integration ✅ - -**Issue Fixed:** -- Initial API parameter error: `maxTokens` → `max_tokens` -- Fix applied in `/backend/src/services/mistralClient.js` -- All agent types tested successfully: - - ✅ Architect - - ✅ Backend Engineer - - ✅ Frontend Engineer - -**Response Quality:** -- Detailed architectural proposals -- Technology stack recommendations -- Project structure with components/modules -- Justified technical decisions -- Confidence scores included - -### 3. Database (SQLite) ✅ - -**Location:** `backend/data/agora.db` - -**Tables Verified:** -- `debates` - Stores prompts and status -- `responses` - Stores agent responses with timestamps - -**Operations Tested:** -- Create debate ✅ -- Store responses ✅ -- Retrieve debate history ✅ -- Update status (ongoing → completed) ✅ - -### 4. WebSocket Server ✅ - -**Status:** Running on port 3000 -- WebSocket server initialized successfully -- Ready for real-time client connections -- Broadcasting system implemented - -### 5. Agent Selection System ✅ - -**Automatic Agent Detection:** -- Blog platform → architect, backend_engineer, frontend_engineer -- Todo app → architect, frontend_engineer -- Correctly analyzes prompts for relevant expertise - -### 6. Consensus System ✅ - -**Voting Mechanism:** -- Architect weight: 1.5x -- Other agents: 1.0x -- Confidence-based scoring -- Automatic completion when consensus reached - ---- - -## Security & Configuration ✅ - -### .gitignore Verification -✅ `.env` files excluded -✅ `node_modules/` excluded -✅ `backend/data/` excluded -✅ `*.db` files excluded -✅ Build directories excluded - -### .env.example Files -✅ `backend/.env.example` - Template with required variables -✅ `frontend/.env.example` - API/WebSocket URLs - -### Sensitive Data Protection -✅ No `.env` files in git -✅ No database files in git -✅ No API keys in code -✅ Mistral API key stored securely in `.env` - ---- - -## Example AI Response - -**Prompt:** "Create a simple blog platform" - -**Architect Response:** -```json -{ - "system_architecture": { - "frontend": { - "technology_stack": ["React", "Redux", "Material-UI"], - "modules": ["User Interface", "State Management", "Styling"] - }, - "backend": { - "technology_stack": ["Node.js", "Express", "MongoDB"], - "modules": ["API", "Database", "Authentication"] - }, - "devops": { - "technology_stack": ["Docker", "AWS", "CI/CD Pipeline"], - "modules": ["Containerization", "Deployment", "CI/CD"] - } - }, - "project_structure": { - "frontend": { - "components": ["Header", "Footer", "PostList", "PostDetail", ...], - "services": ["apiService", "authService"], - "reducers": ["postReducer", "authReducer"] - }, - "backend": { - "routes": ["postRoutes", "authRoutes"], - "controllers": ["postController", "authController"], - "models": ["Post", "User"] - } - }, - "confidence": 0.9 -} -``` - ---- - -## Known Working Features - -✅ Multi-agent AI debate system -✅ Real-time WebSocket communication -✅ Mistral AI API integration -✅ SQLite data persistence -✅ Automatic agent selection -✅ Consensus calculation -✅ Mermaid diagram support (frontend ready) -✅ REST API endpoints -✅ Error handling and fallbacks - ---- - -## How to Test Locally - -### Start Backend -```bash -cd backend -npm install -npm start -# Server starts on http://localhost:3000 -``` - -### Test with curl -```bash -# Health check -curl http://localhost:3000/api/health - -# Create debate -curl -X POST http://localhost:3000/api/debate \ - -H "Content-Type: application/json" \ - -d '{"prompt":"Your project idea here"}' - -# Get results (replace :id with debateId from above) -curl http://localhost:3000/api/debate/:id -``` - -### Start Frontend -```bash -cd frontend -npm install -npm run dev -# App opens at http://localhost:5173 -``` - ---- - -## Performance Notes - -- Agent response time: ~5-10 seconds per agent -- Parallel agent processing: All agents respond simultaneously -- Database operations: < 1ms -- API response time: ~10-15ms (excluding AI processing) - ---- - -## Next Steps for Enhancement - -- [ ] Add PDF upload support -- [ ] Implement export functionality (JSON, Markdown, PDF) -- [ ] Add debate history view in frontend -- [ ] Implement dark/light theme -- [ ] Add user authentication -- [ ] Support for custom agent configuration - ---- - -**Test Conclusion:** All core features functional and tested successfully. System ready for production use.