Spring Boot Shopping Cart

Simple shopping cart web app made using Spring Boot + Thymeleaf
Alternatives To Spring Boot Shopping Cart
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Spring Boot Examples29,523
3 months ago9Java
about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。
Springboot Learning Example15,813
3 months ago53apache-2.0Java
spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。
Newbee Mall10,418
5 months agogpl-3.0Java
🔥 🎉newbee-mall是一套电商系统,包括基础版本(Spring Boot+Thymeleaf)、前后端分离版本(Spring Boot+Vue 3+Element-Plus+Vue-Router 4+Pinia+Vant 4) 、秒杀版本、Go语言版本、微服务版本(Spring Cloud Alibaba+Nacos+Sentinel+Seata+Spring Cloud Gateway+OpenFeign+ELK)。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。
Ruoyi4,929
a month ago13mitHTML
:tada: (RuoYi)官方仓库 基于SpringBoot的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖。直接运行即可用
Favorites Web4,609
a year ago7HTML
云收藏 Spring Boot 2.X 开源项目
Spring Boot Projects4,551
a year ago2apache-2.0Java
:fire: 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。
Spring Boot Best Practice3,624
3 months agoapache-2.0Java
Spring Boot 最佳实践,包括自动配置、核心原理、源码分析、国际化支持、调试、日志集成、热部署等。
My Blog3,254
7 months ago9apache-2.0Java
:palm_tree::octocat:A simple & beautiful blogging system implemented with spring-boot & thymeleaf & mybatis My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验
Erupt2,31673 days ago71November 26, 202321apache-2.0Java
🚀 低代码后台管理框架,对象视图模型 → 0️⃣ 零前端代码、零代码生成、零SQL、零API声明、零DTO / VO / BO 创建,表结构注释自动生成 🛡 内置严密安全策略,细颗粒权限隔离 ☁️ Cloud开发能力,不停机升级,轻依赖,集群内每个服务都可以轻松实现数据可视化 ️☁️
Spring Boot Leaning2,068
a year ago1Java
Spring Boot 2.X 最全课程代码
Alternatives To Spring Boot Shopping Cart
Select To Compare


Alternative Project Comparisons
Readme

Spring Boot Shopping Cart Web App

About

This is a demo project for practicing Spring + Thymeleaf. The idea was to build some basic shopping cart web app.

It was made using Spring Boot, Spring Security, Thymeleaf, Spring Data JPA, Spring Data REST and Docker. Database is in memory H2.

There is a login and registration functionality included.

Users can shop for products. Each user has his own shopping cart (session functionality). Checkout is transactional.

Configuration

Configuration Files

Folder src/resources/ contains config files for shopping-cart Spring Boot application.

  • src/resources/application.properties - main configuration file. Here it is possible to change admin username/password, as well as change the port number.

How to run

There are several ways to run the application. You can run it from the command line with included Maven Wrapper, Maven or Docker.

Once the app starts, go to the web browser and visit http://localhost:8070/home

Admin username: admin

Admin password: admin

User username: user

User password: password

Maven Wrapper

Using the Maven Plugin

Go to the root folder of the application and type:

$ chmod +x scripts/mvnw
$ scripts/mvnw spring-boot:run

Using Executable Jar

Or you can build the JAR file with

$ scripts/mvnw clean package

Then you can run the JAR file:

$ java -jar target/shopping-cart-0.0.1-SNAPSHOT.jar

Maven

Open a terminal and run the following commands to ensure that you have valid versions of Java and Maven installed:

$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
$ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_102, vendor: Oracle Corporation

Using the Maven Plugin

The Spring Boot Maven plugin includes a run goal that can be used to quickly compile and run your application. Applications run in an exploded form, as they do in your IDE. The following example shows a typical Maven command to run a Spring Boot application:

$ mvn spring-boot:run

Using Executable Jar

To create an executable jar run:

$ mvn clean package

To run that application, use the java -jar command, as follows:

$ java -jar target/shopping-cart-0.0.1-SNAPSHOT.jar

To exit the application, press ctrl-c.

Docker

It is possible to run shopping-cart using Docker:

Build Docker image:

$ mvn clean package
$ docker build -t shopping-cart:dev -f docker/Dockerfile .

Run Docker container:

$ docker run --rm -i -p 8070:8070 \
      --name shopping-cart \
      shopping-cart:dev
Helper script

It is possible to run all of the above with helper script:

$ chmod +x scripts/run_docker.sh
$ scripts/run_docker.sh

Docker

Folder docker contains:

  • docker/shopping-cart/Dockerfile - Docker build file for executing shopping-cart Docker image. Instructions to build artifacts, copy build artifacts to docker image and then run app on proper port with proper configuration file.

Util Scripts

  • scripts/run_docker.sh.sh - util script for running shopping-cart Docker container using docker/Dockerfile

Tests

Tests can be run by executing following command from the root of the project:

$ mvn test

Helper Tools

HAL REST Browser

Go to the web browser and visit http://localhost:8070/

You will need to be authenticated to be able to see this page.

H2 Database web interface

Go to the web browser and visit http://localhost:8070/h2-console

In field JDBC URL put

jdbc:h2:mem:shopping_cart_db

In /src/main/resources/application.properties file it is possible to change both web interface url path, as well as the datasource url.

Popular Thymeleaf Projects
Popular Spring Projects
Popular User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Shell
Docker
Spring
Admin
Bash
Spring Boot
Session
Jar
Shell Script
Cart
Bash Script
Spring Mvc
Spring Security
Thymeleaf
Spring Data Jpa
Shopping Cart