Tamamlanma Tarihi: 30 Kasım 2025
Proje: MDDS (Multi-Domain Deterrence Strategy)
Deployment Türü: Plesk Windows Server + IIS + Node.js
- Dosya:
web.config(proje root'unda) - Özellikler:
- iisnode modülü entegrasyonu
dist/index.jsentry point'i- Statik dosya serving (
dist/public/) - API trafiği yönlendirmesi
- Logging ve error handling
- Compression (Gzip) aktif
- Security headers
- Dosya:
dist/public/web.config - Özellikler:
- SPA routing (React Router 404 hatalarını önler)
- Gerçek dosyalar serve edilir
- 404'ler
index.html'e yönlendirilir - MIME type tanımları
- Cache policy
- Compression
- Added Scripts:
{ "plesk-build": "npm install && npm run build", "plesk-build-prod": "npm ci --production && npm run build", "plesk-start": "cross-env NODE_ENV=production node dist/index.js", "plesk-deploy": "npm install && npm run build && cross-env NODE_ENV=production node dist/index.js" }
Comprehensive kurulum rehberi içeren:
- Ön koşullar ve kurulum adımları
- Plesk panel ayarları
- Environment variables
- Git integration
- Deployment process
- Troubleshooting guide
- Security best practices
- Deployment checklist
Windows command reference:
- Hızlı başlangıç komutları
- NPM commands
- IIS commands
- Node.js process management
- Monitoring & logging
- Troubleshooting komutları
- Quick reference table
- Emergency procedures
Subdomain konfigürasyonu (daha önceki görevden):
- Frontend/Backend farklı domainlerde çalışması
- CORS ayarları
- Environment variable setup
Windows batch script:
- 3 deployment scenario (Full, Quick, Production)
- 6 troubleshooting seçeneği
- Process monitoring
- Detaylı logging
- Renk-coded output
PowerShell script:
- Aynı 3 deployment scenario
- Daha robust error handling
- Function-based architecture
- Detailed logging
- 8 farklı scenario seçeneği
MDDS/
├── src/
│ ├── server/ # TypeScript backend
│ ├── client/ # React TypeScript frontend
│ └── shared/ # Shared types
│
├── dist/ # Build çıktıları
│ ├── index.js # Backend compiled (başlangıç dosyası)
│ ├── public/ # Frontend static files
│ │ ├── index.html # React SPA entry
│ │ ├── assets/ # CSS, JS, resimler
│ │ └── web.config # ✨ Frontend IIS config
│ └── ...
│
├── web.config # ✨ Backend IIS config
├── plesk-deploy.bat # ✨ Interactive deployment (CMD)
├── plesk-deploy.ps1 # ✨ Advanced deployment (PowerShell)
├── PLESK_DEPLOYMENT.md # ✨ Full documentation
├── PLESK_COMMANDS_REFERENCE.txt # ✨ Commands quick reference
├── SUBDOMAIN_SETUP.md # ✨ Subdomain configuration
├── package.json # ✨ Updated with deployment scripts
├── vite.config.ts # Frontend build config
├── tsconfig.json # TypeScript config
└── README.md # ✨ Updated with subdomain setup
- Plesk Dashboard → Domains → Domainini seç
- Node.js sekmesinde:
- Node.js version: 18.x veya 20.x
- App startup file:
dist/index.js - Environment variables ayarla
- Plesk → Git → Repository bağla
- Branch:
main
Seçenek A: Otomatik (Git Push'ta)
Plesk Panel → Additional Deployment Actions:
powershell -NoProfile -ExecutionPolicy Bypass -File "plesk-deploy.ps1" -Scenario "full"
Seçenek B: Manual (Plesk Terminal'den)
cd D:\httpdocs\yourdomain.com\httpdocs
npm run plesk-deploySeçenek C: Interactive Menu
plesk-deploy.batNODE_ENV=production
FRONTEND_URL=https://yourdomain.com
PORT=3000
DATABASE_URL=postgresql://...
SESSION_SECRET=your_secret_key
VITE_API_URL=https://api.yourdomain.com
FRONTEND_URL=https://yourdomain.com
- Node.js 18+ kurulu
- iisnode module kurulu
- IIS URL Rewrite module kurulu
- web.config dosyaları proje içinde
- HTTPS SSL sertifikası
| Dosya | Tip | Amaç |
|---|---|---|
web.config |
XML | Backend IIS configuration |
dist/public/web.config |
XML | Frontend React routing |
plesk-deploy.bat |
Batch | Interactive deployment menu |
plesk-deploy.ps1 |
PowerShell | Advanced deployment automation |
PLESK_DEPLOYMENT.md |
Markdown | Detailed setup guide (Türkçe) |
PLESK_COMMANDS_REFERENCE.txt |
Text | Quick command reference |
SUBDOMAIN_SETUP.md |
Markdown | Subdomain configuration |
package.json |
JSON | Updated with deployment scripts |
Plesk → Domains → yourdomain.com → Node.js → Enable
NODE_ENV = production
FRONTEND_URL = https://yourdomain.com
PORT = 3000
D:\httpdocs\yourdomain.com\httpdocs\plesk-deploy.bat
# Seçim: 1 (Full Deployment)type deployment.log
explorer %SystemDrive%\iisnodehttps://yourdomain.com
https://yourdomain.com/api/sessions
taskkill /F /IM node.exe
iisreset /restartcd D:\httpdocs\yourdomain.com\httpdocs
npm install
npm run builddist/public/web.configvarlığını kontrol et- Build işlemini tekrarla:
npm run build
- Plesk'te
FRONTEND_URLayarla - IIS restart et:
iisreset /restart
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserGet-Process node | Format-Table -AutoSize -Refresh%windir%\system32\inetsrv\appcmd list siteDeployment: D:\httpdocs\yourdomain.com\httpdocs\deployment.log
iisnode: %SystemDrive%\iisnode\
IIS: C:\inetpub\logs\LogFiles\
- Environment Variables: Plesk Panel'de ayarla, dosya sisteminde değil
- Security Headers:
web.configdosyalarında otomatik - HTTPS: Domain için SSL sertifikası gerekli
- Firewall: Port 3000 sadece localhost'ta dinle (iisnode reverse proxy olarak)
TypeScript → Vite → dist/public/ (Frontend)
TypeScript → esbuild → dist/index.js (Backend)
Client (dist/public/index.html)
↓ fetch (CORS enabled)
iisnode (dist/index.js)
↓ Express routes
Database
- Frontend: IIS (Port 80/443)
- Backend: Node.js via iisnode (Port 3000 internal)
- Database: Environment variable ile
After deployment, verify:
-
Backend Running:
tasklist | findstr node
-
IIS Active:
iisreset /status -
Web Access:
- Frontend: https://yourdomain.com/
- API: https://yourdomain.com/api/sessions
-
Logs Clean:
type deployment.log
PLESK_DEPLOYMENT.md- Detaylı Plesk kurulum rehberiPLESK_COMMANDS_REFERENCE.txt- Windows komutları referansıSUBDOMAIN_SETUP.md- Subdomain ve CORS konfigürasyonuREADME.md- Proje genel dökümentasyonu
- Build locally:
npm run dev - Production test:
cross-env NODE_ENV=production npm run build - Check logs:
cat deployment.log
- Monitor:
Get-Process node - Restart:
iisreset /restart - Troubleshoot:
plesk-deploy.ps1 -Scenario troubleshoot-npm
- IIS Management:
inetmgr.exe - PowerShell Execution:
Set-ExecutionPolicy - Event Viewer:
eventvwr.exe
- ✅ Backend web.config oluşturuldu
- ✅ Frontend web.config oluşturuldu
- ✅ Package.json deployment scripts eklendi
- ✅ PLESK_DEPLOYMENT.md yazıldı
- ✅ PLESK_COMMANDS_REFERENCE.txt yazıldı
- ✅ plesk-deploy.bat oluşturuldu
- ✅ plesk-deploy.ps1 oluşturuldu
- ✅ SUBDOMAIN_SETUP.md güncellendi
- ✅ .env.example güncellendi
Status: ✅ DEPLOYMENT READY
Last Updated: 2025-11-30
Version: 1.0.0
Sorularınız için PLESK_DEPLOYMENT.md veya PLESK_COMMANDS_REFERENCE.txt dosyalarını kontrol edin.