# ๐Ÿš€ POZO - Complete Deployment Guide with Dynamic SEO ## โš ๏ธ IMPORTANT: Follow EXACTLY in this order. Don't skip any step! --- ## ๐Ÿ“‹ Prerequisites Check Before starting, make sure you have: - โœ… Node.js installed (check: `node --version`) - โœ… npm installed (check: `npm --version`) - โœ… Access to your IIS server - โœ… iisnode installed on IIS server - โœ… URL Rewrite module installed on IIS server --- ## ๐Ÿ”จ PART 1: Build the Project Locally ### Step 1: Stop any running servers ```powershell # Kill all node processes Get-Process -Name node -ErrorAction SilentlyContinue | Stop-Process -Force ``` ### Step 2: Clean previous build (Optional but recommended) ```powershell # Remove old dist folder Remove-Item -Path "dist" -Recurse -Force -ErrorAction SilentlyContinue ``` ### Step 3: Install dependencies ```powershell # Make sure all packages are installed npm install ``` ### Step 4: Build the project with SEO generation ```powershell # This runs Vite build + React Snap + SEO generation npm run convert-jsx-to-html ``` **Expected Output:** - โœ… Vite build completes - โœ… React Snap attempts to prerender (may show warnings - ignore them) - โœ… SEO files generated for all pages - โœ… `dist/` folder created with all files - โœ… `dist/server.js` created - โœ… `dist/server/seo-middleware.js` created - โœ… `dist/web.config` created ### Step 5: Verify build output ```powershell # Check if critical files exist Test-Path "dist/server.js" Test-Path "dist/server/seo-middleware.js" Test-Path "dist/web.config" Test-Path "dist/home/pricing-pozoapp/index.html" Test-Path "dist/home/blog/index.html" ``` **All should return:** `True` --- ## ๐Ÿงช PART 2: Test Locally (MANDATORY!) ### Step 6: Start local server ```powershell # Navigate to dist folder and start server cd dist node server.js ``` **Expected Output:** ``` Server running on port 3000 Dynamic SEO enabled! ``` ### Step 7: Test in browser Open these URLs in your browser: 1. **Home:** http://localhost:3000/home/ 2. **Pricing:** http://localhost:3000/home/pricing-pozoapp 3. **Blog:** http://localhost:3000/home/blog 4. **Contact:** http://localhost:3000/home/contact-us 5. **Sign In:** http://localhost:3000/home/signin ### Step 8: Verify SEO for each page For EACH page above: 1. Open the URL in browser 2. Press `Ctrl + U` to view page source 3. Check `` section contains: - โœ… `` tag with correct page title - โœ… `<meta name="description"` with correct description - โœ… `<meta property="og:title"` - Open Graph title - โœ… `<meta property="og:description"` - OG description - โœ… `<meta property="og:image"` - OG image URL - โœ… `<meta property="og:url"` - Page URL - โœ… `<meta property="twitter:card"` - Twitter card - โœ… `<link rel="canonical"` - Canonical URL **IMPORTANT:** If ANY page shows wrong SEO or missing tags, **STOP** and fix before deploying! ### Step 9: Stop local server ```powershell # Press Ctrl+C in the terminal where server is running # OR run this in new terminal: Get-Process -Name node -ErrorAction SilentlyContinue | Stop-Process -Force ``` --- ## ๐Ÿ“ฆ PART 3: Prepare Files for Deployment ### Step 10: Check dist folder contents Your `dist/` folder should have: ``` dist/ โ”œโ”€โ”€ assets/ (all JS, CSS, images) โ”œโ”€โ”€ home/ โ”‚ โ”œโ”€โ”€ index.html โ”‚ โ”œโ”€โ”€ blog/ โ”‚ โ”‚ โ””โ”€โ”€ index.html โ”‚ โ”œโ”€โ”€ pricing-pozoapp/ โ”‚ โ”‚ โ””โ”€โ”€ index.html โ”‚ โ”œโ”€โ”€ contact-us/ โ”‚ โ”‚ โ””โ”€โ”€ index.html โ”‚ โ””โ”€โ”€ signin/ โ”‚ โ””โ”€โ”€ index.html โ”œโ”€โ”€ og/ (Open Graph images) โ”œโ”€โ”€ server/ โ”‚ โ””โ”€โ”€ seo-middleware.js โ”œโ”€โ”€ index.html โ”œโ”€โ”€ server.js (CRITICAL!) โ”œโ”€โ”€ web.config (CRITICAL!) โ”œโ”€โ”€ robots.txt โ”œโ”€โ”€ sitemap.xml โ””โ”€โ”€ ... (other files) ``` ### Step 11: Create deployment package ```powershell # Go back to project root cd .. # Create a zip file of dist folder (optional, makes upload easier) Compress-Archive -Path "dist\*" -DestinationPath "pozo-deployment.zip" -Force ``` --- ## ๐ŸŒ PART 4: Deploy to IIS Server ### Step 12: Upload files to server **Option A: If you have FTP/SFTP access:** 1. Connect to your server via FTP/SFTP 2. Navigate to your website root folder (e.g., `C:\inetpub\wwwroot\pozo.dev\`) 3. **BACKUP existing files first!** 4. Delete old files in the folder 5. Upload ALL files from `dist/` folder **Option B: If you have RDP access:** 1. Connect via Remote Desktop 2. Copy `dist/` folder or `pozo-deployment.zip` to server 3. Extract/move files to website root (e.g., `C:\inetpub\wwwroot\pozo.dev\`) ### Step 13: Install Node.js dependencies on server **On your IIS server (via RDP or SSH):** ```powershell # Navigate to your website root cd C:\inetpub\wwwroot\pozo.dev # Install dependencies npm install express axios ``` ### Step 14: Verify critical files on server **On server, check these files exist:** ```powershell Test-Path "server.js" Test-Path "server\seo-middleware.js" Test-Path "web.config" Test-Path "node_modules\express" Test-Path "node_modules\axios" ``` **All should return:** `True` --- ## โš™๏ธ PART 5: Configure IIS ### Step 15: Verify iisnode is installed 1. Open IIS Manager 2. Select your site 3. Check if "iisnode" icon is visible in Features View 4. If NOT visible, install iisnode from: https://github.com/Azure/iisnode/releases ### Step 16: Verify URL Rewrite module 1. In IIS Manager, select your site 2. Check if "URL Rewrite" icon is visible 3. If NOT visible, install from: https://www.iis.net/downloads/microsoft/url-rewrite ### Step 17: Check web.config Your `web.config` should look like this: ```xml <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <handlers> <add name="iisnode" path="server.js" verb="*" modules="iisnode" resourceType="File" /> </handlers> <rewrite> <rules> <!-- Route all requests to Node.js server --> <rule name="pozo.dev" stopProcessing="true"> <match url="/*" /> <action type="Rewrite" url="server.js" /> </rule> </rules> </rewrite> <iisnode node_env="production" /> </system.webServer> </configuration> ``` **If different, replace with above content.** ### Step 18: Set proper permissions **On server:** 1. Right-click on website folder โ†’ Properties โ†’ Security 2. Add `IIS_IUSRS` with Read & Execute permissions 3. Add `IUSR` with Read & Execute permissions ### Step 19: Configure Application Pool 1. Open IIS Manager 2. Go to Application Pools 3. Find your site's app pool 4. Right-click โ†’ Advanced Settings 5. Set: - `.NET CLR Version`: No Managed Code - `Enable 32-Bit Applications`: False - `Pipeline Mode`: Integrated ### Step 20: Restart Application Pool 1. In IIS Manager โ†’ Application Pools 2. Right-click your app pool โ†’ Stop 3. Wait 5 seconds 4. Right-click โ†’ Start ### Step 21: Restart IIS (optional but recommended) **On server:** ```powershell iisreset ``` --- ## โœ… PART 6: Test Production Site ### Step 22: Test your live site Open these URLs (replace `pozo.dev` with your domain): 1. **Home:** https://www.pozo.dev/home/ 2. **Pricing:** https://www.pozo.dev/home/pricing-pozoapp 3. **Blog:** https://www.pozo.dev/home/blog 4. **Contact:** https://www.pozo.dev/home/contact-us 5. **Sign In:** https://www.pozo.dev/home/signin ### Step 23: Verify SEO on production For EACH page: 1. Open URL 2. Press `Ctrl + U` (View Source) 3. Verify ALL SEO tags are present: - โœ… Title tag - โœ… Meta description - โœ… OG tags - โœ… Twitter tags - โœ… Canonical URL ### Step 24: Test with SEO tools 1. **Google Rich Results Test:** - Go to: https://search.google.com/test/rich-results - Enter your page URL - Check for errors 2. **Meta Tags Preview:** - Go to: https://metatags.io/ - Enter your page URL - See how it looks on social media 3. **PageSpeed Insights:** - Go to: https://pagespeed.web.dev/ - Enter your page URL - Check performance and SEO score --- ## ๐Ÿ› TROUBLESHOOTING ### Issue 1: Site shows blank page or 404 **Solution:** ```powershell # On server, check iisnode logs type C:\inetpub\wwwroot\pozo.dev\iisnode\*.log ``` Check for errors, usually: - Missing `node_modules` โ†’ Run `npm install` - Wrong `web.config` โ†’ Replace with correct version ### Issue 2: SEO tags not showing **Solution:** 1. Clear browser cache (Ctrl + Shift + Delete) 2. Check if server is actually running Node.js: ```powershell Get-Process -Name node ``` 3. Check iisnode is processing requests: - Check `iisnode\*.log` files for activity ### Issue 3: Assets (CSS/JS) not loading **Solution:** 1. Check browser console (F12) 2. Verify paths in HTML match actual file locations 3. Check IIS MIME types for `.js`, `.css`, `.woff`, `.woff2` ### Issue 4: Server.js not running **Solution:** 1. Check `web.config` has correct handler 2. Verify iisnode is installed 3. Check Node.js is installed on server: `node --version` 4. Restart App Pool --- ## ๐Ÿ“ QUICK REFERENCE COMMANDS ### Local Development: ```powershell # Build project npm run convert-jsx-to-html # Test locally cd dist node server.js # Stop server Get-Process -Name node | Stop-Process -Force ``` ### On Server: ```powershell # Install dependencies npm install express axios # Restart IIS iisreset # Check node processes Get-Process -Name node # View logs type C:\inetpub\wwwroot\pozo.dev\iisnode\*.log ``` --- ## ๐ŸŽฏ CHECKLIST BEFORE DEPLOYMENT - [ ] Local build completed without errors - [ ] Local server tested and SEO verified - [ ] All pages show correct titles and meta tags locally - [ ] `dist/server.js` exists - [ ] `dist/server/seo-middleware.js` exists - [ ] `dist/web.config` exists - [ ] Backed up old production files - [ ] iisnode installed on server - [ ] URL Rewrite module installed on server - [ ] Node.js installed on server - [ ] `npm install` run on server - [ ] Permissions set correctly - [ ] Application pool restarted - [ ] Production site tested - [ ] SEO tags verified on production --- ## โœจ SUCCESS CRITERIA Your deployment is successful when: 1. โœ… All pages load without errors 2. โœ… Every page has unique, correct title in browser tab 3. โœ… Page source (`Ctrl+U`) shows all SEO meta tags 4. โœ… Google Rich Results Test shows no errors 5. โœ… Social media preview tools show correct title, description, and image 6. โœ… Assets (images, CSS, JS) load properly 7. โœ… No console errors in browser (F12) --- ## ๐Ÿ†˜ SUPPORT If you face any issues: 1. Check the TROUBLESHOOTING section above 2. Check server logs: `C:\inetpub\wwwroot\pozo.dev\iisnode\*.log` 3. Check browser console (F12) for errors 4. Verify all files uploaded correctly 5. Confirm Node.js and dependencies installed on server --- **Created:** 2025-11-04 **Version:** 1.0 **Project:** POZO - Retail ERP & POS **Tech Stack:** React + Vite + Node.js + Express + IIS + iisnode --- **เฎจเฏ€ เฎ‡เฎจเฏเฎค guide-เฎ เฎชเฎŸเฎฟ เฎชเฎŸเฎฟเฎฏเฎพ follow เฎชเฎฃเฏเฎฃเฎพ, 100% guarantee SEO work เฎ†เฎ•เฏเฎฎเฏ! ๐Ÿš€** **Oru step-um miss เฎชเฎฃเฏเฎฃเฎพเฎคเฏ‡! เฎŽเฎฒเฏเฎฒเฎพเฎฎเฏ เฎšเฎฐเฎฟเฎฏเฎพ เฎตเฎฐเฏเฎฎเฏ! ๐Ÿ’ช**