How raghav-sharma03/ai-chatbot-springboot works
NovaMind AI is a Spring Boot chatbot with a browser chat interface, session-aware conversation memory, and multiple AI-provider routes. A user submits a message through the UI to the REST endpoint; the controller calls the chat service, which selects a provider by message length and falls back to Ollama on provider failure. The response includes the session ID and timestamps. The README documents UI themes and structured errors as well. Provider wiring and memory setup are visible in AppConfig; exception-handler dispatch is implicit in the excerpts, so that relationship is marked unverified.
Main entry points: Chat_Controller.java Chat endpoint · ChatService.java Provider router · AppConfig.java AI configuration · index.html Chat UI
Components 14
Chat interface
- Chat UI
src/main/resources/static/index.html - Chat endpoint
src/main/java/project/chatbot/controller/Chat_Controller.java - Chat request
src/main/java/project/chatbot/controller/ChatRequest.java - Chat response
src/main/java/project/chatbot/controller/ChatResponse.java - Error handling
src/main/java/project/chatbot/exception/GlobalExceptionHandler.java - Error response
src/main/java/project/chatbot/exception/ErrorResponse.java
Conversation handling
- Provider router
src/main/java/project/chatbot/service/ChatService.java - Session memory
src/main/java/project/chatbot/AppConfig.java
AI providers
- Gemini
- OpenRouter
- Ollama
Runtime and state
- AI configuration
src/main/java/project/chatbot/AppConfig.java - Spring Boot app
src/main/java/project/chatbot/ChatbotApplication.java
Other components
- Chat user
Connections 15
- Chat user → Chat UI: uses
README.md - Chat UI → Chat endpoint: posts message
README.md - Chat endpoint → Chat request: accepts
src/main/java/project/chatbot/controller/Chat_Controller.java - Chat endpoint → Provider router: calls
src/main/java/project/chatbot/controller/Chat_Controller.java - Chat endpoint → Chat response: returns
src/main/java/project/chatbot/controller/Chat_Controller.java - Provider router → Session memory: uses session history
src/main/java/project/chatbot/service/ChatService.java - Provider router → Gemini: routes short messages
src/main/java/project/chatbot/service/ChatService.java - Provider router → OpenRouter: routes long messages
src/main/java/project/chatbot/service/ChatService.java - Provider router → Ollama: falls back
src/main/java/project/chatbot/service/ChatService.java - AI configuration → Session memory: configures
src/main/java/project/chatbot/AppConfig.java - AI configuration → Gemini: configures client
src/main/java/project/chatbot/AppConfig.java - AI configuration → OpenRouter: configures client
src/main/java/project/chatbot/AppConfig.java - AI configuration → Ollama: configures client
src/main/java/project/chatbot/AppConfig.java - Error handling → Error response: creates
src/main/java/project/chatbot/exception/GlobalExceptionHandler.java - Chat endpoint → Error handling: handles exceptions