π¦ Bank Chatbot Project
A simple banking chatbot web application built using Flask and PostgreSQL. This project allows users to log in and interact with a chatbot for basic banking queries.
π How to Run This Project (Step-by-Step Guide)
π Follow these steps carefully β even if you are a beginner with no coding experience.
π§° 1οΈβ£ Install Required Software
Before running the project, install:
π Python (3.x)
ποΈ PostgreSQL
π Git (optional but recommended)
π₯ 2οΈβ£ Download the Project πΉOption 1: Download ZIP (Easy)
Click Code β Download ZIP
Extract the ZIP file
πΉOption 2: Using Git (Recommended) git clone https://github.com/yourusername/bank-chatbot.git π 3οΈβ£ Navigate to Project Folder
After extraction, you may see:
Bank-ChatBot-main/ βββ Bank-ChatBot-main/
π This is normal!
β
Go inside the inner folder:
cd Bank-ChatBot-main
cd Bank-ChatBot-main
β Error:
can't open file 'app.py'
βοΈ Solution: π You were in the wrong folder π Move inside the correct folder where app.py exists
π 4οΈβ£ Folder Structure (VERY IMPORTANT)
Make sure your project looks like this:
bank-chatbot/ βββ app.py βββ templates/ β βββ login.html β βββ chatbot.html β βββ admin.html β βββ dashboard.html
β If templates folder is missing β app will NOT run
π¦ 5οΈβ£ Install Python Libraries
Open Command Prompt in project folder and run:
pip install flask psycopg2-binary
ποΈ 6οΈβ£ Setup PostgreSQL Database
Open pgAdmin and run the following:
β
Create Database
CREATE DATABASE bankdb;
β
Create Table
CREATE TABLE users(
id SERIAL PRIMARY KEY,
username TEXT,
password TEXT
);
β
Insert Test User
INSERT INTO users(username,password)
VALUES('admin','admin');
In app.py, check this:
password="postgres"
π If your PostgreSQL password is different, change it accordingly.
In terminal:
python app.py
You will see:
Running on http://127.0.0.1:5000 π 8οΈβ£ Open in Browser
Go to:
http://127.0.0.1:5000 π Login Credentials Username: admin Password: admin π¬ 9οΈβ£ How to Use
After login:
Click π¬ chatbot button
Try typing:
hello
balance
loan
credit card
βοΈ Make sure HTML files are inside templates folder
β Database Connection Error
βοΈ Check:
PostgreSQL is running
Database name = bankdb
Password is correct
β psycopg2 Error
βοΈ Run:
pip install psycopg2-binary
π§ Project Notes
This chatbot is rule-based (not AI)
Uses Flask for backend
Uses PostgreSQL for database
Frontend built using HTML + CSS
π Future Improvements
π€ Add AI chatbot (OpenAI API)
ποΈ Replace PostgreSQL with SQLite (easier setup)
π¨ Improve UI design
π Deploy online