ShopGrid is a full-stack e-commerce web application with a premium, modern UI and a responsive storefront powered by an Express API backend. The project includes product browsing, category filtering, cart management, account authentication, order placement, and AI-powered smart styling recommendations.
- Multi-page storefront: home, shop, product, cart, checkout, and login/register
- AI Smart Stylist: Upload outfit photos → get personalized product recommendations
- Category and search-based product discovery
- JWT-based authentication (register, login, protected routes)
- User-specific cart sync with backend storage
- Order creation and order history APIs
- Premium modern UI with smooth animations, hover effects, and Apple-level design
- Shared product catalog across frontend and backend
- Frontend: HTML, CSS, Vanilla JavaScript (no frameworks)
- Backend: Node.js, Express
- Authentication: JSON Web Tokens (JWT), bcryptjs
- AI Features: OpenAI Vision API (GPT-4 Vision)
- Data layer: File-based JSON persistence
- Styling: Modern CSS with animations, gradients, and shadows
.
├── backend/
│ ├── data/
│ │ └── database.json
│ ├── src/
│ │ ├── middleware/
│ │ │ └── auth.js
│ │ ├── routes/
│ │ │ ├── auth.js
│ │ │ ├── cart.js
│ │ │ ├── orders.js
│ │ │ └── products.js
│ │ ├── services/
│ │ │ ├── apiResponse.js
│ │ │ ├── db.js
│ │ │ └── products.js
│ │ └── server.js
│ ├── .env.example
│ └── package.json
├── frontend/
│ └── public/
│ ├── app.js
│ ├── cart.html
│ ├── checkout.html
│ ├── data.js
│ ├── index.html
│ ├── login.html
│ ├── product.html
│ ├── shop.html
│ ├── style.css
│ └── legacy/
├── package.json
└── README.md
- Node.js 18+
- npm 9+
npm run install:allCreate backend/.env from backend/.env.example and set:
PORT=4000
JWT_SECRET=replace-with-a-strong-secretnpm run devApp URL:
Base URL: http://localhost:4000
GET /api/health
POST /api/auth/registerPOST /api/auth/loginGET /api/auth/me(requires Bearer token)
GET /api/productsGET /api/products/:id
Query parameters for GET /api/products:
q: search textcat: categoryminPrice: minimum pricemaxPrice: maximum pricesort:featured | price-asc | price-desc | rating | discountpage: page numberlimit: page size
GET /api/cartPUT /api/cart
GET /api/ordersPOST /api/orders
Application data is stored in:
backend/data/database.json
Stored entities:
- Users (password hashes only)
- Carts (per user)
- Orders
Root:
npm run install:all- install backend dependenciesnpm run dev- run backend in development modenpm run start- run backend in production mode
Backend:
npm --prefix backend run devnpm --prefix backend run start
- Database migration (PostgreSQL or MongoDB)
- Input validation and schema enforcement
- Security middleware (helmet, rate limiting)
- Automated API and integration tests
- CI/CD pipeline for deployment
This project is available for educational and portfolio use.