# ๐ŸŽฏ Sky Art Shop - Quick Reference Card ## ๐Ÿš€ Start Backend ```powershell cd "e:\Documents\Website Projects\Sky_Art_Shop\Admin" dotnet run --launch-profile https ``` **URL**: --- ## ๐Ÿ”‘ Admin Access **URL**: **User**: `admin` **Pass**: `admin123` --- ## ๐Ÿ“ File Structure ``` Sky_Art_Shop/ โ”œโ”€โ”€ Admin/ # Backend CMS โ”‚ โ”œโ”€โ”€ Controllers/ โ”‚ โ”‚ โ”œโ”€โ”€ AdminController.cs # Admin CRUD โ”‚ โ”‚ โ”œโ”€โ”€ PublicProductsController.cs โ”‚ โ”‚ โ”œโ”€โ”€ PublicProjectsController.cs โ”‚ โ”‚ โ”œโ”€โ”€ PublicBlogController.cs โ”‚ โ”‚ โ””โ”€โ”€ ... (more public APIs) โ”‚ โ”œโ”€โ”€ Models/ โ”‚ โ”œโ”€โ”€ Views/Admin/ # Admin pages โ”‚ โ”œโ”€โ”€ wwwroot/uploads/ # Uploaded images โ”‚ โ””โ”€โ”€ Program.cs # CORS + routes โ”‚ โ”œโ”€โ”€ js/ # Frontend integration โ”‚ โ”œโ”€โ”€ api-integration.js # Core API functions โ”‚ โ”œโ”€โ”€ shop-page.js โ”‚ โ”œโ”€โ”€ portfolio-page.js โ”‚ โ””โ”€โ”€ blog-page.js โ”‚ โ”œโ”€โ”€ css/ โ”‚ โ””โ”€โ”€ api-styles.css # Card & grid styles โ”‚ โ”œโ”€โ”€ shop.html # Static pages โ”œโ”€โ”€ portfolio.html โ”œโ”€โ”€ blog.html โ”œโ”€โ”€ index.html โ”œโ”€โ”€ about.html โ”œโ”€โ”€ contact.html โ”‚ โ”œโ”€โ”€ test-api.html # Test page โ”œโ”€โ”€ INTEGRATION_GUIDE.md # How to integrate โ”œโ”€โ”€ IMAGE_FIX_GUIDE.md # Fix images โ””โ”€โ”€ CMS_COMPLETE_GUIDE.md # Full overview ``` --- ## ๐Ÿ”— API Endpoints | URL | Returns | |-----|---------| | `/api/products` | All products | | `/api/projects` | Portfolio projects | | `/api/blog` | Blog posts | | `/api/pages/{slug}` | Page content | | `/api/categories` | Categories | | `/api/settings` | Site settings | | `/uploads/products/*` | Product images | --- ## ๐Ÿ“ Integration Template **For any HTML page:** ```html ``` **In HTML body:** ```html
``` --- ## ๐Ÿงช Testing 1. **Test API**: Open `test-api.html` 2. **Test Page**: Open `shop.html` (after integration) 3. **Check Console**: F12 โ†’ Console โ†’ Should see "Loaded X items" 4. **Check Network**: F12 โ†’ Network โ†’ See API calls + images --- ## ๐Ÿ› Quick Fixes ### Images Not Showing 1. Admin โ†’ Products โ†’ Edit 2. Upload Main Image 3. Save 4. Refresh static page ### Backend Not Running ```powershell cd "e:\Documents\Website Projects\Sky_Art_Shop\Admin" dotnet run --launch-profile https ``` ### CORS Error Already fixed - CORS enabled in Program.cs ### Can't See Products 1. Check browser console (F12) 2. Verify backend running 3. Test with `test-api.html` --- ## ๐Ÿ“‚ Image Upload Locations | Content Type | Upload Folder | |-------------|---------------| | Products | `Admin/wwwroot/uploads/products/` | | Projects | `Admin/wwwroot/uploads/projects/` | | Blog | `Admin/wwwroot/uploads/blog/` | **Served at**: `https://localhost:5001/uploads/products/` --- ## โœ… Integration Checklist - [ ] Backend running () - [ ] MongoDB service running - [ ] Products have images uploaded - [ ] Script tags added to HTML pages - [ ] Container divs added to HTML - [ ] `test-api.html` shows products with images - [ ] `shop.html` renders products from API - [ ] Browser console shows "Loaded X products" --- ## ๐Ÿ“š Documentation | File | Purpose | |------|---------| | `INTEGRATION_GUIDE.md` | Step-by-step for each page | | `IMAGE_FIX_GUIDE.md` | Fix missing images | | `CMS_COMPLETE_GUIDE.md` | Full overview | | `test-api.html` | Test & debug page | --- ## ๐ŸŽฏ Workflow **For Client (Content Management):** 1. Open 2. Login 3. Add/Edit products, projects, blog posts 4. Upload images 5. Save 6. Changes appear on static site immediately **For Developer (Customization):** 1. Edit `js/api-integration.js` for custom rendering 2. Edit `css/api-styles.css` for styling 3. Edit HTML pages for layout 4. Backend APIs remain unchanged --- ## ๐Ÿ’ก Pro Tips - **Test First**: Always use `test-api.html` to verify API before integrating - **Console is Your Friend**: F12 โ†’ Console shows all errors - **Images**: Upload via Admin Edit, not Create (safer) - **CORS**: Already configured for `file://` and `localhost` - **Production**: Change `API_BASE` in `api-integration.js` when deploying --- ## ๐Ÿš€ What's Next? 1. **Upload images** to products (Admin โ†’ Products โ†’ Edit) 2. **Integrate HTML pages** (add script tags + container divs) 3. **Test everything** with `test-api.html` 4. **Customize styles** in `api-styles.css` 5. **Deploy** (optional - see CMS_COMPLETE_GUIDE.md) --- **Status**: โœ… Backend Running | โš ๏ธ Images Need Upload | ๐Ÿ“ Pages Need Integration **Quick Test**: Open `file:///E:/Documents/Website%20Projects/Sky_Art_Shop/test-api.html`