A simple React app that lets you browse sweets, toss them into a cart, adjust quantities, and pretend you’ll only eat one. You won’t.
- Cart control: add, increment, decrement, remove, and reset. Be decisive.
- Order confirmation modal: it approves or judges. Mostly judges.
- Totals: numbers that remind you of your choices.
- Stack: React + Vite + Tailwind. No nonsense.
- React 19, Vite 7
- Tailwind CSS 4
- ESLint
- Icons by
lucide-react
- Node.js 18+ (20+ recommended) and npm
- macOS
- Homebrew:
brew install node
- Homebrew:
- Windows
- Winget:
winget install OpenJS.NodeJS.LTS
- Winget:
- Ubuntu
- NodeSource (recommended):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs
- NodeSource (recommended):
If you prefer nvm, use it. If you don’t, don’t. Just get Node installed.
# 1) Clone
git clone https://github.com/your-username/product-list-with-cart.git
cd product-list-with-cart
# 2) Install dependencies
npm install
# 3) Start the dev server
npm run devOpen the printed URL (usually http://localhost:5173). If the port is busy, change it like a competent person:
npm run dev -- --port 3000When you’re ready to commit to your decisions:
# Production build
npm run build
# Preview the production build
npm run previewRules exist for a reason. Follow them.
npm run lintnpm run dev: Start local developmentnpm run build: Build for productionnpm run preview: Preview production buildnpm run lint: Check code quality
- No environment variables needed. A rare mercy.
- Assets live under
public/images. Keep them there. Don’t get clever. - If you must use
yarnorpnpm, translate the commands yourself. You’re an adult.