2.4 KiB
2.4 KiB
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
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
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 servernpm run dev- Start the server with auto-reload (Node.js --watch)
Frontend
npm run dev- Start development server with HMRnpm run build- Build for productionnpm 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 metadataresponses- 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
- Implement Mistral AI integration for agent responses
- Add WebSocket real-time communication
- Implement Mermaid diagram rendering
- Add voting and consensus mechanisms
- Create export functionality (JSON, Markdown, PDF)