Admin Guide
Complete administration guide for SmartFall system managers.
Admin Roles
Only users with ADMIN role can access admin functions.
Granting Admin Access
# Via database
UPDATE "User" SET role = 'ADMIN' WHERE email = 'admin@example.com';
# Via admin API
POST /api/admin/users/{userId}/role
{ "role": "ADMIN" }
Admin Dashboard
Access at /admin after login (ADMIN role required)
Dashboard Sections
- System Statistics: Overview of system health
- User Management: Create, edit, delete users
- Device Management: Monitor and manage devices
- Fall Events: Review all fall events
- System Logs: Access audit and error logs
Key Functions
User Management
Create and manage user accounts and roles
Device Management
Monitor and manage IoT devices
Fall Management
Review and investigate fall events
System Logs
Access audit, error, and activity logs
Maintenance Tasks
Daily
- Monitor system health
- Review error logs
- Check active alerts
- Verify backups completed
Weekly
- Review user activity
- Check device health
- Analyze fall trends
- Update documentation
Monthly
- Generate reports
- Review security logs
- Audit user roles
- Plan capacity
Quarterly
- Security assessment
- Performance optimization
- Backup verification
- Disaster recovery drill
Backup & Recovery
Automated Backups
Daily automated backups configured:
# View backup status
docker exec smartfall-postgres pg_dump --version
# Manual backup
docker exec smartfall-postgres pg_dump -U smartfall smartfall > backup.sql
Recovery Process
- Identify backup to restore
- Notify users of maintenance
- Stop application
- Restore database from backup
- Verify data integrity
- Restart application
- Notify users
Security Monitoring
Suspicious Activities
Monitor for:
- Multiple failed login attempts
- Unusual IP addresses
- Rate limit violations
- Unauthorized API access
Security Best Practices
- Access Control: Regular role audits
- Secrets: Rotate JWT secrets quarterly
- Updates: Keep system and dependencies updated
- Backups: Test backup restoration
- Monitoring: Alert on anomalies
Troubleshooting
System Down
- Check server status
- Review error logs
- Verify database connection
- Check disk space
- Restart if needed
Database Issues
- Check connections
- Review slow queries
- Monitor disk usage
- Check replication status
API Performance
- Check request logs
- Monitor response times
- Identify bottlenecks
- Scale if needed