# Website Consolidation Complete - December 14, 2025 ## 🎯 Understanding Your Setup ### The "Two Websites" Situation EXPLAINED **YOU DON'T ACTUALLY HAVE TWO SEPARATE WEBSITES!** You have **ONE website** that can be accessed through **TWO DIFFERENT URLs**: 1. **`http://localhost`** - Local machine access 2. **`https://skyarts.ddns.net`** - Public domain access Both URLs point to the **EXACT SAME FILES** in `/var/www/skyartshop/` Think of it like your house having a front door and a back door - same house, just different ways to enter! ## 🏗️ Your Architecture ``` ┌─────────────────────────────────────────────┐ │ Internet / Local Network │ └─────────────────┬───────────────────────────┘ │ ┌─────────┴──────────┐ │ │ localhost skyarts.ddns.net │ │ └─────────┬──────────┘ │ ┌─────▼─────┐ │ NGINX │ (Port 80/443) │ Reverse │ │ Proxy │ └─────┬─────┘ │ ┌─────────┴──────────┐ │ │ Static Files Backend API (HTML/CSS/JS) (Node.js:5000) │ │ ▼ ▼ /var/www/skyartshop/ Express Server ├── public/ ├── /api/admin/* ├── admin/ ├── /api/products ├── assets/ └── /api/blog/... └── uploads/ ``` ## 📂 Single Website Structure **Location:** `/var/www/skyartshop/` ``` skyartshop/ ├── public/ ← Frontend (Customer-facing) │ ├── index.html → Redirects to home.html │ ├── home.html → Homepage │ ├── shop.html → Product catalog │ ├── product.html → Product details │ ├── portfolio.html → Portfolio showcase │ ├── blog.html → Blog listing │ ├── about.html → About page │ └── contact.html → Contact form │ ├── admin/ ← Backend Admin Panel │ ├── login.html → Admin login │ ├── dashboard.html → Admin dashboard │ ├── products.html → Manage products │ ├── blog.html → Manage blog posts │ ├── portfolio.html → Manage portfolio │ ├── pages.html → Manage custom pages │ ├── menu.html → Manage navigation │ ├── settings.html → Site settings │ └── users.html → User management │ ├── assets/ ← Static resources │ ├── css/ │ ├── js/ │ └── images/ │ └── uploads/ ← User-uploaded content ├── products/ ├── portfolio/ └── blog/ ``` ## 🌐 How to Access Your Website ### For YOU (Admin) **Admin Panel:** - - **Public Frontend:** - - ### For CUSTOMERS (Public) **They will use:** - **They can browse:** - Home: - Shop: - Portfolio: - Blog: - Contact: ## ✅ What Was Just Deployed I deployed all the files from your development folder to production: ```bash ✓ Public frontend pages ✓ Admin panel (with fixed navigation) ✓ Assets (CSS, JS, images) ✓ Proper directory structure ✓ Correct permissions ``` ## 🔄 Workflow: Making Changes ### 1. Edit Files (Development) ```bash cd /media/pts/Website/SkyArtShop/website/ # Edit files here: nano public/home.html nano admin/dashboard.html ``` ### 2. Deploy to Production ```bash sudo /media/pts/Website/SkyArtShop/deploy-website.sh ``` ### 3. Test ```bash # Clear browser cache! # Then visit: https://skyarts.ddns.net ``` ## 🎨 Frontend vs Backend ### Frontend (Public Website) - **Location:** `/var/www/skyartshop/public/` - **Technology:** HTML, CSS, JavaScript - **Access:** - **Purpose:** What customers see ### Backend (Admin Panel) - **Location:** `/var/www/skyartshop/admin/` - **Technology:** HTML, CSS, JavaScript + Node.js API - **Access:** - **Purpose:** Where you manage content ### Backend API (Data Management) - **Location:** `/media/pts/Website/SkyArtShop/backend/server.js` - **Technology:** Node.js + Express + PostgreSQL - **Port:** 5000 - **Purpose:** Handles data operations ## 🔧 Server Components ### 1. NGINX (Web Server) - **Ports:** 80 (HTTP), 443 (HTTPS) - **Purpose:** Serves HTML/CSS/JS files, routes API requests - **Status:** `sudo systemctl status nginx` - **Reload:** `sudo systemctl reload nginx` ### 2. Node.js Backend (API Server) - **Port:** 5000 - **Purpose:** Admin API, data management - **Status:** `pm2 status` - **Restart:** `pm2 restart skyartshop` - **Logs:** `pm2 logs skyartshop` ### 3. PostgreSQL (Database) - **Port:** 5432 - **Purpose:** Store products, blog posts, users, etc. - **Status:** `sudo systemctl status postgresql` ## 📍 Important URLs ### Public Access (Customers) ``` https://skyarts.ddns.net → Home https://skyarts.ddns.net/shop.html → Shop https://skyarts.ddns.net/portfolio.html → Portfolio https://skyarts.ddns.net/blog.html → Blog ``` ### Admin Access (You) ``` https://skyarts.ddns.net/admin/login.html → Login https://skyarts.ddns.net/admin/dashboard.html → Dashboard ``` ### API Endpoints (Backend) ``` http://localhost:5000/api/products → Product data http://localhost:5000/api/blog/posts → Blog posts http://localhost:5000/api/admin/session → Auth check ``` ## 🚨 Important Notes ### There Is Only ONE Website - `localhost` and `skyarts.ddns.net` show the SAME content - They're just different ways to access it - Changes to one affect both (because it's the same files!) ### Deployment is Required - Editing files in `/media/pts/Website/SkyArtShop/website/` does NOT automatically update the live site - You MUST run the deployment script to apply changes - Always clear browser cache after deploying ### Cache Clearing is Critical When you make changes: 1. Deploy: `sudo /media/pts/Website/SkyArtShop/deploy-website.sh` 2. Clear browser cache: Ctrl+Shift+Delete 3. Or use incognito mode: Ctrl+Shift+N ## 🎯 Quick Commands ### Deploy Website ```bash sudo /media/pts/Website/SkyArtShop/deploy-website.sh ``` ### Deploy Admin Panel Only ```bash sudo /media/pts/Website/SkyArtShop/deploy-admin-updates.sh ``` ### Restart Backend API ```bash pm2 restart skyartshop ``` ### Check Backend Logs ```bash pm2 logs skyartshop ``` ### Reload Nginx ```bash sudo nginx -t && sudo systemctl reload nginx ``` ### Check What's Running ```bash pm2 status # Backend API sudo systemctl status nginx # Web server sudo systemctl status postgresql # Database ``` ## 💡 Next Steps 1. **Clear your browser cache** (critical!) 2. **Visit:** 3. **Test navigation** - click around the frontend 4. **Login to admin** - 5. **Create content** - add a product, blog post, etc. 6. **Verify frontend** - check if content appears on public pages ## 🎨 Customizing the Layout Want to change the design? ### Edit Frontend ```bash cd /media/pts/Website/SkyArtShop/website/public/ nano home.html # Edit homepage nano shop.html # Edit shop page ``` ### Deploy Changes ```bash sudo /media/pts/Website/SkyArtShop/deploy-website.sh ``` ### Test ```bash # Visit https://skyarts.ddns.net # Clear cache if needed ``` --- **Status:** ✅ Website Consolidated & Deployed **One Website, Two URLs:** localhost & skyarts.ddns.net **All Files in:** `/var/www/skyartshop/` **Last Updated:** December 14, 2025, 00:35 UTC