
- Implement dual theme system with separate Tailwind configs for light/dark modes - Add dynamic stylesheet switching based on system preference - Fix light mode text visibility by using darker colors on light backgrounds - Resolve sermon page bug where all content loaded on initial render - Add build scripts for theme compilation - Update recurring event type formatting consistency
3 KiB
3 KiB
Deployment Instructions
Files to Copy to Server
New/Modified Files:
src/pages/admin/index.astro # Main admin dashboard page
src/components/admin/Login.astro # Admin login component
src/pages/bulletin/[id].astro # Fixed bulletin detail page (SSR)
public/admin/scripts/main.js # Admin JavaScript (if not already there)
Verify these files exist on server:
public/admin/scripts/main.js # Admin functionality
Deployment Steps
-
Copy files to server:
# Copy new admin components scp -r src/pages/admin/ user@server:/opt/rtsda/src/pages/ scp -r src/components/admin/ user@server:/opt/rtsda/src/components/ # Copy fixed bulletin page scp src/pages/bulletin/[id].astro user@server:/opt/rtsda/src/pages/bulletin/ # Verify admin scripts exist scp public/admin/scripts/main.js user@server:/opt/rtsda/public/admin/scripts/
-
SSH into server:
ssh user@server cd /opt/rtsda
-
Build and restart:
npm run build pm2 restart astro-app
Testing After Deployment
-
Test bulletin fix:
- Visit:
https://yourdomain.com/bulletin/5bebfe94-71ca-4a72-b9a8-ecd1195c8182
- Should show bulletin content, not "bulletin not found"
- Visit:
-
Test admin dashboard:
- Visit:
https://yourdomain.com/admin/
- Should show login screen
- Login with admin credentials
- Verify all sections work: Events, Bulletins, Schedules
- Visit:
Potential Issues & Solutions
Build Errors:
# If node version issues:
node --version # Should be 20.x
npm --version
# If dependency issues:
rm -rf node_modules package-lock.json
npm install
npm run build
Permission Issues:
# Fix ownership
sudo chown -R $USER:$USER /opt/rtsda
chmod -R 755 /opt/rtsda
# Fix specific file permissions
chmod 644 src/pages/admin/index.astro
chmod 644 src/components/admin/Login.astro
chmod 644 src/pages/bulletin/[id].astro
Admin Route Not Working:
- Check if
/admin/
route is accessible - Verify admin files were copied correctly
- Check PM2 logs:
pm2 logs astro-app
Styles Not Loading:
- Hard refresh browser (Ctrl+F5)
- Check if build completed successfully
- Verify no CSS compilation errors in build output
Rollback Plan
If something breaks:
# Quick rollback
git status
git checkout -- src/pages/bulletin/[id].astro
rm -rf src/pages/admin/
rm -rf src/components/admin/
npm run build
pm2 restart astro-app
Success Indicators
✅ Build completes without errors
✅ Bulletin pages show content instead of "not found"
✅ /admin/
shows login screen
✅ Admin dashboard fully functional after login
✅ Site loads normally for regular visitors
Notes
- Admin dashboard is completely hidden from public navigation
- Only accessible via direct URL:
/admin/
- Requires valid JWT authentication
- All original functionality preserved
- Styling matches main site theme
"It should be simple, but it probably won't be." - Murphy's Law of Deployment