A comprehensive web-based Lost and Found Management System built with Flask and MySQL, designed for educational institutions to help students, staff, and faculty report and find lost items efficiently.
- User Authentication: Secure login system with role-based access (Student, Staff, Faculty, Admin)
- Item Reporting: Users can report both lost and found items with detailed descriptions
- Advanced Search: Comprehensive search functionality with filters for category, location, and item type
- Intelligent Matching: Automatic matching system between lost and found items based on similarity scores
- Claims Management: Users can claim items with admin approval workflow
- Dashboard: Real-time statistics and recent activity overview
- Students/Staff/Faculty: Can report items, search, claim items, and view their matches
- Admin: Full system access including user management, claims approval, and system statistics
- Auto-Matching Algorithm: Calculates match scores based on:
- Category similarity (40% weight)
- Location similarity (30% weight)
- Name similarity (20% weight)
- Description similarity (10% weight)
- Real-time Notifications: Users get notified of potential matches for their lost items
- Comprehensive Categories: Electronics, Clothing, Books, Accessories, Sports Equipment, Personal Items, Documents
- Multiple Locations: Library, Cafeteria, Gym, Parking Lot, Classroom Buildings, Student Center
- Backend: Flask (Python)
- Database: MySQL
- ORM: SQLAlchemy
- Frontend: HTML5, CSS3, JavaScript
- UI Framework: Bootstrap 5
- Icons: Font Awesome
- Server: XAMPP (Apache + MySQL)
The system uses 6 main tables:
- Users - Store user information and authentication details
- Categories - Item categories for classification
- Locations - Campus locations where items are lost/found
- Items - Core table storing all lost and found items
- Matches - Auto-generated matches between lost and found items
- Claims - User claims for items with approval workflow
- XAMPP: Download and install from https://www.apachefriends.org/
- Python 3.7+: Download from https://python.org
- Git: For cloning the repository
- Start XAMPP Control Panel
- Start Apache and MySQL services
- Open phpMyAdmin at
http://localhost/phpmyadmin - Create a new database named
lost_found_db
# Clone the repository
git clone <repository-url>
cd lost_found_system
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install required packages
pip install -r requirements.txt- Open
config.py - Verify MySQL connection settings:
MYSQL_HOST = 'localhost' MYSQL_USER = 'root' # Default XAMPP username MYSQL_PASSWORD = '' # Default XAMPP password (empty) MYSQL_DATABASE = 'lost_found_db'
python app.pyThe application will:
- Create all database tables automatically
- Insert default categories and locations
- Create default admin and student users
- Start the web server at
http://localhost:5000
- User ID: 1
- Password: admin123
- Email: [email protected]
- User ID: 2
- Password: student123
- Email: [email protected]
lost_found_system/
│
├── app.py # Main Flask application
├── config.py # Database and app configuration
├── requirements.txt # Python dependencies
├── README.md # This file
│
├── templates/ # HTML templates
│ ├── base.html # Base template with navigation
│ ├── index.html # Dashboard
│ ├── login.html # Login page
│ ├── register.html # User registration
│ ├── search.html # Item search interface
│ ├── report_item.html # Report lost/found items
│ ├── item_detail.html # Individual item details
│ ├── my_items.html # User's reported items
│ ├── matches.html # Potential matches
│ ├── manage_claims.html # Admin claims management
│ └── admin_dashboard.html # Admin statistics
│
└── static/ # Static files (optional)
├── css/
├── js/
└── images/
- Register: Create an account with your details
- Login: Use your User ID and password to access the system
- Report Items:
- Click "Report Item" to report lost or found items
- Provide detailed descriptions for better matching
- Search Items: Use the search feature to find items by name, category, or location
- View Matches: Check the "Matches" section for potential matches to your lost items
- Claim Items: Click "Claim Item" on found items that belong to you
- Track Progress: Monitor your reported items and claims in "My Items"
- Login: Use admin credentials to access admin features
- Dashboard: View system statistics and recent activity
- Manage Claims: Review and approve/reject user claims
- Monitor System: Track system usage and user activity
- User Management: View registered users and their activities
GET /login- Login pagePOST /login- Process loginGET /logout- Logout userGET /register- Registration pagePOST /register- Process registration
GET /- DashboardGET /search- Search itemsGET /report_item- Report item formPOST /report_item- Process item reportingGET /item/<id>- Item detailsGET /my_items- User's items
POST /claim_item/<id>- Claim an itemGET /matches- View potential matchesGET /manage_claims- Admin claims managementGET /approve_claim/<id>- Approve claim (Admin)GET /reject_claim/<id>- Reject claim (Admin)
GET /admin- Admin dashboard
-
Database Connection Error
- Ensure XAMPP MySQL service is running
- Verify database name
lost_found_dbexists - Check MySQL credentials in
config.py
-
Import Error: No module named 'pymysql'
pip install pymysql
-
Port 5000 already in use
- Change port in
app.py:app.run(debug=True, port=5001)
- Change port in
-
Tables not created
- Delete database and restart the application
- Check MySQL permissions
To reset the database:
- Open phpMyAdmin
- Drop the
lost_found_dbdatabase - Create a new
lost_found_dbdatabase - Restart the Flask application
- Passwords are stored in plain text (not recommended for production)
- No CSRF protection implemented
- Basic input validation only
For production use, implement:
- Password hashing (bcrypt/scrypt)
- CSRF protection
- Input sanitization
- SQL injection protection
- User session management
- Rate limiting
- Email notifications for matches and claims
- File upload for item images
- Mobile responsive design improvements
- REST API for mobile app integration
- Advanced reporting and analytics
- Bulk import/export functionality
- Multi-language support
- Integration with campus ID systems