Skip to content

Oriva-Foundation/LUXE-Ecommerce-Website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LUXE

LUXE β€” Premium E-Commerce

A full-stack e-commerce web application built with Vanilla JavaScript β€” zero frameworks, maximum performance.

JavaScript HTML5 CSS3 Node.js Express SQLite Leaflet JWT

License Status PRs


✨ Features

Feature Description
πŸ›οΈ Dynamic Product Grid 20 products rendered from JSON with lazy-loaded images and staggered animations
πŸ” Advanced Filtering Real-time search, category checkboxes, price range slider, rating filter, sort options
πŸ›’ Interactive Cart Slide-out drawer with quantity controls, live subtotal/tax/total calculations
πŸ‘οΈ Product Quick View Modal with full details, quantity selector, feature badges
πŸ“¦ Multi-Step Checkout 3-step form (Shipping β†’ Payment β†’ Review) with real-time RegEx validation
πŸ” User Authentication Register & login with bcrypt hashing + JWT tokens, session persistence
πŸ“ GPS Location Picker Interactive Leaflet map, GPS geolocation, drag-to-set, reverse geocoding
πŸ’Ύ Database Persistence Orders, users, and locations saved to SQLite via REST API
πŸ“± Responsive Design Mobile-first with breakpoints at 480px, 768px, and 1024px
🎨 Premium Aesthetics Glassmorphism, gradients, micro-animations, CSS custom properties

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
JS Application logic, ES Modules
HTML Semantic markup
CSS Custom properties, Flexbox, Grid, Animations
Leaflet Interactive map for GPS location picker
OpenStreetMap Map tiles & Nominatim geocoding

Backend

Technology Purpose
Node Server runtime
Express REST API framework
SQLite Embedded database (via better-sqlite3)
JWT Token-based authentication
bcrypt Password hashing

πŸ“ Project Structure

luxe-ecommerce/
β”œβ”€β”€ πŸ“„ index.html              # Single-page app shell
β”œβ”€β”€ πŸ“„ server.js               # Express server + REST API
β”œβ”€β”€ πŸ“„ db.js                   # SQLite database setup
β”œβ”€β”€ πŸ“„ package.json            # Dependencies & scripts
β”œβ”€β”€ πŸ“„ .gitignore              # Git ignore rules
β”‚
β”œβ”€β”€ πŸ“‚ data/
β”‚   └── products.json          # Product catalog (20 items)
β”‚
β”œβ”€β”€ πŸ“‚ css/
β”‚   β”œβ”€β”€ variables.css          # Design tokens & theme
β”‚   β”œβ”€β”€ base.css               # Reset & global typography
β”‚   β”œβ”€β”€ layout.css             # Grid layout & hero section
β”‚   β”œβ”€β”€ animations.css         # @keyframes definitions
β”‚   β”œβ”€β”€ responsive.css         # Mobile-first breakpoints
β”‚   └── πŸ“‚ components/
β”‚       β”œβ”€β”€ header.css         # Glassmorphism header
β”‚       β”œβ”€β”€ sidebar.css        # Filter sidebar
β”‚       β”œβ”€β”€ product-card.css   # Product cards & skeleton loaders
β”‚       β”œβ”€β”€ cart.css           # Slide-out cart drawer
β”‚       β”œβ”€β”€ modal.css          # Quick view modal
β”‚       β”œβ”€β”€ checkout.css       # Multi-step checkout form
β”‚       β”œβ”€β”€ footer.css         # Footer layout
β”‚       β”œβ”€β”€ auth.css           # Login/register modal
β”‚       └── location.css       # GPS map modal
β”‚
└── πŸ“‚ js/
    β”œβ”€β”€ app.js                 # Entry point & bootstrap
    β”œβ”€β”€ store.js               # Central state management
    β”œβ”€β”€ api.js                 # Product data fetching
    β”œβ”€β”€ api-client.js          # Auth & order API client
    β”œβ”€β”€ πŸ“‚ utils/
    β”‚   β”œβ”€β”€ helpers.js         # DOM utils, currency, toast, debounce
    β”‚   └── validators.js      # RegEx form validators
    └── πŸ“‚ components/
        β”œβ”€β”€ header.js          # Header scroll & mobile menu
        β”œβ”€β”€ filters.js         # Search, category, price, rating, sort
        β”œβ”€β”€ productCard.js     # Card rendering & interactions
        β”œβ”€β”€ productList.js     # Product grid & skeleton loading
        β”œβ”€β”€ cart.js            # Cart drawer logic
        β”œβ”€β”€ quickView.js       # Product detail modal
        β”œβ”€β”€ checkout.js        # Multi-step form & API submission
        β”œβ”€β”€ auth.js            # Login/register & JWT management
        └── location.js        # GPS, Leaflet map, geocoding

πŸš€ Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/your-username/luxe-ecommerce.git
cd luxe-ecommerce

# Install dependencies
npm install

# Start the server
npm start

Open http://localhost:3000 in your browser.


πŸ“‘ API Reference

Authentication

Method Endpoint Body Description
POST /api/auth/register { name, email, password, phone? } Create a new account
POST /api/auth/login { email, password } Sign in, returns JWT
GET /api/auth/me β€” Get current user (πŸ”’ auth)

Orders

Method Endpoint Body Description
POST /api/orders { items, shipping_address, subtotal, tax, total } Place an order (πŸ”’ auth)
GET /api/orders β€” Get order history (πŸ”’ auth)

Locations

Method Endpoint Body Description
POST /api/locations { lat, lng, address, label?, is_default? } Save a location (πŸ”’ auth)
GET /api/locations β€” Get saved locations (πŸ”’ auth)

πŸ”’ = Requires Authorization: Bearer <token> header


πŸ—„οΈ Database Schema

users (id, name, email, password_hash, phone, address, created_at)
orders (id, user_id, items, shipping_address, subtotal, tax, total, status, created_at)
user_locations (id, user_id, label, lat, lng, address, is_default, created_at)

πŸ—οΈ Architecture

graph TD
    A[Browser] -->|ES Modules| B[app.js]
    B --> C[store.js<br>Central State]
    B --> D[api.js<br>Product Data]
    B --> E[api-client.js<br>Auth & Orders]
    C --> F[Components]
    F --> G[Product Grid]
    F --> H[Cart Drawer]
    F --> I[Checkout Form]
    F --> J[Auth Modal]
    F --> K[Location Picker]
    E -->|REST API| L[Express Server]
    L --> M[(SQLite DB)]
    K -->|Tiles| N[OpenStreetMap]
    K -->|Geocoding| O[Nominatim API]
Loading

🎨 Design System

Token Value Usage
--color-primary #6c5ce7 Buttons, accents, links
--color-accent #00b894 Success states, badges
--color-error #e17055 Error states, validation
--radius-md 12px Card corners, inputs
--shadow-lg 0 20px 60px… Elevated surfaces
--transition-base 250ms ease Standard interactions

πŸ“± Responsive Breakpoints

Breakpoint Target Layout
β‰₯ 1024px πŸ–₯️ Desktop Sidebar + 3-col grid
768px – 1023px πŸ“± Tablet No sidebar, 2-col grid
≀ 767px πŸ“± Mobile Single column, hamburger menu

πŸ”’ Security

  • Passwords hashed with bcrypt (10 salt rounds)
  • Authentication via JWT tokens (7-day expiry)
  • Input validation on both client and server
  • SQL injection prevention with parameterized queries
  • CORS enabled for cross-origin requests

πŸ“„ License

This project is licensed under the MIT License.


⭐ If you like this project, consider sponsoring me


Built with ❀️ using Vanilla JavaScript

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors