The Frontend Service is a ReactJS-based application that allows users to submit queries, receive AI-generated content, and view similar products. The user must log in before interacting with the chat interface.
- Node.js
- React
- Clone the repository:
git clone https://github.com/Azure-Samples/Java-AI-Based-Content-Generator cd Java-AI-Based-Content-Generator/frontend - Create the
.envfile:- In the root directory of the project, there is a
.env.examplefile that contains placeholder values for environment variables. - Copy this file to create your own
.envfile:
cp .env.example .env
- In the root directory of the project, there is a
- Replace Placeholder Values:
- Open the newly created
.envfile and replace the placeholder values with the correct values for your local setup. - For example:
REACT_APP_SERVICE_BASE_URL=http://localhost:8081 REACT_APP_CLIENT_ID=<your-azure-app-client-id> REACT_APP_CONTENT_GENERATOR_ENDPOINT=/api/v1/generate/content REACT_APP_SERVICE_ACCESS_KEY=<service-access-key> # Not needed for local setup
- Open the newly created
- Install dependencies:
npm install
- Run the application:
- After setting up the environment variables, you can start the development server using:
npm start
- For Azure App Service deployment, see app_service.md.
- For AKS deployment, see aks.md.