Leo is a smart, command-based WhatsApp-style chatbot backend built using Java, Spring Boot, and Firebase Firestore. It’s designed to demonstrate clean architecture, real-time data logging, and human-friendly bot interactions. Ideal for learning backend development, showcasing skills in interviews, or using as a base for advanced chatbot systems.
- ✅ REST API endpoint to receive and respond to messages
- ✅ Command-based smart reply system (like /hi, /help, /about, /time)
- ✅ Stores all messages securely in Firebase Firestore
- ✅ Professional and human-style responses
- ✅ Modular structure: Controller → Service → DTO
- ✅ Deployment-ready (tested on Render.com)
| Command | Description |
|---|---|
/hi or hi |
Greet the user and show available commands |
/help or help |
List all commands and what they do |
/about or about |
Information about the bot (Leo) |
/time or time |
Current server time (human-friendly) |
src/
└── main/
└── java/
└── com.leo.whatsappbot/
├── controller/
│ └── WebhookController.java
├── dto/
│ └── MessageDTO.java
├── service/
│ └── MessageService.java
└── config/
└── FirebaseConfig.java
└── resources/
└── application.properties
└── firebase-service-account.json (local only)
- Java 17
- Spring Boot 3.x
- Firebase Admin SDK
- Render Deployment
- Postman for testing
- GitHub for Version Control
Send a message to this endpoint using Postman or any client:
{
"from": "918888888888",
"message": "hi"
}Hey there! 👋 How can I assist you today?
- Create a Firebase project in Firebase Console
- Go to Project Settings > Service Accounts
- Generate a private key (JSON)
- Rename the file to:
firebase-service-account.json - Place it inside:
src/main/resources/
🔗 Live URL https://whatsapp-chatbot-b8pf.onrender.com/webhook
📦 GitHub Repository https://github.com/Sidhant2104/whatsapp-chatbot-backend.git
Build Command: ./mvnw clean install
Start Command: java -jar target/*.jar
Environment Variable: FIREBASE_CONFIG = <your_base64_encoded_firebase_service_account.json>
✅ Status: Live and tested
🧪 Tested Via: Postman (POST /webhook)
📨 Response: Verified replies to commands like /hi, /help, etc.Tried setting up WhatsApp Business Cloud API but account got disabled during Meta business review stage. Backend system remains functional & ready to integrate once account is restored.
Sidhant Singh (Leo)
Aspiring Backend Developer | Java | Spring Boot
📍 Ranchi, Jharkhand
🌐 GitHub Profile
🔗 LinkedIn