✅ 53 pages (34 products + corporate) ✅ All logo images ✅ Nginx Dockerfile (production-ready) ✅ PDPA compliant (cookie consent) ✅ Modern design with Kanit font ✅ Line + Phone buttons on products Built: 2026-03-13
5.3 KiB
Deployment Guide - Deal Plus Tech Astro Website
📋 Pre-Deployment Checklist
- All pages build successfully (
npm run build) - Images copied to
public/images/ - Environment variables configured
- Umami Analytics set up
- Admin password changed from default
- Cookie consent tested
- Mobile responsiveness verified
- SEO meta tags on all pages
🚀 Deployment Steps
Step 1: Initialize Git Repository
cd dealplustech-astro
git init
git add .
git commit -m "Initial commit - Deal Plus Tech migration to Astro"
Step 2: Push to Gitea
# Add remote (replace with your actual Gitea URL)
git remote add origin https://git.moreminimore.com/{username}/dealplustech-astro.git
# Push to main
git push -u origin main
Step 3: Deploy on Easypanel
-
Login to Easypanel: https://panelwebsite.moreminimore.com
-
Create New Project:
- Project Name:
dealplustech - Click "Create Project"
- Project Name:
-
Create New Service:
- Service Name:
dealplustech-astro - Select "Git Repository"
- Repository:
dealplustech-astro - Branch:
main
- Service Name:
-
Configure Build:
- Build Command:
npm run build - Output Directory:
dist - Port:
80 - Node Version:
20
- Build Command:
-
Environment Variables:
UMAMI_WEBSITE_ID=xxx-xxx-xxx ADMIN_PASSWORD=YourSecurePassword123! NODE_ENV=production -
Deploy:
- Click "Deploy"
- Wait for build to complete (~2-3 minutes)
- Check deployment status
Step 4: Verify Deployment
-
Check Website:
- Visit your Easypanel URL
- Test homepage
- Test product pages (Thai URLs)
- Test contact page
-
Test Cookie Consent:
- Clear browser cookies
- Reload page
- Verify consent banner appears
- Test accept/reject buttons
-
Test Analytics:
- Accept analytics cookies
- Check Umami dashboard for visits
-
Mobile Testing:
- Test on mobile device
- Verify responsive design
- Check navigation menu
🔄 Auto-Deploy Workflow
Easypanel auto-deploys on every push to main branch:
# Make changes
git add .
git commit -m "Update product page"
git push
# Easypanel automatically:
# 1. Detects push
# 2. Runs npm install
# 3. Runs npm run build
# 4. Deploys new version
# 5. Shows deployment status
📊 Monitoring
Deployment Status
Check Easypanel dashboard for:
- Build logs
- Deployment status
- Resource usage
- Error logs
Analytics
Check Umami dashboard at: https://analytics.dealplustech.co.th
- Real-time visitors
- Page views
- Referrer sources
- Device breakdown
Consent Logs
Access consent logs: https://dealplustech.co.th/admin/consent-logs
- Login with
ADMIN_PASSWORD - View all consent records
- Export to CSV
- Delete records (right to be forgotten)
🛠️ Maintenance
Update Content
-
Edit Markdown/Files:
- Blog posts:
src/content/blog/ - Product pages:
src/pages/[url]/index.astro
- Blog posts:
-
Commit and Push:
git add . git commit -m "Update content" git push -
Auto-deploy: Wait ~2-3 minutes
Update Dependencies
npm update
npm run build # Test locally first
git add package.json
git commit -m "Update dependencies"
git push
Database Backup
Consent logs stored in SQLite (or Turso if configured):
# Local backup
cp db/consent.db backup-$(date +%Y%m%d).db
# Production (via Easypanel console)
# Download consent.db file
🐛 Troubleshooting
Build Fails
- Check logs in Easypanel
- Test locally:
npm run build - Common issues:
- Missing dependencies:
npm install - Syntax errors: Check recent changes
- TypeScript errors:
npm run check
- Missing dependencies:
Page Not Found
- Verify URL structure matches file path
- Check Thai URL encoding
- Clear cache: Hard refresh (Ctrl+Shift+R)
Cookie Consent Not Working
- Check localStorage: Open DevTools → Application → Local Storage
- Verify script loading: Check Network tab for errors
- Test in incognito: Clear all cookies first
Analytics Not Tracking
- Check Umami Website ID in
.env - Verify consent given for analytics
- Check browser console for errors
📈 Performance Optimization
Image Optimization (Recommended)
Convert images to WebP:
# Install sharp
npm install -g sharp-cli
# Convert all images
sharp public/images/**/*.jpg -o public/images/ -f webp -q 80
Enable Compression
Easypanel handles compression automatically.
CDN (Optional)
For better performance:
- Set up Cloudflare CDN
- Point DNS to Cloudflare
- Enable caching
- Configure page rules
🔐 Security
Environment Variables
- NEVER commit
.envfile - Use strong passwords
- Rotate passwords periodically
HTTPS
Easypanel provides HTTPS automatically.
Rate Limiting
Consider adding rate limiting for API endpoints:
// src/pages/api/consent/POST.ts
import rateLimit from 'express-rate-limit';
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // limit each IP to 100 requests per windowMs
});
📞 Support
Issues?
- Check Easypanel logs
- Review Astro docs: https://docs.astro.build
- Check this guide
Emergency Contact:
- Admin: [Your contact]
- Developer: [Your contact]
Last Updated: 2026-03-12
Version: 1.0