Skip to content

PAIshanMadusha/cart-system-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Cart System (React + TypeScript)

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.


πŸ“Œ Features:

  • βœ… 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.

🧰 Tech Stack:

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.

πŸ“¦ Dependencies:

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"
}

πŸ“ Project Structure:

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.ts

πŸš€ Installation & Setup:

Follow these steps to successfully run the project:

1. Clone the repository:

git clone https://github.com/PAIshanMadusha/cart-system-typescript.git
And, navigate to the project directory:
cd cart-system-typescript

2. Install dependencies:

npm install

3. Run the app locally:

npm run dev

πŸ“Έ System Screenshots:

These screenshots illustrate how the system appears on desktop and mobile devices:


Screenshot 1

Screenshot 3

Screenshot 4

Screenshot 4

Screenshot 4Β Β Β  Screenshot 4


πŸ‘¨β€πŸ’» Created by:

Ishan Madhusha
GitHub: PAIshanMadusha

Feel free to explore my work and get in touch if you'd like to collaborate! πŸš€


πŸ“ License:

This project is licensed under the MIT License : See the LICENSE file for details.

About

A fully functional and responsive shopping cart system built with React, TypeScript, and Bootstrap.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors