A Spring Boot + React chatbot application with gamification features for helping employees stay updated with technology advancements.
- 🤖 AI Chatbot: Powered by Ollama (llama2) running locally
- 💬 Chat History: Full conversation history tracking
- 🎮 Gamification: Points, levels, and achievements system
- 🔒 Privacy-First: All data stays local with Ollama
- 📚 RAG Ready: Architecture prepared for Retrieval-Augmented Generation
- Spring Boot 3.2.0
- Java 17
- H2 Database (in-memory, easily switchable to PostgreSQL)
- WebFlux for Ollama API calls
- JPA/Hibernate
- Ollama (llama2:latest)
- RAG architecture (ready for implementation)
- Java 17 or higher
- Maven 3.6+
- Docker (for Ollama)
- Ollama container running:
docker start fullstackollama
# Your container is already set up
docker start fullstackollama
# Verify it's running
curl http://localhost:11434/api/tags# From the project root directory
mvn clean install
mvn spring-boot:runThe backend will start on http://localhost:8080
- URL:
http://localhost:8080/h2-console - JDBC URL:
jdbc:h2:mem:chatbotdb - Username:
sa - Password: (leave empty)
POST /api/chat/message- Send a message to the chatbotGET /api/chat/history/{userId}- Get full chat historyGET /api/chat/history/{userId}/recent- Get recent messages
GET /api/users- Get all usersGET /api/users/{id}- Get user by IDPOST /api/users- Create new userPOST /api/users/{id}/login- Record user login
GET /api/gamification/users/{userId}/achievements- Get user achievementsGET /api/gamification/users/{userId}/stats- Get user statsGET /api/gamification/leaderboard- Get top 10 users
curl -X POST http://localhost:8080/api/users \
-H "Content-Type: application/json" \
-d '{
"username": "john.doe",
"email": "john@company.com",
"password": "password123",
"fullName": "John Doe",
"department": "Engineering"
}'curl -X POST http://localhost:8080/api/chat/message \
-H "Content-Type: application/json" \
-d '{
"userId": 1,
"message": "What is Spring Boot?"
}'- 10 points per message sent
- Level up every 100 points
- Achievement completion awards bonus points
- 🌟 First Steps (1 message)
- 💬 Conversationalist (50 messages)
- 🎓 Expert Learner (100 messages)
- ⭐ Point Master (500 points)
- 🚀 Rising Star (Level 5)
- 👨💻 Tech Guru (Level 10)
The architecture is ready for RAG. To implement:
- Choose a vector database (Chroma, Weaviate, Qdrant)
- Add embedding model (sentence-transformers)
- Implement document chunking and indexing
- Complete the
getContextForQuery()method inChatService.java
Update application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/chatbot
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialectsrc/main/java/com/company/chatbot/
├── config/ # Configuration classes
├── controller/ # REST controllers
├── dto/ # Data Transfer Objects
├── entity/ # JPA entities
├── repository/ # Data repositories
└── service/ # Business logic
- ✅ Set up React frontend
- ⬜ Implement RAG with vector database
- ⬜ Add user authentication (Spring Security)
- ⬜ Add WebSocket for real-time chat
- ⬜ Deploy to production
# Check if container is running
docker ps | grep fullstackollama
# Restart if needed
docker restart fullstackollamaChange the port in application.properties:
server.port=8081MIT