A simple Flask backend with MongoDB integration for managing club data.
-
Clone the repository
git clone https://github.com/sailalithkanumuri8/gt_chatbot_backend.git cd gt_chatbot_backend -
Create virtual environment
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install flask pymongo python-dotenv pandas
-
Create
.envfileecho "MONGODB_CLIENT=your_mongodb_connection_string_here" > .env
-
Upload data to MongoDB
python upload_clubs.py
-
Start the Flask server
python hello.py
-
Test the API
- Get all clubs:
http://localhost:8001/clubs - Get specific club:
http://localhost:8001/clubs/Finance%20Association
- Get all clubs:
GET /clubs- Returns all clubsGET /clubs/<club_name>- Returns clubs matching the name (case-insensitive)
hello.py- Flask application with API endpointsupload_clubs.py- Script to upload CSV data to MongoDBsample_clubs.csv- Sample club data.env- MongoDB connection string (create this file)