diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 9ce6de0..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2025 Hsi-Teng Liu
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/README.md b/README.md
deleted file mode 100644
index 6667320..0000000
--- a/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# An AI Chatbot Concept
-A bank Chatbot concept utilizing LLM & RAG with API integrations
-
-1. Prompt engineering to classify intents of user messages from frontend UI.
-2. If transfering fund between the users account money, the LLM will go the authentication using an ID and password with function calling. If authentication is successful, we will use function calling or MCP to call the function and transfer fund in database.
-3. If the intent classification is unknown, the chatbot will escalate to a real agent (for this POC, just a text to represent the user is being transferred to a human agent).
-4. If it's identified as a FAQ, the LLM will provide answers using the RAG-based FAQ document (FAQ source from RBC website).
diff --git a/chatbot/README.md b/chatbot/README.md
new file mode 100644
index 0000000..3753a77
--- /dev/null
+++ b/chatbot/README.md
@@ -0,0 +1,119 @@
+
+# π¬ Grp7 Digital Banking Bot
+
+A web-based chatbot assistant that supports FAQ handling, intent detection, and secure banking actions (like deposit/withdraw) after authentication.
+
+---
+
+## π§© Tech Stack
+
+- **Frontend**: HTML, CSS, JavaScript
+- **Backend**: Python (Flask)
+- **LLM Integration**: Gemini API (planned)
+- **Authentication**: Username/Password (dummy login)
+- **Intent Detection**: Currently keyword-based, to be replaced with LLM or classifier
+
+---
+
+## π Project Structure
+
+```
+chatbot_project/
+β
+βββ app.py # Flask backend server
+βββ /templates
+β βββ chat.html # Chat UI with floating button and login modal
+β
+βββ /static
+β βββ style.css # Styling for chatbot and landing page
+β βββ script.js # JS for chat interaction and login popup
+β
+βββ README.md # Project info and team guidance
+```
+
+---
+
+## β
Features
+
+- Chatbot UI accessible via floating π€ button
+- Chat popup with message history and smart scroll
+- Login modal triggered **only when required** (e.g., for banking actions)
+- Dummy authentication: `username=admin`, `password=123`
+- Intent-aware chatbot backend (to be powered by Gemini)
+
+---
+
+## π§ API Endpoints Used by Frontend
+
+| Endpoint | Method | Description |
+|------------|--------|--------------------------------------|
+| `/chat` | POST | Handles user input, returns bot reply and intent |
+| `/auth` | POST | Authenticates user (dummy logic for now) |
+
+### Chat Request Format:
+```json
+{ "message": "I want to deposit money" }
+```
+
+### Chat Response Expected:
+```json
+{
+ "reply": "Please login to continue.",
+ "intent": "deposit"
+}
+```
+
+### Auth Request Format:
+```json
+{ "username": "admin", "password": "123" }
+```
+
+---
+
+## π¨βπ» Backend Team β Integration Guide
+
+### πΉ Replace Dummy Intent Detection
+
+In `app.py`:
+
+```python
+@app.route("/chat", methods=["POST"])
+def chat():
+ user_input = request.json.get("message")
+
+ # π½ Replace this with Gemini intent classifier
+ if "deposit" in user_input:
+ return jsonify({"reply": "Please login to continue.", "intent": "deposit"})
+```
+
+> π Return both `reply` and `intent`
+
+### πΉ Plug in Gemini API
+
+Use the Gemini API to:
+- Detect user intent
+- Generate a context-aware reply
+
+Then return both values to the frontend.
+
+---
+
+## π§ͺ Running the App Locally
+
+### 1. Install Flask (once)
+```bash
+pip install flask
+```
+
+### 2. Start the server
+```bash
+python app.py
+```
+
+### 3. Visit the app
+Open browser: [http://127.0.0.1:5000](http://127.0.0.1:5000)
+
+---
+
+## π Front-End Contact: Bikash
+Handles HTML, CSS, JS, and integration layout.
diff --git a/chatbot/app.py b/chatbot/app.py
new file mode 100644
index 0000000..f2b9259
--- /dev/null
+++ b/chatbot/app.py
@@ -0,0 +1,71 @@
+import os
+from flask import Flask, render_template, request, jsonify, abort
+import jwt
+from datetime import datetime, timedelta
+from database import auth_user, init_db
+
+# Initialize Flask app pointing to local templates/ and static/
+app = Flask(__name__, template_folder="templates", static_folder="static")
+
+# JWT configuration
+SECRET_KEY = os.getenv("SECRET_KEY", "your_secret_key")
+ALGORITHM = "HS256"
+ACCESS_TOKEN_EXPIRE_MINUTES = 15
+
+
+# Helpers for JWT
+def create_access_token(username: str) -> str:
+ expire = datetime.utcnow() + timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
+ payload = {"sub": username, "exp": expire}
+ return jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM)
+
+
+def verify_access_token(token: str) -> str:
+ try:
+ payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
+ user = payload.get("sub")
+ if not user:
+ abort(401, "Invalid token payload")
+ return user
+ except jwt.ExpiredSignatureError:
+ abort(401, "Token has expired")
+ except jwt.InvalidTokenError:
+ abort(401, "Invalid token")
+
+# Routes
+@app.route("/", methods=["GET"])
+def index():
+ return render_template("chat.html")
+
+@app.route("/auth/login", methods=["POST"])
+def auth_login():
+ data = request.get_json() or {}
+ username = data.get("username")
+ password = data.get("password")
+ if not username or not password:
+ abort(400, 'Missing "username" or "password"')
+
+ # Validate against real database
+ if not auth_user(username, password):
+ return jsonify({"status": "fail"}), 401
+
+ token = create_access_token(username)
+ return jsonify({"status": "success", "access_token": token, "token_type": "bearer"}), 200
+
+@app.route("/chat", methods=["POST"])
+def chat():
+ auth_header = request.headers.get("Authorization", "")
+ if not auth_header.startswith("Bearer "):
+ return jsonify({"reply": "π Please login to continue."}), 401
+ token = auth_header.split(" ", 1)[1]
+ user = verify_access_token(token)
+
+ msg = request.json.get("message", "")
+ if "transfer" in msg.lower():
+ return jsonify({"reply": f"π Transfer flow would run here for {user}."})
+ if "faq" in msg.lower():
+ return jsonify({"reply": "Hereβs an FAQ answer stub."})
+ return jsonify({"reply": "You are being transferred to a human agent."})
+
+if __name__ == "__main__":
+ app.run(host="0.0.0.0", port=5000, debug=True)
diff --git a/chatbot/static/script.js b/chatbot/static/script.js
new file mode 100644
index 0000000..55e1eac
--- /dev/null
+++ b/chatbot/static/script.js
@@ -0,0 +1,47 @@
+let accessToken = null;
+
+async function submitLogin() {
+ const username = document.getElementById("username").value;
+ const password = document.getElementById("password").value;
+
+ const res = await fetch("/auth/login", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ username, password })
+ });
+
+ const data = await res.json();
+ if (res.ok && data.status === "success") {
+ accessToken = data.access_token;
+ document.getElementById("login-modal").style.display = "none";
+ appendMessage("System", "β
Login successful! You can now proceed.");
+ } else {
+ appendMessage("System", "β Login failed. Try again.");
+ }
+}
+
+async function sendMessage() {
+ const input = document.getElementById("message");
+ const message = input.value.trim();
+ if (!message) return;
+ input.value = "";
+ appendMessage("You", message);
+
+ if (!accessToken) {
+ appendMessage("System", "π Please login to continue.");
+ document.getElementById("login-modal").style.display = "flex";
+ return;
+ }
+
+ const res = await fetch("/chat", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ "Authorization": `Bearer ${accessToken}`
+ },
+ body: JSON.stringify({ message })
+ });
+
+ const data = await res.json();
+ appendMessage("Bot", data.reply);
+}
\ No newline at end of file
diff --git a/chatbot/static/style.css b/chatbot/static/style.css
new file mode 100644
index 0000000..6a33756
--- /dev/null
+++ b/chatbot/static/style.css
@@ -0,0 +1,154 @@
+body {
+ font-family: 'Segoe UI', sans-serif;
+ background: #f5f5f5;
+ margin: 0;
+ padding: 0;
+ }
+
+ /* Floating button */
+ #chat-toggle {
+ position: fixed;
+ bottom: 20px;
+ right: 20px;
+ background-color: #007bff;
+ color: white;
+ border-radius: 50%;
+ width: 60px;
+ height: 60px;
+ font-size: 28px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+ box-shadow: 0 4px 10px rgba(0,0,0,0.3);
+ z-index: 1000;
+ }
+
+ /* Chat popup window */
+ .chat-popup {
+ display: none;
+ flex-direction: column;
+ position: fixed;
+ bottom: 100px;
+ right: 20px;
+ width: 350px;
+ height: 450px;
+ background: white;
+ border-radius: 12px;
+ box-shadow: 0 6px 20px rgba(0,0,0,0.3);
+ overflow: hidden;
+ z-index: 999;
+ }
+
+ .chat-header {
+ background: #007bff;
+ color: white;
+ padding: 12px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .chat-header h3 {
+ margin: 0;
+ font-size: 16px;
+ }
+
+ .chat-box {
+ flex-grow: 1;
+ padding: 15px;
+ overflow-y: auto;
+ font-size: 14px;
+ background-color: #f9f9f9;
+ }
+
+ .input-area {
+ display: flex;
+ border-top: 1px solid #ddd;
+ }
+
+ .input-area input {
+ flex: 1;
+ padding: 12px;
+ border: none;
+ font-size: 14px;
+ }
+
+ .input-area button {
+ background: #007bff;
+ border: none;
+ padding: 12px 16px;
+ color: white;
+ font-size: 14px;
+ cursor: pointer;
+ }
+
+ /* Login Modal */
+ .modal {
+ display: none;
+ position: fixed;
+ top: 0; left: 0;
+ width: 100%; height: 100%;
+ background-color: rgba(0, 0, 0, 0.6);
+ justify-content: center;
+ align-items: center;
+ z-index: 2000;
+ }
+
+ .modal-content {
+ background: white;
+ padding: 30px;
+ border-radius: 8px;
+ text-align: center;
+ min-width: 300px;
+ }
+
+ .modal-content input {
+ width: 90%;
+ padding: 10px;
+ margin: 10px 0;
+ }
+
+ .modal-content button {
+ padding: 10px 20px;
+ background: #007bff;
+ color: white;
+ border: none;
+ cursor: pointer;
+ }
+
+ /* Homepage Welcome Content */
+.homepage-content {
+ text-align: center;
+ margin: 60px auto 100px;
+ max-width: 700px;
+ padding: 20px;
+ background: #fff;
+ border-radius: 12px;
+ box-shadow: 0 6px 20px rgba(0,0,0,0.05);
+ }
+
+ .homepage-content h1 {
+ color: #007bff;
+ font-size: 2em;
+ }
+
+ .homepage-content p {
+ color: #555;
+ font-size: 1.1em;
+ margin-top: 10px;
+ }
+
+ .homepage-content ul {
+ margin-top: 20px;
+ text-align: left;
+ display: inline-block;
+ color: #333;
+ }
+
+ .homepage-content ul li {
+ margin-bottom: 10px;
+ font-size: 1em;
+ }
+
+
\ No newline at end of file
diff --git a/chatbot/templates/chat.html b/chatbot/templates/chat.html
new file mode 100644
index 0000000..9b24db7
--- /dev/null
+++ b/chatbot/templates/chat.html
@@ -0,0 +1,52 @@
+
+
+
+
+ GRP7 Digital Banking Bot
+
+
+
+
+
+
+
+
Welcome to GRP7 Digital Banking Bot
+
Need help with your banking? Talk to our GRP7 Banking Assistant β your 24/7 digital banking support system.
+
+ - Check FAQs instantly
+ - Securely log in to deposit or withdraw money
+ - Get friendly and helpful banking support
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+