diff --git a/WORKFLOW.md b/WORKFLOW.md new file mode 100644 index 0000000..2cd49f6 --- /dev/null +++ b/WORKFLOW.md @@ -0,0 +1,121 @@ +# Website File Management Workflow + +## π Directory Structure + +``` +/media/pts/Website/SkyArtShop/ β Your git repository (EDIT HERE) +βββ website/ +β βββ public/ β Public website files (shop.html, home.html, etc.) +β βββ admin/ β Admin panel files +β βββ assets/ β CSS, JS, images +βββ backend/ β Node.js backend server +βββ deploy-website.sh β Deployment script +βββ local-commit.sh β Git commit helper + +/var/www/skyartshop/ β Live website (DEPLOYED TO) +βββ public/ +βββ admin/ +βββ assets/ +``` + +## β How to Edit Website Files + +### 1. Edit files in the git repository: +```bash +cd /media/pts/Website/SkyArtShop/website/ +``` + +Open any file: +- `website/public/shop.html` +- `website/public/home.html` +- `website/admin/dashboard.html` +- `website/assets/css/main.css` +- etc. + +### 2. Deploy your changes: +```bash +cd /media/pts/Website/SkyArtShop +./deploy-website.sh +``` + +This will copy your files to `/var/www/skyartshop/` and make them live! + +### 3. Commit your changes to git: +```bash +./local-commit.sh +# Or manually: +git add . +git commit -m "Updated shop page" +``` + +## π Quick Workflow Example + +```bash +# 1. Navigate to repository +cd /media/pts/Website/SkyArtShop + +# 2. Edit a file (use VS Code or any editor) +code website/public/shop.html + +# 3. Deploy the changes +./deploy-website.sh + +# 4. Test in browser +# Visit: https://skyarts.ddns.net + +# 5. If it looks good, commit +./local-commit.sh +``` + +## π Important Rules + +β **DO:** +- Edit files in `/media/pts/Website/SkyArtShop/website/` +- Run `./deploy-website.sh` after making changes +- Commit your work regularly with `./local-commit.sh` + +β **DON'T:** +- Edit files directly in `/var/www/skyartshop/` (they'll be overwritten on next deploy) +- Forget to deploy after editing +- Forget to commit your changes + +## π Deployment Script Details + +**What it does:** +1. Copies files from `website/` β `/var/www/skyartshop/` +2. Sets proper permissions +3. Keeps your changes safe in git + +**When to run it:** +- After editing any HTML, CSS, or JS files +- When you want to see your changes live +- Before committing (to ensure everything works) + +## π‘ Tips + +- **Always work in**: `/media/pts/Website/SkyArtShop/website/` +- **VS Code workspace**: Open `/media/pts/Website/SkyArtShop/` as your workspace +- **Test locally**: Make changes β Deploy β Test β Commit +- **Version control**: All changes are tracked in git (locally only, no GitHub sync) + +## π If You Get File Save Errors in VS Code + +If VS Code shows "Unable to save" or asks to overwrite: + +1. **Close the file** without saving +2. **Open the file from the correct location**: `/media/pts/Website/SkyArtShop/website/public/shop.html` +3. Make your edits +4. Save normally +5. Run `./deploy-website.sh` to push to live site + +## π Current Setup + +- **Git Repository**: `/media/pts/Website/SkyArtShop/` (branch: pts/updateweb) +- **Live Website**: `/var/www/skyartshop/` +- **Backend Server**: Running on port 5000 (managed by PM2) +- **Website URL**: https://skyarts.ddns.net +- **Admin URL**: https://skyarts.ddns.net/admin + +--- + +**Remember:** Edit in git repo β Deploy β Test β Commit diff --git a/deploy-website.sh b/deploy-website.sh new file mode 100755 index 0000000..bd31605 --- /dev/null +++ b/deploy-website.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# Website Deployment Script +# Syncs files from git repository to /var/www/skyartshop/ + +set -e # Exit on error + +REPO_DIR="/media/pts/Website/SkyArtShop" +DEPLOY_DIR="/var/www/skyartshop" + +echo "=========================================" +echo " SkyArtShop Website Deployment" +echo "=========================================" +echo "" +echo "π Repository: $REPO_DIR" +echo "π Deploy to: $DEPLOY_DIR" +echo "" + +# Check if we're in the repo directory +if [ ! -d "$REPO_DIR/.git" ]; then + echo "β Error: Not in git repository" + exit 1 +fi + +cd "$REPO_DIR" + +# Show current branch +CURRENT_BRANCH=$(git branch --show-current) +echo "π Current branch: $CURRENT_BRANCH" +echo "" + +# Copy/sync website files +echo "π¦ Deploying website files..." + +# Create website directory structure in repo if it doesn't exist +mkdir -p website/public +mkdir -p website/admin +mkdir -p website/assets +mkdir -p website/uploads + +# Copy current live files to repo for version control (first time setup) +if [ ! -f "website/public/shop.html" ]; then + echo "π₯ First time setup - copying live files to repository..." + cp -r $DEPLOY_DIR/public/* website/public/ 2>/dev/null || true + cp -r $DEPLOY_DIR/admin/* website/admin/ 2>/dev/null || true + cp -r $DEPLOY_DIR/assets/* website/assets/ 2>/dev/null || true + echo "β Files copied to repository" + echo "" + echo "β οΈ Please commit these files to git:" + echo " git add website/" + echo " git commit -m 'Add website files to repository'" + echo "" +fi + +# Deploy from repository to live site +echo "π Deploying to live site..." + +# Sync public files +rsync -av --delete website/public/ $DEPLOY_DIR/public/ 2>/dev/null || cp -r website/public/* $DEPLOY_DIR/public/ + +# Sync admin files +rsync -av --delete website/admin/ $DEPLOY_DIR/admin/ 2>/dev/null || cp -r website/admin/* $DEPLOY_DIR/admin/ + +# Sync assets (but don't delete to preserve any user uploads) +rsync -av website/assets/ $DEPLOY_DIR/assets/ 2>/dev/null || cp -r website/assets/* $DEPLOY_DIR/assets/ + +# Fix permissions +chown -R pts:pts $DEPLOY_DIR/public $DEPLOY_DIR/admin $DEPLOY_DIR/assets 2>/dev/null || true +chmod -R 644 $DEPLOY_DIR/public/*.html $DEPLOY_DIR/admin/*.html 2>/dev/null || true + +echo "" +echo "=========================================" +echo "β Deployment Complete!" +echo "=========================================" +echo "" +echo "π Website: https://skyarts.ddns.net" +echo "π Admin: https://skyarts.ddns.net/admin" +echo "" +echo "π Next steps:" +echo " 1. Edit files in: $REPO_DIR/website/" +echo " 2. Run this script to deploy" +echo " 3. Commit changes: git add . && git commit -m 'Update website'" +echo "" diff --git a/website/admin/dashboard.html b/website/admin/dashboard.html new file mode 100644 index 0000000..bc6b7b0 --- /dev/null +++ b/website/admin/dashboard.html @@ -0,0 +1,334 @@ + + +
+ + +Admin Panel Login
+Admin Panel Login
+| Username | +Role | +Status | +Last Login | +Password | +Actions | +|
|---|---|---|---|---|---|---|
| + Loading users... + | +||||||
Your cart is empty
'; + if (cartSubtotal) cartSubtotal.textContent = "$0.00"; + return; + } + + const subtotal = this.cart.reduce( + (sum, item) => sum + item.price * item.quantity, + 0 + ); + + cartContent.innerHTML = this.cart + .map( + (item) => ` +$${item.price.toFixed(2)}
+$${(item.price * item.quantity).toFixed( + 2 + )}
+Your wishlist is empty
'; + return; + } + + wishlistContent.innerHTML = this.wishlist + .map( + (item) => ` +$${item.price.toFixed(2)}
+ +Your creative journey starts here
+Sky Art Shop specializes in scrapbooking, journaling, cardmaking, and collaging stationery. We are passionate about helping people express their creativity and preserve their memories.
+Our mission is to promote mental health and wellness through creative art activities. We believe that crafting is more than just a hobbyβit's a therapeutic journey that brings joy, mindfulness, and self-expression.
+ +Our carefully curated collection includes:
+We hand-select every item in our store to ensure the highest quality and uniqueness. Whether you're a seasoned crafter or just starting your creative journey, we have something special for everyone.
+Join our community of creative minds and let your imagination soar!
+Your creative journey starts here
+Sky Art Shop specializes in scrapbooking, journaling, cardmaking, and collaging stationery. We are passionate about helping people express their creativity and preserve their memories.
+Our mission is to promote mental health and wellness through creative art activities. We believe that crafting is more than just a hobbyβit's a therapeutic journey that brings joy, mindfulness, and self-expression.
+ +Our carefully curated collection includes:
+We hand-select every item in our store to ensure the highest quality and uniqueness. Whether you're a seasoned crafter or just starting your creative journey, we have something special for everyone.
+Join our community of creative minds and let your imagination soar!
+Your creative journey starts here
+Sky Art Shop specializes in scrapbooking, journaling, cardmaking, and collaging stationery. We are passionate about helping people express their creativity and preserve their memories.
+Our mission is to promote mental health and wellness through creative art activities. We believe that crafting is more than just a hobbyβit's a therapeutic journey that brings joy, mindfulness, and self-expression.
+ +Our carefully curated collection includes:
+We hand-select every item in our store to ensure the highest quality and uniqueness. Whether you're a seasoned crafter or just starting your creative journey, we have something special for everyone.
+Join our community of creative minds and let your imagination soar!
+Your destination for creative stationery and supplies
++ Discover our curated collection of scrapbooking, journaling, cardmaking, and collaging supplies. + Express your creativity and bring your artistic vision to life. +
+Discover our most popular items
+Your destination for creative stationery and supplies
++ Discover our curated collection of scrapbooking, journaling, + cardmaking, and collaging supplies. Express your creativity and + bring your artistic vision to life. +
+
+ + At Sky Art Shop, we believe in the power of creativity to + transform and inspire. Whether you're an experienced crafter or + just beginning your creative journey, we have everything you need + to bring your ideas to life. +
++ Explore our collection of washi tapes, stickers, stamps, and more. + Each item is carefully selected to help you create something + beautiful and meaningful. +
+
+ Discover our most popular items
+
+ Loading Sky Art Shop...
+ + diff --git a/website/public/portfolio.html b/website/public/portfolio.html new file mode 100644 index 0000000..e2809fa --- /dev/null +++ b/website/public/portfolio.html @@ -0,0 +1,255 @@ + + + + + +Your creative journey starts here
+Sky Art Shop specializes in scrapbooking, journaling, cardmaking, and collaging stationery. We are passionate about helping people express their creativity and preserve their memories.
+Our mission is to promote mental health and wellness through creative art activities. We believe that crafting is more than just a hobbyβit's a therapeutic journey that brings joy, mindfulness, and self-expression.
+ +Our carefully curated collection includes:
+We hand-select every item in our store to ensure the highest quality and uniqueness. Whether you're a seasoned crafter or just starting your creative journey, we have something special for everyone.
+Join our community of creative minds and let your imagination soar!
++ Find everything you need for your creative projects +
+Loading products...
+