Skip to content

aerospike-examples/aerospike-fluent-client-workshop

Repository files navigation

Aerospike Retail Demo

A demo retail website powered by Aerospike, showcasing Key-Value operations with a modern Spring Boot + React architecture.

Project Structure

retail-demo/
├── spring-server/          # Spring Boot backend (Java 21)
├── website/                # React frontend (Vite)
├── external_jars/          # External JAR files (tracked in Git)
├── data/                   # Sample data files
├── config/                 # Configuration files
  ├── aerospike/              # Aerospike configuration
└── .gitignore              # Multi-module gitignore

Technologies

  • Backend: Spring Boot 3.2, Java 21, Aerospike Client 9.1.0
  • Frontend: React 18, Vite 5, React Router DOM
  • Database: Aerospike (Key-Value operations, Secondary Indexes)
  • Build: Maven (Java), npm/yarn (React)

To run locally:

  1. Download the kaggle fashion dataset

    1. Place the contents of the /images/ directory in the data/images/ directory.
    2. Place the contents of the /styles/ directory in the data/styles/ directory.
  2. Building the Java application First, the external_jars must be installed into the local Maven

    cd external_jars
    ./registerJars.sh

    Note: if you encounter issues using the jar you can reference the JAR file directly from the pow.xml

    <!-- Fluent Aerospike Java Client -->
    <dependency>
        <groupId>com.aerospike</groupId>
        <artifactId>aerospike-fluent-client</artifactId>
        <version>${aerospike-fluent.version}</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/../external_jars/aerospike-fluent-client-0.8.0-jar-with-dependencies.jar</systemPath>
    </dependency>
  3. OPTIONAL Building the front end (should be built by default, so only do this step if /spring-server/src/main/resources/static/index.html does not exist)

    cd website
    npm install
    npm run build
  4. Build the application:

    cd spring-server
    mvn clean package -DskipTests
  5. Run the application Once this is done, start the Java application against your database (ensure you're still in the spring-server directory)

    java -jar target/retail-demo-spring-1.0.0.jar

    If you have Aerospike running on a different port (default 3000) or host (default localhost) then you can specify these arguments:

    java -jar target/retail-demo-spring-1.0.0.jar --aerospike.host=10.0.0.1 --aerospike.port=3100
  6. Create the indexes and load the product data into Aerospike:

    cd data
    curl -X POST "http://localhost:8080/rest/v1/data/create-indexes"
    curl -X POST "http://localhost:8080/rest/v1/data/load?dataPath=`pwd`"
    
  7. Point a browser at localhost:8080 and you should be good to go!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •