3.1 KiB
3.1 KiB
Calejo Control Adapter - Quick Start Guide
🚀 5-Minute Setup with Docker
Prerequisites
- Docker and Docker Compose installed
- At least 4GB RAM available
Step 1: Get the Code
git clone <repository-url>
cd calejo-control-adapter
Step 2: Start Everything
docker-compose up -d
Step 3: Verify Installation
# Check if services are running
docker-compose ps
# Test the API
curl http://localhost:8080/health
Step 4: Access the Interfaces
- REST API: http://localhost:8080
- API Documentation: http://localhost:8080/docs
- Grafana Dashboard: http://localhost:3000 (admin/admin)
- Prometheus Metrics: http://localhost:9091
🔧 Basic Configuration
Environment Variables
Create a .env file:
# Copy the example
cp .env.example .env
# Edit with your settings
nano .env
Key settings to change:
JWT_SECRET_KEY=your-very-secure-secret-key
API_KEY=your-api-access-key
DATABASE_URL=postgresql://calejo:password@postgres:5432/calejo
📊 Monitoring Your System
Health Checks
# Basic health
curl http://localhost:8080/health
# Detailed health
curl http://localhost:8080/api/v1/health/detailed
# Prometheus metrics
curl http://localhost:8080/metrics
Key Metrics to Watch
- Application uptime
- Database connection count
- Active protocol connections
- Safety violations
- API request rate
🔒 Security First Steps
-
Change Default Passwords
- Update PostgreSQL password in
.env - Change Grafana admin password
- Rotate API keys and JWT secret
- Update PostgreSQL password in
-
Network Security
- Restrict access to management ports
- Use VPN for remote access
- Enable TLS/SSL for APIs
🛠️ Common Operations
Restart Services
docker-compose restart
View Logs
# All services
docker-compose logs
# Specific service
docker-compose logs calejo-control-adapter
Stop Everything
docker-compose down
Update to Latest Version
docker-compose down
git pull
docker-compose build --no-cache
docker-compose up -d
🆘 Troubleshooting
Service Won't Start
- Check if ports are available:
netstat -tulpn | grep <port> - Verify Docker is running:
docker info - Check logs:
docker-compose logs
Database Connection Issues
- Ensure PostgreSQL container is running
- Check connection string in
.env - Verify database initialization completed
Performance Issues
- Monitor system resources:
docker stats - Check application logs for errors
- Verify database performance
📞 Getting Help
- Documentation: See
DEPLOYMENT.mdfor detailed instructions - Issues: Check the GitHub issue tracker
- Support: Email support@calejo-control.com
🎯 Next Steps
- Configure Pump Stations - Add your actual pump station data
- Set Up Alerts - Configure monitoring alerts in Grafana
- Integrate with SCADA - Connect to your existing control systems
- Security Hardening - Implement production security measures
Need more help? Check the full documentation in DEPLOYMENT.md or contact our support team.