Skip to content

sudeepSubedi01/LostFound-DBMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lost and Found Management System

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.

Features

Core Functionality

  • 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

User Roles

  • 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

Smart Features

  • 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

Technology Stack

  • Backend: Flask (Python)
  • Database: MySQL
  • ORM: SQLAlchemy
  • Frontend: HTML5, CSS3, JavaScript
  • UI Framework: Bootstrap 5
  • Icons: Font Awesome
  • Server: XAMPP (Apache + MySQL)

Database Schema

The system uses 6 main tables:

  1. Users - Store user information and authentication details
  2. Categories - Item categories for classification
  3. Locations - Campus locations where items are lost/found
  4. Items - Core table storing all lost and found items
  5. Matches - Auto-generated matches between lost and found items
  6. Claims - User claims for items with approval workflow

Installation and Setup

Prerequisites

  1. XAMPP: Download and install from https://www.apachefriends.org/
  2. Python 3.7+: Download from https://python.org
  3. Git: For cloning the repository

Step 1: Setup XAMPP

  1. Start XAMPP Control Panel
  2. Start Apache and MySQL services
  3. Open phpMyAdmin at http://localhost/phpmyadmin
  4. Create a new database named lost_found_db

Step 2: Clone and Setup Project

# 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

Step 3: Configure Database

  1. Open config.py
  2. Verify MySQL connection settings:
    MYSQL_HOST = 'localhost'
    MYSQL_USER = 'root'  # Default XAMPP username
    MYSQL_PASSWORD = ''  # Default XAMPP password (empty)
    MYSQL_DATABASE = 'lost_found_db'

Step 4: Run the Application

python app.py

The 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

Default Login Credentials

Admin Account

Student Account

Project Structure

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/

Usage Guide

For Students/Staff/Faculty

  1. Register: Create an account with your details
  2. Login: Use your User ID and password to access the system
  3. Report Items:
    • Click "Report Item" to report lost or found items
    • Provide detailed descriptions for better matching
  4. Search Items: Use the search feature to find items by name, category, or location
  5. View Matches: Check the "Matches" section for potential matches to your lost items
  6. Claim Items: Click "Claim Item" on found items that belong to you
  7. Track Progress: Monitor your reported items and claims in "My Items"

For Administrators

  1. Login: Use admin credentials to access admin features
  2. Dashboard: View system statistics and recent activity
  3. Manage Claims: Review and approve/reject user claims
  4. Monitor System: Track system usage and user activity
  5. User Management: View registered users and their activities

API Endpoints

Authentication

  • GET /login - Login page
  • POST /login - Process login
  • GET /logout - Logout user
  • GET /register - Registration page
  • POST /register - Process registration

Items Management

  • GET / - Dashboard
  • GET /search - Search items
  • GET /report_item - Report item form
  • POST /report_item - Process item reporting
  • GET /item/<id> - Item details
  • GET /my_items - User's items

Claims and Matches

  • POST /claim_item/<id> - Claim an item
  • GET /matches - View potential matches
  • GET /manage_claims - Admin claims management
  • GET /approve_claim/<id> - Approve claim (Admin)
  • GET /reject_claim/<id> - Reject claim (Admin)

Administration

  • GET /admin - Admin dashboard

Troubleshooting

Common Issues

  1. Database Connection Error

    • Ensure XAMPP MySQL service is running
    • Verify database name lost_found_db exists
    • Check MySQL credentials in config.py
  2. Import Error: No module named 'pymysql'

    pip install pymysql
  3. Port 5000 already in use

    • Change port in app.py: app.run(debug=True, port=5001)
  4. Tables not created

    • Delete database and restart the application
    • Check MySQL permissions

Database Reset

To reset the database:

  1. Open phpMyAdmin
  2. Drop the lost_found_db database
  3. Create a new lost_found_db database
  4. Restart the Flask application

Security Notes

⚠️ Important: This is a demo application with basic security:

  • 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

Future Enhancements

  • 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

About

DBMS Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published