How vikasrajputin/springboot-react-docker-chatbot works
Main Components
• Backend: Represented by the Spring Boot application (spring-boot-ai-chatbot) which includes:
– Core Spring Boot logic and controllers (e.g., ChatController.java).
– Configuration and integration with Spring AI and the OpenAI API.
– REST API endpoints (such as GET /ai/chat/string and POST /ai/chat) that process user queries.
• Frontend: Represented by the React application (chatbot-ui) which includes:
– UI components (e.g., Chatbot.js, App.js) for displaying the user interface.
– Interactions with the backend API via HTTP calls (using Axios).
– Assets and styling under public and src directories.
• Containerization & Orchestration:
– Dockerfiles in both project directories.
– docker-compose.yaml that brings together the backend and frontend containers to easily deploy and run the full application.
Architectural Patterns & Design Principles
• Full-Stack Separation: Make clear distinctions between frontend and backend components.
• RESTful API: Emphasize the REST API endpoints serving as the main integration point between the UI and backend logic.
• Microservice/Container-Oriented Deployment: Illustrate how Docker is used to isolate and manage both the frontend and backend services.
• MVC (Backend): Optionally outline that the Spring Boot application uses a typical MVC structure where the controller handles API requests, the service layer processes business logic (integrating with Spring AI), and configuration files drive setup (via application.yaml).
Technologies, Frameworks, and Libraries
• For the backend: Java 17, Spring Boot, Spring AI, and Maven. Mention the configuration files (application.yaml) and key source code packages.
• For the frontend: React, HTML5, CSS3, and Axios for API communication.
• For DevOps/Deployment: Docker, Docker Compose (indicated by docker-compose.yaml), and optionally an Nginx instance if deployed behind a reverse proxy (as suggested by the README though not explicit in the file tree).