DMLog is a comprehensive Dungeons & Dragons campaign management system with AI-powered character automation. Built with modern Python async patterns, it provides real-time session tracking, character management, and campaign organization tools for both Dungeon Masters and players.
- Create and manage D&D characters with full stats and background
- Track character memories with importance scoring
- Log and analyze character decisions with confidence metrics
- Character leveling and progression tracking
- Support for all D&D 5e classes and races
- Create and manage multiple campaigns
- Session scheduling and tracking
- Campaign world building and lore management
- Player character assignment to campaigns
- Campaign statistics and analytics
- WebSocket-based real-time session updates
- Live dice rolling and skill checks
- Combat tracking and initiative management
- Session transcripts and summaries
- Multi-user support for players and DMs
- AI-powered character decision making
- Automatic memory consolidation
- Cultural transmission between characters
- Dynamic narrative generation
- Character personality evolution
- Prometheus metrics collection
- Grafana dashboards for visualization
- Performance monitoring
- Resource usage tracking
- Custom analytics and reporting
DMLog is built with a modern, scalable architecture:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ FastAPI │ │ PostgreSQL │
│ (Dashboard) │◄──►│ Backend │◄──►│ Database │
│ │ │ │ │ │
│ - HTML/JS/CSS │ │ - Async/await │ │ - Async Driver │
│ - Bootstrap 5 │ │ - Pydantic │ │ - Migrations │
│ - WebSocket │ │ - Middleware │ │ - Connection │
│ │ │ - Validation │ │ Pooling │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐
│ Redis │ │ Qdrant │
│ Cache │ │ Vector DB │
│ │ │ │
│ - Session Store │ │ - Memory │
│ - Query Cache │ │ Embeddings │
│ - Pub/Sub │ │ - Similarity │
│ │ │ Search │
└─────────────────┘ └─────────────────┘
- Docker 20.10+ and Docker Compose 2.0+
- Git for cloning the repository
- 4GB+ RAM and 20GB+ storage recommended
# Clone and deploy in one command
git clone https://github.com/dmlog/dmlog.git && cd dmlog && ./deploy.sh developmentThat's it! DMLog will automatically:
- ✅ Set up all services (PostgreSQL, Redis, API, Frontend)
- ✅ Run database migrations
- ✅ Start monitoring tools
- ✅ Open your browser to the application
🎉 Access Points:
- 🎮 Main Dashboard: http://localhost:3000
- 📚 API Documentation: http://localhost:8000/docs
- 📊 Monitoring: http://localhost:3001 (admin/admin)
📖 Need help? Check our Quick Start Guide for detailed instructions.
DMLog/
├── source_code/
│ ├── backend/ # FastAPI backend
│ │ ├── api/ # API routes and schemas
│ │ ├── cache/ # Redis caching layer
│ │ ├── database/ # Database models and repos
│ │ ├── monitoring/ # Metrics collection
│ │ └── config/ # Configuration
│ └── frontend/ # Web dashboard
│ ├── index.html # Main dashboard
│ └── app.js # Frontend logic
├── production_env/
│ ├── docker/ # Docker configurations
│ ├── grafana/ # Monitoring dashboards
│ └── nginx/ # Reverse proxy config
├── scripts/ # Utility scripts
├── tests/ # Test suite
├── migrations/ # Database migrations
└── docs/ # Documentation
The application uses environment variables for configuration. Copy .env.example to .env and customize:
# Application
APP_NAME=DMLog
APP_VERSION=1.0.0
DEBUG=false
ENVIRONMENT=production
# Database
DATABASE_URL=postgresql+asyncpg://user:pass@host:5432/dmlog
# Redis
REDIS_URL=redis://host:6379/0
# AI Services
OPENAI_API_KEY=your-key-here
ANTHROPIC_API_KEY=your-key-here
# Security
SECRET_KEY=your-secret-key-here
CORS_ORIGINS=https://yourdomain.com📖 Complete Documentation: Documentation Suite
| Audience | Document | Description |
|---|---|---|
| 👥 Users | User Manual | Learn how to use DMLog |
| 🚀 Quick Start | Quick Start Guide | Get running in minutes |
| 🛠️ Developers | Contributing Guide | Contribute to DMLog |
| 🏗️ Technical | Technical Architecture | System design and architecture |
| 🚀 Deployment | Deployment Guide | Deploy to production |
| 🔍 API Reference | API Documentation | Complete API reference |
| 🐛 Troubleshooting | Troubleshooting Guide | Common issues and solutions |
| 🔒 Security | Security Policy | Security information and reporting |
| 📋 Changelog | CHANGELOG.md | Version history and changes |
🎯 Interactive API Docs: http://localhost:8000/docs (after deployment)
| Resource | Endpoints | Description |
|---|---|---|
| Characters | /api/v1/characters/ |
Manage D&D characters |
| Campaigns | /api/v1/campaigns/ |
Campaign organization |
| Sessions | /api/v1/sessions/ |
Session management |
| Health | /api/v1/health/ |
System health checks |
// Connect to real-time updates
const ws = new WebSocket('ws://localhost:8000/ws/connect?user_id=your_id');
// Join a session
ws.send(JSON.stringify({
type: 'join',
data: { session_id: 'session-123' }
}));🔍 Try the API: After deployment, visit http://localhost:8000/docs for interactive API documentation.
Run the test suite:
# Install test dependencies
pip install pytest pytest-asyncio pytest-cov
# Run all tests
pytest
# Run with coverage
pytest --cov=source_code/backend --cov-report=html
# Run specific tests
pytest tests/test_characters.pyMetrics are exposed at /metrics:
- HTTP request count and duration
- Database query performance
- Cache hit rates
- Active WebSocket connections
- System resource usage
Pre-configured dashboards include:
- Application Overview
- Database Performance
- Cache Analytics
- System Resources
Access: http://localhost:3001 (admin/admin)
./deploy.sh development./deploy.sh production./deploy.sh aws-ec2 latest ec2-user@your-instance.com./deploy.sh jetsonSee DEPLOYMENT.md for detailed deployment instructions.
# Create new migration
alembic revision --autogenerate -m "Description"
# Apply migrations
alembic upgrade head
# Rollback migration
alembic downgrade -1# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r source_code/backend/requirements_full.txt
# Run database migrations
alembic upgrade head
# Start development server
uvicorn source_code/backend.api_server_new:app --reloadThe project uses:
- Black for code formatting
- isort for import sorting
- flake8 for linting
- mypy for type checking
# Format code
black source_code/backend/
isort source_code/backend/
# Lint code
flake8 source_code/backend/
# Type check
mypy source_code/backend/- Database schema and models
- API server with FastAPI
- Basic CRUD operations
- Caching layer with Redis
- Monitoring with Prometheus/Grafana
- WebSocket support
- Basic frontend dashboard
- Advanced character management
- Session recording and playback
- Dice rolling system
- Combat tracking
- Skill challenges
- QLoRA model training
- Character personality AI
- Decision-making engine
- Memory consolidation
- Cultural transmission
- Campaign templates
- Custom homebrew content
- Integration with D&D Beyond
- Voice chat support
- Mobile app
- Performance optimization
- Security audit
- Documentation
- User testing
- Production deployment
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI - Modern, fast web framework
- SQLAlchemy - SQL toolkit and ORM
- PostgreSQL - Powerful relational database
- Redis - In-memory data structure store
- Docker - Container platform
- Bootstrap - Frontend UI framework
For support:
- Create an issue on GitHub
- Check the documentation
- Join our Discord community
- Initial release
- Core CRUD operations
- WebSocket support
- Basic monitoring
- Deployment scripts
Made with ❤️ by the DMLog team