React frontend · Node.js/Express backend · SQLite (sql.js) database
cd backend
node server.js
# Runs on http://localhost:4000cd frontend
npm run dev
# Runs on http://localhost:5173Open http://localhost:5173 in your browser.
- / — 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
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)
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.
cd chatbot
pip install -r requirements.txtSet 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-1python -m chatbot.server
# Runs on http://localhost:5000| 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.
| 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 |