# 🔐 Church Music Database - Login Credentials

## Live Site

**URL:** <https://houseofprayer.ddns.net>

## Login Credentials

- **Username:** `hop`
- **Password:** `hop@2026ilovejesus`

## What Was Fixed (Dec 17, 2025)

### 1. ✅ Missing CryptoJS Library

**Problem:** Login page couldn't hash passwords - CryptoJS not loaded
**Solution:** Added CryptoJS CDN link to `frontend/public/index.html`

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js"></script>
```

### 2. ✅ Profile Management Glitching

**Problem:** Rate limiting too aggressive (30-60 req/min)
**Solution:** Increased rate limits to 300 req/min for:

- `/api/profiles`
- `/api/profiles/<pid>/songs`
- `/api/profiles/<pid>/songs/<sid>`

### 3. ✅ Backend Connection Pool Issues

**Problem:** Manual `db.close()` calls causing pool exhaustion
**Solution:** Removed all manual close() calls, rely on Flask teardown handler

### 4. ✅ Frontend Not Serving

**Problem:** Port conflicts and missing dependencies
**Solution:**

- Installed `flask-compress` and `flask-caching`
- Restarted services on correct ports (8080 backend, 5100 frontend)

## Services Status

```bash
# Check all services
sudo systemctl status church-music-backend church-music-frontend nginx

# Restart if needed
sudo systemctl restart church-music-backend church-music-frontend
```

## Testing Login

1. Go to <https://houseofprayer.ddns.net>
2. Enter username: `hop`
3. Enter password: `hop@2026ilovejesus`
4. Should login instantly without errors

## Technical Details

### Password Hash

- Algorithm: SHA-256
- Input: `hop@2026ilovejesus`
- Hash: `5cdf907c69ae7a7f0c2e18a67e9b70a4c4fc35f9582637354c1bc45edf092a79`

### Authentication Method

- Client-side authentication (no backend auth endpoint)
- Password hashed in browser using CryptoJS
- Session stored in sessionStorage
- Session expires on browser close

## All Issues Resolved ✅

- ✅ Login working (CryptoJS loaded)
- ✅ Profile management smooth (rate limits increased)
- ✅ Songs loading correctly (backend optimized)
- ✅ No glitching or flickering (frontend fixed)
- ✅ Services running on correct ports
- ✅ HTTPS working with SSL

---
**Last Updated:** December 17, 2025 22:30 CST
**Status:** ✅ PRODUCTION READY - ALL ISSUES RESOLVED 🚀

## System Verification

Run this command anytime to verify system health:

```bash
/media/pts/Website/Church_HOP_MusicData/verify-system.sh
```

## Ports (LOCKED - DO NOT CHANGE)

- **Backend API:** Port 8080 (Gunicorn workers: 2)
- **Frontend:** Port 5100 (Node serve)
- **HTTPS:** Port 443 (Nginx reverse proxy)

## Auto-Start Enabled

Services automatically start on server boot:

- `church-music-backend.service` → Port 8080
- `church-music-frontend.service` → Port 5100

## Service Management

```bash
# Check status
sudo systemctl status church-music-backend church-music-frontend

# Restart if needed
sudo systemctl restart church-music-backend church-music-frontend

# View logs
sudo journalctl -u church-music-backend -f
sudo journalctl -u church-music-frontend -f
```

## All Issues Fixed ✅

✅ Login Enter key working
✅ Profile creation working (Redis cache disabled)
✅ No glitching or flickering
✅ Correct ports locked (8080, 5100)
✅ Services managed by systemd
✅ Auto-start on boot enabled
✅ Pre-start port cleanup script active
