A Flask-based web application for handling college-related queries with RAG (Retrieval-Augmented Generation) implementation.
-
User Authentication System
- Email-based registration with OTP verification
- Secure login with password hashing
- Session management with 2-hour lifetime
-
Query Processing
- RAG-based query answering system
- Daily query limit tracking (50 queries per user)
- Special privileges for admin users
-
Security
- Password validation requirements
- Email domain restriction (@vvit.net)
- OTP expiration after 10 minutes
-
MongoDB Integration
- User management
- Query tracking
- OTP storage and verification
-
Email Integration
- OTP delivery system
- Gemini 1.5 Flash model integration
- Automated email notifications
- Python 3.x
- MongoDB
- Gmail account for sending emails
- Required Python packages (see Installation)
Create a .env
file with the following variables:
SECRET_KEY=your_secret_key
MONGO_URI=your_mongodb_connection_string
APP_PASSWORD_GMAIL=your_gmail_app_password
EMAIL_SENDER_ADDRESS=your_sender_email
-
Clone the repository
git clone https://github.com/Epik-Whale463/College_Query_System.git cd College_Query_System
-
Install required packages
pip install -r requirements.txt
-
Set up MongoDB
- Create a MongoDB database named 'csm_agent'
- Configure the following collections:
- users
- queries
- otps
-
Initialize the RAG system
- Place your data files in the
./data
directory - System will automatically initialize on startup
- Place your data files in the
-
Start the server
python app.py
-
Access the application
- Open a web browser and navigate to
http://localhost:8080
- Default port is 8080, can be modified via PORT environment variable
- Open a web browser and navigate to
-
Authentication
POST /register
- User registrationPOST /login
- User loginGET /logout
- User logout
-
Query System
POST /query
- Submit a queryGET /query-count
- Get daily query usage
-
User Management
GET /user_info
- Get user informationGET /healthz
- System health check
-
Password Requirements
- Minimum 8 characters
- At least one uppercase letter
- At least one number
-
Email Verification
- 6-digit OTP system
- 10-minute OTP validity
- Domain restriction to @vvit.net
- Custom error pages for 404 and 500 errors
- Comprehensive logging system
- User-friendly flash messages
- 50 queries per user per day
- Exception for admin users ([email protected])
- Query count resets daily
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
For support, email [email protected] or create an issue in the repository.