A comprehensive platform to centralize and analyze database information with AI-powered Q&A, Watson Assistant integration, and modern webhook automation. Built with Node.js, MongoDB, Vue.js, and Ollama LLM integration.
- π€ AI-Powered Database Analytics - Ask questions about your databases using Llama 3.1 8B
- π Watson Assistant Integration - Webhook endpoints for automated actions
- π Secure Authentication - Basic Auth with environment-based credentials
- π Centralized Database Management - View and manage database information by hostname
- β‘ Real-time Health Monitoring - Monitor database status and performance
- π§© Modular LLM Architecture - Support for multiple AI providers
- π¨ Modern UI - Clean, responsive interface with IBM Carbon Design
- π³ Containerized Deployment - Docker Compose for easy deployment
- π Webhook Automation - Execute scripts and create issues via API
dba-admin-centralized/
βββ backend/ # Node.js API with Express
β βββ controllers/ # API controllers
β βββ middleware/ # Auth, rate limiting, error handling
β βββ routes/ # API routes
β βββ services/ # Core business logic
β β βββ core/ # Database, query, orchestration
β β βββ llm/ # LLM integration
β β βββ sql/ # SQL parsing and validation
β βββ openapi-webhook.json # Watson Assistant API spec
βββ frontend/ # Vue.js application
β βββ src/
β β βββ components/ # Vue components
β β βββ views/ # Page views
β β βββ utils/ # API utilities
β βββ .env # Frontend environment variables
βββ scripts/ # Deployment and management scripts
βββ nginx/ # Reverse proxy configuration
βββ docker-compose.yml # Container orchestration
- Docker and Docker Compose
- Ollama installed locally
- macOS, Linux, or Windows with WSL2
# Start everything
docker-compose down && docker-compose up -d --build
# Stop everything
docker-compose downThe system uses Basic Authentication with environment variables:
API_USER=your_username
API_TOKEN=your_secure_token
PORT=5002
MONGODB_URI=mongodb://localhost:27017/dba-admin
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1:8bVITE_API_USER=your_username
VITE_API_TOKEN=your_secure_token# Get all databases
curl -u username:token \
https://your-domain.com/api/databases
# Get database by hostname
curl -u username:token \
https://your-domain.com/api/databases/{hostname}
# Create database
curl -u username:token \
-X POST -H "Content-Type: application/json" \
-d '{"hostname":"new-server","ip":"192.168.1.100","type":"PostgreSQL","version":"15.2","region":"US-East","dataCenter":"DC3"}' \
https://your-domain.com/api/databases
# Update database
curl -u username:token \
-X PUT -H "Content-Type: application/json" \
-d '{"hostname":"updated-server","ip":"192.168.1.101","type":"PostgreSQL","version":"15.3","region":"US-East","dataCenter":"DC3"}' \
https://your-domain.com/api/databases/{hostname}
# Delete database
curl -u username:token \
-X DELETE \
https://your-domain.com/api/databases/{hostname}# Ask questions about your databases
curl -u username:token \
-X POST -H "Content-Type: application/json" \
-d '{"question":"How many databases do we have?"}' \
https://your-domain.com/api/qa# Execute scripts
curl -u username:token \
-X POST -H "Content-Type: application/json" \
-d '{"script":"database_backup","env":"prod"}' \
https://your-domain.com/api/run-script
# Create Jira issues
curl -u username:token \
-X POST -H "Content-Type: application/json" \
-d '{"script":"create_issue","summary":"High CPU Usage","description":"Database server showing high CPU","assignee":"admin@company.com"}' \
https://your-domain.com/api/create-issueThe project includes backend/openapi-webhook.json for Watson Assistant integration:
- Webhook endpoints for automated actions
- Basic Auth security
- Script execution capabilities
- Issue creation workflows
- User asks Watson for an action
- Watson calls webhook with parameters
- Backend executes the requested action
- Result returned to Watson
- Watson responds to user
- "Create a backup of the production database"
- "Create a Jira ticket for high CPU usage"
- "Restart the database service"
- "Check database status"
- "Which region has the most databases?"
- "How many PostgreSQL databases are in EU-West?"
- "Show me all Oracle databases"
- "What's the distribution of database types?"
- "Which datacenter has the most Redis instances?"
- "List all databases with version 21c"
- "How many databases per region?"
- "Compare PostgreSQL vs MySQL counts"
- Database backups
- Service restarts
- Issue creation
- Monitoring alerts
- Performance checks
- Frontend: Vue.js application (port 80)
- Backend: Node.js API with LLM integration (port 4000)
- Database: MongoDB (port 27017)
- Ollama: LLM service (port 11434)
- Basic Authentication for all API endpoints
- Rate limiting to prevent abuse
- Environment-based credentials
- CORS protection for web requests
- Input validation and sanitization
- Modular architecture supporting multiple providers
- Ollama integration for local LLM processing
- Context-aware responses
- SQL generation from natural language
- Error handling and fallbacks
API_USER=your_username
API_TOKEN=your_secure_token
PORT=5002
MONGODB_URI=mongodb://
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://
OLLAMA_MODEL=llama3.1:8bVITE_API_USER=your_username
VITE_API_TOKEN=your_secure_tokenAvailable models for Ollama:
llama3.1:8b(default) - Fast, good qualityllama3.1:70b- Higher quality, slowercodellama:7b- Code-focused responsesmistral:7b- Alternative model
cd backend
npm install
npm run devcd frontend
npm install
npm run dev# Test authentication
curl -u username:token \
https://your-domain.com/api/databases
# Test Q&A
curl -u username:token \
-X POST -H "Content-Type: application/json" \
-d '{"question":"How many databases do we have?"}' \
https://your-domain.com/api/qa# Check credentials format
echo "username:token" | base64
# Test Basic Auth
curl -H "Authorization: Basic $(echo -n 'username:token' | base64)" \
https://your-domain.com/api/databases# Check Ollama status
curl http://localhost:11434/api/tags
# Restart Ollama
pkill ollama && ollama serve
# Check backend LLM status
curl -u username:token \
https://your-domain.com/api/llm/status# Rebuild containers
docker-compose down
docker-compose up -d --build
# View logs
docker-compose logs -f
# Check container status
docker-compose ps- Caching for database queries
- Connection pooling for MongoDB
- Rate limiting to prevent abuse
- Compression for API responses
- Efficient LLM processing
- Health checks for all services
- Error logging and tracking
- Performance metrics collection
- Resource usage monitoring
- Basic Auth for all API endpoints
- Environment-based credentials
- No hardcoded secrets in code
- Secure credential management
- Input validation and sanitization
- SQL injection prevention
- XSS protection in frontend
- CORS configuration for web security
- Use strong, unique credentials for each environment
- Rotate credentials regularly
- Use HTTPS in production
- Never commit
.envfiles to version control - Implement proper logging and monitoring
- Consider OAuth 2.0 for production deployments
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.