A demo retail website powered by Aerospike, showcasing Key-Value operations with a modern Spring Boot + React architecture.
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
- 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:
-
Download the kaggle fashion dataset
- Place the contents of the
/images/
directory in thedata/images/
directory. - Place the contents of the
/styles/
directory in thedata/styles/
directory.
- Place the contents of the
-
Building the Java application First, the
external_jars
must be installed into the local Mavencd 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>
-
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
-
Build the application:
cd spring-server mvn clean package -DskipTests
-
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 (defaultlocalhost
) 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
-
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`"
-
Point a browser at
localhost:8080
and you should be good to go!