Welcome! 🚀
*LUNG CANCER PREDICTOR* is a modern web application for predicting lung cancer risk based on user symptoms and medical history. Built with Flask and MySQL, featuring a beautiful glassmorphism UI design.
• 🔐 User Authentication
- Secure registration and login
- Password hashing
- Session management
- JWT token support
• 🎯 Risk Assessment
- Age and gender-based analysis
- Smoking status evaluation
- Symptom assessment
- Real-time risk score calculation
• 📊 Medical History
- Family history tracking
- Smoking history
- Previous lung diseases
- Occupational exposure
• 📱 Modern UI/UX
- Glassmorphism design
- Dark theme with red accents
- Responsive layout
- Interactive forms
- Real-time feedback
• 📈 Data Management
- Prediction history
- User feedback system
- Medical recommendations
- Symptom database
See the app in action!
Have you deployed or used this app? Contribute your own screenshots or GIFs!
Watch a quick walkthrough of the main features!

• Backend
- Python 3.12
- Flask 3.0.2
- MySQL 8.0
- Flask-Login
- Flask-Bcrypt
- PyJWT
• Frontend
- HTML5
- CSS3
- JavaScript
- Glassmorphism Design
• Database
- MySQL
- Stored Procedures
- Views
- Triggers
• Python 3.12 or higher • MySQL 8.0 or higher • pip (Python package manager)
1. Clone the repository bash git clone https://github.com/vansh070605/LUNG-CANCER-PREDICTOR.git cd LUNG-CANCER-PREDICTOR
2. Create and activate virtual environment bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
3. Install dependencies bash pip install -r requirements.txt
4. Set up the database bash mysql -u root -p < database/lung_cancer_db.sql
5. Configure environment variables Create a .env file in the root directory:
SECRET_KEY=your-secret-key JWT_SECRET_KEY=your-jwt-secret-key DB_PASSWORD=your-mysql-password
6. Run the application bash python app.py
LUNG-CANCER-PREDICTOR/
├── app.py # Main Flask application
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── survey lung cancer.csv # Sample dataset
├── database/
│ └── lung_cancer_db.sql # MySQL database schema & procedures
├── model/
│ ├── dummy_model.py # Placeholder for ML model code
│ └── model.pkl # (Optional) Trained model file
├── static/
│ └── styles.css # CSS styles
├── templates/
│ ├── base.html # Base template
│ ├── dashboard.html # User dashboard
│ ├── history.html # Prediction history
│ ├── index.html # Landing page
│ ├── intro.html # Introduction page
│ ├── login.html # Login form
│ ├── predict.html # Prediction form
│ ├── register.html # Registration form
│ └── result.html # Prediction result
└── .gitignore # Git ignore file
- User registration and login (with hashed passwords)
- Lung cancer risk prediction based on symptoms and history
- Prediction history and feedback
- Medical recommendations
- Concurrency control: Only one user can make a prediction at a time (global lock)
- Recovery mechanisms: Transaction logging, backup, and point-in-time recovery
- Modern, responsive UI
- Lock Management: Only one user can make a prediction at a time (global lock on
predictions
table). - Version Control: Prevents lost updates and supports optimistic concurrency.
- Transaction Log: All changes are logged for audit and recovery.
- Backup & Recovery: Daily backups and point-in-time recovery procedures.
- Deadlock Detection: Automatic cleanup of expired locks.
- Register a new user or log in.
- Navigate to the Predict page and fill out the form.
- If another user is already predicting, you will see an error message.
- View your prediction history and feedback.
This project is for educational purposes.
• Password hashing using Flask-Bcrypt • JWT token authentication • SQL injection prevention • Input validation • Session management • Protected routes
• Modern glassmorphism design • Dark theme with red accents • Responsive layout • Interactive forms • Real-time feedback • Animated transitions • Mobile-friendly design
• users: User information • medical_history: Medical background • predictions: Risk assessment results • user_predictions: User-prediction mapping • symptoms: Symptom database • recommendations: Medical advice • user_feedback: User feedback
1. Fork the repository 2. Create your feature branch ( git checkout -b feature/AmazingFeature ) 3. Commit your changes ( git commit -m 'Add some AmazingFeature' ) 4. Push to the branch ( git push origin feature/AmazingFeature ) 5. Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
• Vansh
• Hirav Kadikar
• Medical data sources • Open source community • Flask documentation • MySQL documentation
• GitHub Discussions • Report Issues • Contact Vansh on Twitter
*Give a ⭐️ if this project helped you!*
We appreciate your feedback and contributions!
Vansh - @vansh070605 Project Link: https://github.com/vansh070605/LUNG-CANCER-PREDICTOR