Skip to content

AlTriV/online-store

Repository files navigation

Online Store v4

Introduction

This project is a simple reactive web application based on Spring Boot using reactive stack (Spring WebFlux, Spring Data R2DBC), that implements a small online store. The project consist of 3 modules:

Store-service secured by username/password login form security. Communication between store-service and payment-service secured by bearer auth using jwt and keycloak.

Features

  • Add/delete items to the shopping cart
  • View item details
  • Browse the shopping cart
  • View the order history and each order details

App build requirements

  • JDK 21
  • Docker
  • Gradle 8.13 (optional)

App start requirements

For test cases the store-service module have additional application properties to add test users in the app.

These properties add admin user:

store:
  admin:
    username: ${STORE_ADMIN_USER}
    password: ${STORE_ADMIN_PASS}

This property will add simple users (alice and bob) to the app:

store:
  predefined-users:
    credentials:
      - "alice:alice"
      - "bob:bob"

Credentials should be added in format "username:password".

First of all build executable jar file with gradle:

./gradlew clean test bootJar

From the project folder '/docker' run the command:

docker compose up

Online store application will start on http://localhost:8080/store address.

Payment service will start on http://localhost:8081/payment.

To add products to the showcase, you can use the admin panel which will be available on start page after logging in as with admin rights.

To add credits on wallet POST request to http://localhost:8081/payment/add (this url is not secured for test reason). Body example:

{
  "username": "alice",
  "creditsAmount": 10000
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published