- Added /admin redirect to login page in nginx config - Fixed backend server.js route ordering for proper admin handling - Updated authentication middleware and routes - Added user management routes - Configured PostgreSQL integration - Updated environment configuration
5.0 KiB
5.0 KiB
Sky Art Shop - Quick Deployment Checklist
🎯 Pre-Deployment Setup (One-Time)
1. Install Prerequisites
-
Download .NET 8.0 Hosting Bundle
- Visit: https://dotnet.microsoft.com/download/dotnet/8.0
- Look for "Hosting Bundle" under Windows
- Install and restart computer
-
Enable IIS (Run PowerShell as Administrator)
.\deploy.ps1 -InstallIIS- Restart computer after installation
-
Install MongoDB (if not already)
- Download from: https://www.mongodb.com/try/download/community
- Install as Windows Service
- Verify it's running:
net start MongoDB
2. Network Configuration
-
Set Static Local IP
- Control Panel → Network → Change adapter settings
- Right-click network → Properties → IPv4 → Properties
- Use static IP: e.g.,
192.168.1.100
-
Configure Router Port Forwarding
- Access router (usually http://192.168.1.1)
- Find Port Forwarding section
- Forward: External Port 80 → Internal IP 192.168.1.100:80
-
Install No-IP DUC Client
- Download: https://www.noip.com/download
- Install and login with No-IP credentials
- Verify it's updating your hostname
3. Security Setup
- Change Admin Password
- Edit:
appsettings.Production.json - Update the password field
- Use a strong password!
- Edit:
🚀 Deployment Steps (Every Time You Update)
Option A: Automated Deployment (Recommended)
Run PowerShell as Administrator:
cd "E:\Documents\Website Projects\Sky_Art_Shop"
# First time deployment (creates IIS site)
.\deploy.ps1 -CreateSite
# Future updates (faster, just updates files)
.\deploy.ps1 -UpdateOnly
Option B: Manual Deployment
Run PowerShell as Administrator:
# 1. Stop IIS site (if updating)
Stop-WebSite -Name "SkyArtShop"
# 2. Publish application
cd "E:\Documents\Website Projects\Sky_Art_Shop"
dotnet publish -c Release -o "C:\inetpub\wwwroot\skyartshop"
# 3. Set permissions
icacls "C:\inetpub\wwwroot\skyartshop" /grant "IIS_IUSRS:(OI)(CI)F" /T
icacls "C:\inetpub\wwwroot\skyartshop\wwwroot\uploads" /grant "IIS_IUSRS:(OI)(CI)F" /T
# 4. Start IIS site
Start-WebSite -Name "SkyArtShop"
✅ Testing
Test 1: Local (on server)
- Open browser on server machine
- Visit: http://localhost
- ✅ Site loads correctly
Test 2: Local Network
- On another device (phone/laptop on same WiFi)
- Visit: http://192.168.1.100 (your server's local IP)
- ✅ Site loads correctly
Test 3: Internet
- On mobile data or different network
- Visit: http://your-hostname.ddns.net (your No-IP hostname)
- ✅ Site loads from internet
🔍 Troubleshooting
Site Not Loading Locally
# Check IIS site status
Get-WebSite -Name "SkyArtShop"
# Check if port 80 is listening
netstat -ano | findstr :80
# Restart IIS
iisreset /restart
Site Not Loading from Internet
- Verify No-IP DUC is running (check system tray)
- Check router port forwarding is configured
- Test your public IP: https://www.whatismyip.com
- Visit: http://YOUR_PUBLIC_IP (should show your site)
MongoDB Connection Error
# Check MongoDB status
net start MongoDB
# If not running, start it
net start MongoDB
Permission Errors (403/500)
# Re-apply permissions
icacls "C:\inetpub\wwwroot\skyartshop" /grant "IIS_IUSRS:(OI)(CI)F" /T
icacls "C:\inetpub\wwwroot\skyartshop" /grant "IUSR:(OI)(CI)F" /T
# Restart IIS
iisreset /restart
📊 Quick Commands
# Check site status
Get-WebSite -Name "SkyArtShop" | Select Name, State
# Start site
Start-WebSite -Name "SkyArtShop"
# Stop site
Stop-WebSite -Name "SkyArtShop"
# Restart IIS
iisreset /restart
# Check MongoDB
net start MongoDB
# View firewall rules
Get-NetFirewallRule -DisplayName "*SkyArtShop*"
# Check what's using port 80
netstat -ano | findstr :80
🎯 Your Site URLs
After deployment, your site will be accessible at:
- Local Machine: http://localhost
- Local Network: http://192.168.1.100 (or your static IP)
- Internet: http://your-hostname.ddns.net (your No-IP hostname)
📝 Notes
- Development: Continue using
dotnet runon port 5001 for local development - Production: Clients access via your No-IP hostname
- Updates: Run
.\deploy.ps1 -UpdateOnlyto push changes - Backups: Consider backing up
identity.dband MongoDB before major updates
🎉 Success Criteria
✅ Site loads on localhost
✅ Site loads on local network
✅ Site loads from internet via No-IP hostname
✅ Admin login works
✅ Images upload correctly
✅ MongoDB data persists
✅ No error messages in browser console
Ready to deploy? Start with the Pre-Deployment Setup, then run the automated deployment script!