Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🛒 E-Commerce Web Application (React + Node/Sequelize/SQLite)

Welcome to the E-Commerce Web Application! This repository contains a fully-featured mock shopping platform featuring product catalog search, a live cart drawer with custom delivery fee calculations, detailed payment breakdown, order generation, and shipping status tracking.

🔗 Live Demo: http://ecommerce-project-react-env.eba-euxpdgmw.ap-southeast-2.elasticbeanstalk.com/

The project is split into two main components:


🎨 Visual Gallery

Here is a visual walk-through of the main application interfaces:

Homepage Overview Checkout and Shipping Options Placed Orders History Shipment Delivery Tracking


📁 Project Structure

ecommerce-project/
├── README.md               # Root Project Overview (This file)
├── ecommerce-backend/      # Node.js Server & Sequelize Models
│   ├── README.md           # Backend Documentation & Developer Guide
│   ├── backend/            # Route Controllers (products, cart, orders, etc.)
│   ├── models/             # Sequelize database models
│   ├── defaultData/        # Mock dataset seeds
│   └── server.js           # Backend API application server
├── ecommerce-frontend/     # React Single Page Application (SPA)
│   ├── README.md           # Frontend Documentation & Developer Guide
│   ├── public/             # Favicon & assets
│   ├── src/
│   │   ├── components/     # Reusable layouts (Header)
│   │   ├── pages/          # Page components & styles (home, checkout, orders)
│   │   ├── utils/          # Helpers (currency formatting)
│   │   ├── App.jsx         # Routing configuration
│   │   └── main.jsx        # Entry point
│   ├── index.html          # Document Template
│   └── vite.config.js      # Dev server API reverse proxies

🛠️ Tech Stack Overview

Component Technology Description
Frontend React 19 Declarative UI library
Routing React Router v7 Seamless client-side navigation
Styling Vanilla CSS Flexbox, grid, and media-query responsive layout
Backend Express (Node.js) Light, fast RESTful API web server framework
ORM / DB Sequelize ORM used against SQLite locally and MySQL in production
Testing Vitest Extremely fast unit/integration testing framework

☁️ Deployment

Both the frontend and backend are deployed together on AWS Elastic Beanstalk, with the database running on Amazon RDS (MySQL).

  • Hosting: AWS Elastic Beanstalk (Node.js 24 on 64-bit Amazon Linux 2023), region ap-southeast-2 (Sydney)
  • Database: Amazon RDS for MySQL (db.t4g.micro, free tier), same region as the app, connected privately via a VPC security group — not exposed to the public internet
  • Backend/DB connection: the backend uses Sequelize and automatically switches from a local SQLite file to the RDS MySQL database when RDS_HOSTNAME, RDS_USERNAME, and RDS_PASSWORD environment variables are present (see ecommerce-backend/models/index.js)
  • Build: the frontend is built with Vite and served as static files by the Express backend, so a single Elastic Beanstalk environment serves both the API and the client
  • Environment variables set on Elastic Beanstalk:
    • RDS_HOSTNAME, RDS_PORT, RDS_DB_NAME, RDS_USERNAME, RDS_PASSWORD, DB_TYPE=mysql

Live app: http://ecommerce-project-react-env.eba-euxpdgmw.ap-southeast-2.elasticbeanstalk.com/


🚀 Getting Started (Local Development)

To run the application locally, you will need to start both the backend API server and the frontend client.

Prerequisites

  • Node.js (version 22+) installed on your machine.

1. Start the Backend API Server

cd ecommerce-backend
npm install
npm run dev

Note

The backend server runs at http://localhost:3000. Locally, without RDS environment variables set, it falls back to an in-memory SQLite database automatically.

2. Start the Frontend Application

In a new terminal window:

cd ecommerce-frontend
npm install
npm run dev

Note

The frontend client runs at http://localhost:5173. Open this URL in your browser.


📖 Subproject Documentation

For more detailed information, guides, and API parameters, check out:

About

SnapBazar an E-Commerce Web Application fully-featured mock shopping platform featuring product catalog search, a live cart drawer with custom delivery fee calculations, detailed payment breakdown, order generation, and shipping status tracking.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages