4.1 KiB
4.1 KiB
✅ PostgreSQL Setup Complete
Date: December 14, 2025
Status: All services running with PostgreSQL
What Was Done
1. ✅ Switched from SQLite to PostgreSQL
- Updated
postgresql_models.pyto use PostgreSQL connection - Connection string:
postgresql://songlyric_user:MySecurePass123@192.168.10.130:5432/church_songlyric - Removed SQLite database references
- Granted proper permissions to
songlyric_user
2. ✅ Removed All MongoDB References
- Deleted
app_mongodb_backup.py - Deleted
check_mongo_data.py - Deleted
migrate_to_mongodb.py - Deleted
mongodb_models.py - Restored SQLite-based app.py (which works with PostgreSQL via SQLAlchemy)
3. ✅ Configured Port 5100
- Backend running on port 5100 (http://192.168.10.130:5100)
- Frontend running on port 3000 (http://192.168.10.130:3000)
- Updated default FLASK_PORT from 5000 to 5100
4. ✅ Configured DNS Support
- Added CORS support for
houseofprayer.ddns.netdomain - Supports both HTTP and HTTPS
- Supports multiple ports (3000, 5100)
- Full wildcard support for all origins
5. ✅ Installed Bootstrap
- Bootstrap 5.3.8 installed
- Bootstrap Icons 1.13.1 installed
- Mobile-responsive configuration
- Imported in
frontend/src/index.js
Current Running Services
Backend (Port 5100)
- Process: Python Flask app with PostgreSQL
- Local: http://localhost:5100
- Network: http://192.168.10.130:5100
- DNS: http://houseofprayer.ddns.net:5100
- Database: PostgreSQL (church_songlyric)
- Status: ✅ Running
Frontend (Port 3000)
- Process: React development server
- Local: http://localhost:3000
- Network: http://192.168.10.130:3000
- DNS: http://houseofprayer.ddns.net:3000
- Bootstrap: ✅ Configured for mobile
- Status: ✅ Running
Database Information
- Database: church_songlyric
- User: songlyric_user
- Password: MySecurePass123
- Host: 192.168.10.130
- Port: 5432
- Tables: songs, profiles, plans, plan_songs, profile_songs
API Endpoints
All endpoints available at http://192.168.10.130:5100/api/
GET /api/songs- List all songsPOST /api/songs- Create new songGET /api/songs/{id}- Get song by IDPUT /api/songs/{id}- Update songDELETE /api/songs/{id}- Delete songGET /api/profiles- List all profilesGET /api/plans- List all plans
Testing
# Test backend
curl http://localhost:5100/api/songs
# Test frontend
curl http://localhost:3000
# Test with network IP
curl http://192.168.10.130:5100/api/songs
# Test with DNS (if configured)
curl http://houseofprayer.ddns.net:5100/api/songs
Files Modified
backend/postgresql_models.py- Updated to use PostgreSQLbackend/app.py- Updated CORS and port configurationbackend/.env- Updated PostgreSQL passwordfrontend/src/setupProxy.js- Updated to proxy to port 5100frontend/src/index.js- Bootstrap imports added
Files Deleted
backend/app_mongodb_backup.pybackend/check_mongo_data.pybackend/migrate_to_mongodb.pybackend/mongodb_models.py
Next Steps
- Configure DNS forwarding on your router for ports 3000 and 5100
- Test external access via
http://houseofprayer.ddns.net:3000 - Consider setting up HTTPS with Let's Encrypt
- Set up PM2 for production deployment
- Configure Nginx reverse proxy (optional)
Troubleshooting
If backend won't start
cd /media/pts/Website/Church_HOP_MusicData/backend
source venv/bin/activate
python app.py
If database connection fails
# Test PostgreSQL connection
sudo -u postgres psql -d church_songlyric -c "SELECT 1"
# Reset user password
sudo -u postgres psql -d church_songlyric -c "ALTER USER songlyric_user WITH PASSWORD 'MySecurePass123';"
# Grant permissions
sudo -u postgres psql -d church_songlyric -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO songlyric_user;"
If frontend won't start
cd /media/pts/Website/Church_HOP_MusicData/frontend
npm start
Everything is ready for production use with PostgreSQL, mobile-optimized Bootstrap UI, and DNS support! 🎉