137 lines
2.4 KiB
Markdown
137 lines
2.4 KiB
Markdown
# 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)
|