Maintenance
Log Locations
- API Logs:
/opt/edfiadminapp/logs/(Linux) orlogs/(Docker) - Web Server Logs:
/var/log/nginx/(NGiNX) or IIS logs (Windows) - Database Logs:
/var/log/postgresql/(Linux) - System Logs:
journalctl(systemd) or Event Viewer (Windows)
Health Checks
The application provides health check endpoints:
- API Health:
GET /api/healthcheck - Frontend Health:
GET /health(when using NGiNX configuration)
Regular Maintenance Tasks
-
Database Maintenance:
-- Regular vacuum and analyzeVACUUM ANALYZE;-- Check for bloatSELECT schemaname, tablename, attname, n_distinct, most_common_valsFROM pg_stats WHERE tablename = 'your_table'; -
Log Rotation:
# Configure logrotate for application logssudo cat > /etc/logrotate.d/edfiadminapp << 'EOF'/opt/edfiadminapp/logs/*.log {dailyrotate 30compressdelaycompressmissingoknotifemptycopytruncate}EOF -
Backup Strategy:
# Database backup script#!/bin/bashBACKUP_DIR="/backup/edfiadminapp"DATE=$(date +%Y%m%d_%H%M%S)mkdir -p $BACKUP_DIRpg_dump -h localhost -U edfiadminapp sbaa | gzip > $BACKUP_DIR/sbaa_$DATE.sql.gz# Keep only 30 days of backupsfind $BACKUP_DIR -name "*.sql.gz" -mtime +30 -delete
Updates and Upgrades
-
Application Updates:
# Stop servicessudo systemctl stop edfiadminapp-api# Backup current installationsudo cp -r /opt/edfiadminapp /opt/edfiadminapp.backup# Update codecd /opt/edfiadminappgit pull origin mainnpm cinpm run build:apinpm run build:fe# Run migrationsnpm run migrations:run# Restart servicessudo systemctl start edfiadminapp-apisudo systemctl reload nginx -
Database Updates:
- Always backup before schema changes
- Test migrations in staging environment first
- Monitor application logs after updates
-
Security Updates:
- Regular OS security updates
- Keep Node.js and dependencies updated
- Monitor security advisories
Monitoring
Implement monitoring for:
- Application health: API and database connectivity
- Performance metrics: Response times, memory usage
- Security events: Failed authentication attempts
- Resource utilization: CPU, memory, disk space
- Database performance: Query performance, connection counts
Consider using tools like:
- Prometheus + Grafana: For metrics and dashboards
- ELK Stack: For log aggregation and analysis
- Nagios/Zabbix: For infrastructure monitoring