Skip to content

alessaest/kiro-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopMart — 3-Tier E-Commerce App

React frontend · Node.js/Express backend · SQLite (sql.js) database

Quick Start

1. Start the backend

cd backend
node server.js
# Runs on http://localhost:4000

2. Start the frontend (new terminal)

cd frontend
npm run dev
# Runs on http://localhost:5173

Open http://localhost:5173 in your browser.

Pages

  • / — Home: 20 products with emoji images, search/filter
  • /product/:id — Product detail: description, price, qty, add-to-cart, reviews
  • /cart — Shopping cart: update qty, delete items, order total, clear cart

Architecture

frontend/   React + Vite (port 5173)
backend/    Express API (port 4000)
chatbot/    AI shopping assistant — Flask API (port 5000)
backend/shop.db   SQLite database (auto-created on first run)

Chatbot (AI Shopping Assistant)

A Python-based AI assistant powered by Strands Agents and Amazon Bedrock (Nova Pro). It can browse products, manage the cart, and read/submit reviews on behalf of the user.

Setup

cd chatbot
pip install -r requirements.txt

AWS Credentials

Set one of the following before starting:

# Option A — IAM credentials
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=...   # optional, for temporary credentials
export AWS_DEFAULT_REGION=us-east-1

# Option B — Bedrock API key
export AWS_BEARER_TOKEN_BEDROCK=...
export AWS_DEFAULT_REGION=us-east-1

Start the chatbot server

python -m chatbot.server
# Runs on http://localhost:5000

Chatbot API

Method Path Description
GET /health Health check
POST /chat Send a message; returns reply and session_id

POST /chat request body:

{
  "message": "What laptops do you have?",
  "session_id": "optional-existing-session-id"
}

Response:

{
  "reply": "Here are the laptops we carry...",
  "session_id": "abc123"
}

Pass the returned session_id in subsequent requests to maintain conversation context.

API Endpoints

Method Path Description
GET /api/products List all products
GET /api/products/:id Get product
GET /api/products/:id/reviews Get reviews
POST /api/products/:id/reviews Add review
GET /api/cart Get cart
POST /api/cart Add to cart
PUT /api/cart/:id Update quantity
DELETE /api/cart/:id Remove item
DELETE /api/cart Clear cart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors