gusa3dStore

๐Ÿ–จ๏ธ 3D Kids Print Shop

A fun, colorful e-commerce proof of concept for a store run by kids aged 11-13 who sell 3D printed items!

๐ŸŒŸ Features

For Customers:

For Admin (Kid Store Managers):

๐Ÿš€ Local Development

Prerequisites

1. Start the Backend (Node.js/Express)

cd backend-node
npm install
npm start

The API will start at http://localhost:8080

2. Start the Frontend (Svelte)

cd frontend
npm install
npm run dev

The store will be available at http://localhost:5173

โ˜๏ธ Deployment

Backend โ†’ Render.com

  1. Push your code to GitHub
  2. Go to Render.com and create a new Web Service
  3. Connect your GitHub repository
  4. Configure:
    • Root Directory: backend-node
    • Build Command: npm install
    • Start Command: npm start
  5. Deploy! Note your URL (e.g., https://kids-3d-store-api.onrender.com)

Frontend โ†’ GitHub Pages

  1. Update frontend/.env with your Render backend URL:
    VITE_API_URL=https://your-app-name.onrender.com
    
  2. If deploying to username.github.io/repo-name, also set:
    BASE_PATH=/repo-name
    
  3. Build the static site:
    cd frontend
    npm run build
    
  4. Deploy the build folder to GitHub Pages:
    • Go to your repo Settings โ†’ Pages
    • Choose โ€œDeploy from a branchโ€
    • Select the branch containing your build folder
    • Or manually push the build folder contents to a gh-pages branch

Quick deploy to gh-pages branch:

cd frontend
npm run build
cd build
git init
git add .
git commit -m "Deploy"
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -f origin main:gh-pages

๐Ÿ“ Project Structure

3DEEGusa/
โ”œโ”€โ”€ backend-node/           # Node.js/Express API
โ”‚   โ”œโ”€โ”€ index.js           # Main server file
โ”‚   โ”œโ”€โ”€ package.json       # Dependencies
โ”‚   โ”œโ”€โ”€ render.yaml        # Render.com config
โ”‚   โ””โ”€โ”€ store.json         # Data file (auto-created)
โ”‚
โ”œโ”€โ”€ frontend/              # SvelteKit application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ routes/        # Pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ +page.svelte       # Home page
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ +layout.svelte     # Main layout
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ shop/              # Product catalog
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cart/              # Shopping cart & checkout
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ track/             # Order tracking
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ admin/             # Admin dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api.ts            # API client
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ config.ts         # Configuration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ stores.ts         # Svelte stores
โ”‚   โ”‚   โ”œโ”€โ”€ app.css               # Global styles
โ”‚   โ”‚   โ””โ”€โ”€ app.html              # HTML template
โ”‚   โ”œโ”€โ”€ static/                   # Static assets
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ””โ”€โ”€ README.md

๐ŸŽจ API Endpoints

Products

Cart (requires X-Session-ID header)

Orders

Admin

๐ŸŽญ Demo Products

The backend automatically seeds 12 sample products when first started:

๐ŸŽ‰ Technology Stack

๐Ÿ’ก Tips for Kids

  1. Adding Products: Go to Admin โ†’ Products โ†’ Add Product
  2. Updating Orders: Go to Admin โ†’ Orders โ†’ Click โ€œUpdate Statusโ€
  3. Tracking Orders: Share the tracking code with customers!

Made with โค๏ธ for young entrepreneurs! ๐ŸŒŸ