Add comprehensive web-based admin interface

Creates a production-ready admin interface with FastAPI backend and React frontend:

Backend Features:
- FastAPI server with JWT authentication and WebSocket support
- Comprehensive API endpoints for dashboard, characters, conversations, analytics
- Real-time metrics and activity monitoring with WebSocket broadcasting
- System control endpoints for pause/resume and configuration management
- Advanced analytics including topic trends, relationship networks, community health
- Export capabilities for conversations and character data

Frontend Features:
- Modern React/TypeScript SPA with Tailwind CSS styling
- Real-time dashboard with live activity feeds and system metrics
- Character management interface with profiles and relationship visualization
- Conversation browser with search, filtering, and export capabilities
- Analytics dashboard with charts and community insights
- System status monitoring and control interface
- Responsive design with mobile support

Key Components:
- Authentication system with session management
- WebSocket integration for real-time updates
- Chart visualizations using Recharts
- Component library with consistent design system
- API client with automatic token management
- Toast notifications for user feedback

Admin Interface Access:
- Backend: http://localhost:8000 (FastAPI with auto-docs)
- Frontend: http://localhost:3000/admin (React SPA)
- Default credentials: admin/admin123
- Startup script: python scripts/start_admin.py

This provides complete observability and management capabilities for the autonomous character ecosystem.
This commit is contained in:
2025-07-04 21:58:39 -07:00
parent 282eeb60ca
commit d6ec5ad29c
38 changed files with 4673 additions and 10 deletions

View File

@@ -31,19 +31,46 @@ A fully autonomous Discord bot ecosystem where AI characters chat with each othe
- Self-reflection cycles for personality development
- Ability to create their own social rules and norms
### 🧠 Advanced RAG & Memory Systems
- Multi-layer vector databases (ChromaDB) for semantic memory storage
- Personal, community, and creative knowledge separation
- Importance scoring and memory decay over time
- Cross-character memory sharing capabilities
- Memory consolidation to prevent information overflow
### 🔧 MCP (Model Context Protocol) Integration
- Self-modification server for autonomous personality changes
- File system access for personal and community digital spaces
- Calendar/time awareness for scheduling and milestone tracking
- Relationship maintenance automation
- Creative work management and collaboration
### 📊 Comprehensive Admin Interface
- Real-time dashboard with live activity monitoring
- Character management and analytics
- Conversation browser with search and export
- Community health metrics and insights
- System controls and configuration management
- WebSocket-based real-time updates
## Architecture
```
discord_fishbowl/
├── src/
│ ├── bot/ # Discord bot integration
│ ├── characters/ # Character system & personality
│ ├── conversation/ # Autonomous conversation engine
│ ├── database/ # Database models & connection
│ ├── llm/ # LLM integration & prompts
── utils/ # Configuration & logging
├── config/ # Configuration files
└── docker-compose.yml # Container deployment
│ ├── admin/ # Admin interface backend (FastAPI)
│ ├── bot/ # Discord bot integration
│ ├── characters/ # Character system & personality
│ ├── conversation/ # Autonomous conversation engine
│ ├── database/ # Database models & connection
── llm/ # LLM integration & prompts
│ ├── mcp/ # Model Context Protocol servers
│ ├── rag/ # RAG systems & vector databases
│ └── utils/ # Configuration & logging
├── admin-frontend/ # React/TypeScript admin interface
├── config/ # Configuration files
├── scripts/ # Utility scripts
└── docker-compose.yml # Container deployment
```
## Requirements
@@ -144,13 +171,51 @@ The system will automatically create characters from `config/characters.yaml` on
### 7. Run the Application
```bash
# Run directly
# Run the main Discord bot
python src/main.py
# Or using Docker
docker-compose up --build
```
### 8. Admin Interface (Optional)
The Discord Fishbowl includes a comprehensive web-based admin interface for monitoring and managing the character ecosystem.
#### Quick Start
```bash
# Start both backend and frontend
python scripts/start_admin.py
```
This will start:
- **FastAPI backend** on http://localhost:8000
- **React frontend** on http://localhost:3000/admin
#### Manual Setup
```bash
# Start the admin backend
cd discord_fishbowl
uvicorn src.admin.app:app --host 0.0.0.0 --port 8000 --reload
# In a new terminal, start the frontend
cd admin-frontend
npm install
npm start
```
#### Default Login
- **Username**: admin
- **Password**: admin123
#### Admin Features
- 📊 **Real-time Dashboard**: Live activity monitoring and system metrics
- 👥 **Character Management**: Profile viewing, relationship networks, evolution tracking
- 💬 **Conversation Browser**: Search, analyze, and export conversations
- 📈 **Analytics**: Community health, topic trends, engagement metrics
- ⚙️ **System Controls**: Pause/resume, configuration, performance monitoring
- 🔒 **Safety Tools**: Content moderation and intervention capabilities
## Configuration
### Character Configuration (`config/characters.yaml`)