π Live Demo: π View Project on Netlify
A fully functional and responsive shopping cart system built with React, TypeScript, and Bootstrap. This project demonstrates clean UI design, state management using the Context API, and local storage persistence. It allows users to browse a product list, add or remove items from their cart, and view real-time cart totals based on quantity and pricing.
- β Add and remove items from cart.
- π¦ Auto-saves cart using localStorage.
- π’ Calculates price based on item quantity.
- π° Displays total price and total items in cart.
- π± Fully responsive layout (Bootstrap 5).
- π‘ Built with strongly typed TypeScript.
The following tech stack is used in this project:
- React 19 : JavaScript library for building user interfaces with component-based architecture.
- TypeScript : A strongly typed superset of JavaScript that helps catch errors early and improves code quality.
- React Bootstrap : Bootstrap components rewritten as React components for easy integration with React apps.
- Bootstrap 5 : A responsive CSS framework that provides pre-built UI styles and layout utilities.
- React Router v7 : Handles client-side routing, allowing seamless navigation between pages without full reloads.
- React Icons : A popular icon library offering access to hundreds of SVG icons from various icon sets.
The following dependencies are used in this project:
"dependencies": {
"bootstrap": "^5.3.7",
"react": "^19.1.0",
"react-bootstrap": "^2.10.10",
"react-dom": "^19.1.0",
"react-icons": "^5.5.0",
"react-router-dom": "^7.6.3"
}The following structure is used in this project to maintain a clean and modular codebase:
cart-system-typescript/
βββ node_modules/
βββ public/
βββ src/
β βββ assets/ # Images, icons, and other static assets
β βββ components/ # Reusable UI components (Navbar, Footer, CartItem, etc.)
β βββ context/ # React Context logic (e.g., ShoppingCartContext)
β βββ data/ # Static item data (items.json)
β βββ hooks/ # Custom React hooks (e.g., useLocalStorage)
β βββ pages/ # Route components like Home and About
β βββ utilities/ # Utility functions (e.g., formatCurrency)
β βββ App.tsx # Main app component
β βββ main.tsx # Application entry point
βββ .gitignore # Git ignored files
βββ eslint.config.js
βββ index.html # Main HTML template
βββ LICENSE
βββ package-lock.json
βββ package.json # Project metadata and dependencies
βββ README.md
βββ tsconfig.app.json
βββ tsconfig.json
βββ tsconfig.node.json
βββ vite.config.tsFollow these steps to successfully run the project:
git clone https://github.com/PAIshanMadusha/cart-system-typescript.gitcd cart-system-typescriptnpm installnpm run devThese screenshots illustrate how the system appears on desktop and mobile devices:
Ishan Madhusha
GitHub: PAIshanMadusha
Feel free to explore my work and get in touch if you'd like to collaborate! π
This project is licensed under the MIT License : See the LICENSE file for details.





