A simple chat application with a Spring Boot backend and React frontend.
- Chat interface with a virtual assistant
- Real-time message display
- Error handling
- Responsive design for mobile and desktop
- Java 17
- Spring Boot 3.5.3
- LangChain4j with Google AI Gemini integration
- React 18
- Axios for API communication
- CSS for styling
ChatAPP/
├── src/
│ ├── main/
│ │ ├── frontend/ # React frontend
│ │ ├── java/ # Java backend
│ │ └── resources/ # Application properties
│ └── test/ # Test files
└── pom.xml # Maven configuration
- Java 17 or higher
- Maven
- Node.js and npm (automatically installed by Maven during build)
- Google AI Gemini API key
Set the following environment variable:
GEMINI_API_KEY=your_gemini_api_key
mvn clean installThis will:
- Compile the Java code
- Install Node.js and npm
- Install frontend dependencies
- Build the React frontend
- Package everything into a single JAR file
java -jar target/ChatAPP-0.0.1-SNAPSHOT.jarOr using Maven:
mvn spring-boot:runThe application will be available at http://localhost:8080
mvn spring-boot:runcd src/main/frontend
npm install
npm startThe development server will start at http://localhost:3000 and proxy API requests to the backend at http://localhost:8080.
GET /api/v1/assistant/chat?message=<message>- Send a message to the assistant and get a response