Before you start, make sure you have the following tools and accounts:
- FDK CLI: A command-line interface for Fynd extensions.
- Java 14 or higher: Required to run and build the Java backend.
- Maven: A build tool for managing project dependencies and building the Java application.
- Redis: An in-memory data structure store used as a database, cache, and message broker.
- Initialize the template
$ fdk extension init --template java-react
- Start a preview in platform to open a tunnel to FCP (Fynd Commerce Platform)
$ fdk extension preview
- Build front-end files
# Using yarn
$ cd frontend && yarn run build
# Using npm
$ cd frontend && npm run build
- Run the application
$ mvn clean install
$ mvn spring-boot:run
You can visit the URL from preview
command or http://localhost:8080/ to check your extension.
To run the application using Docker, follow these steps:
# Build the Docker image
$ docker build -t my-java-react-app .
# Run the Docker container
$ docker run -p 8080:8080 my-java-react-app
Use the Below Controller to Test the Application :
-
HealthController : Uses the Actuator Health points to check if all the resources are stable and active
http://localhost:8080/_healthz