Skip to content

sarankirthic/ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Web Application

A simple e-commerce platform built with Java, Spring Boot, MySQL, and Thymeleaf. This application supports user registration and login, product catalog browsing, cart management, checkout, review posting, and order receipt generation.


Tech Stack

  • Java 17+
  • Spring Boot
  • MySQL (database)
  • Thymeleaf (server-side templating)
  • Maven (build tool)

Features

  • User registration and login
  • Product catalog display
  • Add to cart, view cart, and update cart
  • Checkout with customer details and address validation
  • View order receipt upon checkout
  • Product and service review functionality

API Endpoints

API Endpoints

HTTP Method Path Description Controller
GET / Show landing page HomeController
GET /home Show home page HomeController
GET /products List all products ProductController
GET /cart View cart CartController
POST /cart/add Add a product to cart CartController
POST /cart/remove Remove a product from cart CartController
POST /cart/checkout Proceed to checkout (redirects to /checkout) CartController
GET /checkout Show checkout page CheckoutController
POST /checkout Submit checkout form, process and save order CheckoutController
GET /receipt/{orderId} Show the receipt page for a specific order CheckoutController
GET /register Display user registration form UserController
POST /register Submit registration data and create new user UserController
GET /login Show user login form UserController
GET /reviews List all product/service reviews ReviewController

Project Structure

Layer Description Example Files
Controller Handles web requests CartController.java, ProductController.java, UserController.java
Service Business logic and utilities CartService.java, ProductService.java, etc.
Model Data models/entities User.java, Product.java, Cart.java
Repository Spring Data JPA interfaces UserRepository.java, ProductRepository.java
Templates Front-end views index.html, products.html, cart.html, register.html
Static CSS, JS, images static/ folder in resources

Getting Started

Prerequisites

  • Java 17 or higher
  • Maven 3.x
  • MySQL 5.7/8.x

Setup Instructions

  1. Clone the Repository

    git clone https://github.com/sarankirthic/ecommerce.git
    cd ecommerce
  2. Configure MySQL Database

  • Create a database (e.g., ecom_db).

  • Update src/main/resources/application.properties with these settings:

    spring.datasource.url=jdbc:mysql://localhost:3306/ecom_db
    spring.datasource.username=YOUR_MYSQL_USER
    spring.datasource.password=YOUR_MYSQL_PASSWORD
    spring.jpa.hibernate.ddl-auto=update
  1. Build and Run the Application

    mvn spring-boot:run
  2. Open in Browser

Navigate to http://localhost:8001/ for the home page.


Usage

  • Homepage: / or /home
  • Product Catalog: /products
  • Cart: /cart
  • Checkout: /checkout
  • User Registration: /register
  • User Login: /login
  • View Reviews: /reviews

Contribution

PRs are welcome! For major changes, please open an issue first to discuss what you’d like to change.


License

This project is licensed under the MIT License.

About

Simple E-Commerce Project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published