A full-featured client-side e-commerce simulator built with vanilla JavaScript, Bootstrap 5, and Sass. Features user authentication, a dynamic product gallery with a custom carousel, a shopping cart with real-time stock management, and full session persistence using localStorage as the data layer.
- 👤 User Authentication — Register, login, logout, and account deletion
- 🛍️ Product Gallery — Dynamic product listing with images, prices, and stock levels
- 🎠 Custom Carousel — Responsive image carousel with variable visible items based on screen size
- 🛒 Shopping Cart — Add items, view cart summary, confirm purchases
- 💰 Balance System — Users have a credit balance that decreases with purchases
- 📦 Collection Tracking — Purchased items are stored in a personal collection
- 📊 User Dashboard — View username, email, balance, cart total, and purchased items
- 💾 localStorage Persistence — All data survives page reloads and sessions
- 📉 Stock Synchronization — Product stock updates dynamically after purchases
- 🔔 Toast Notifications — User feedback via Toastify.js
- 🌐 Multi-page Architecture — Separate HTML pages for home, gallery, cart, login, and registration
ProyectoFinal-Sanchez-Martinez/
├── index.html # Landing page
├── package.json # Dependencies (Bootstrap, Toastify, UUID)
├── pages/
│ ├── buy.html # Shopping cart & user dashboard
│ ├── list.html # Product gallery with carousel
│ ├── login.html # Login form
│ ├── register.html # Registration form
│ ├── product.json # Product data source
│ └── user.json # Default user data
├── scripts/
│ ├── helpers.js # Shared utilities (DOM builders, storage ops)
│ ├── models.js # User and Item class definitions
│ ├── cart.js # Cart page logic & user dashboard
│ ├── list.js # Gallery rendering & carousel
│ ├── login.js # Login form handling
│ └── register.js # Registration form handling
├── sass/
│ └── sass.scss # Custom Sass styles
├── style/
│ ├── style.css # Main stylesheet
│ ├── sass.css # Compiled Sass output
│ ├── sass.css.map # Source map
│ └── list.css # Gallery-specific styles
└── img/ # Product and UI images
- A modern web browser
- Node.js (optional, for dependency management)
# Clone the repository
git clone https://github.com/JohnCard/ProyectoFinal-Sanchez-Martinez.git
# Navigate to the project
cd ProyectoFinal-Sanchez-Martinez
# Install dependencies (optional — Bootstrap & Toastify loaded via CDN)
npm install
# Open in browser
open index.html
# Or use a local server:
npx serve .- Navigate to Register and create a new account
- Login with your credentials
- Browse the Gallery to see available products
- Add items to your shopping cart
- Go to Cart to review, adjust quantities, and confirm your purchase
- Check your Dashboard for balance and collection updates
| Landing Page | Product Gallery | Shopping Cart | User Dashboard |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- OOP in JavaScript —
UserandItemclasses with constructors and computed properties - ES6 Modules — Import/export across multiple script files
- DOM Manipulation — Dynamic element creation and event handling
- Client-side State Management — Full CRUD operations via
localStorage - Responsive Carousel — Custom-built with dynamic
visibleItemsbased on viewport width - Form Validation — Password confirmation, required fields
- UUID Generation — Unique user IDs via
crypto.randomUUID()



