Skip to content

inxendere/conuhacks_x_01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lost and Found Matcher - Project Documentation

1. Project Overview

ClaimSafe is a secure, AI-powered web application designed to help users recover lost items while maintaining the privacy of found inventory. Submission for ConUHacks X SAP challenge.

Core Philosophy

  • Privacy First: The inventory of found items is hidden from the public to prevent fraudulent claims.
  • AI Assisted: A TF-IDF (Text Frequency-Inverse Document Frequency) algorithm matches user inquiries with inventory items to save assistant time.
  • Secure Handling: Only authorized assistants can view potential matches and approve them.

2. Technical Architecture

Frontend (/frontend)

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS (with custom CSS variables for theming)
  • UI Components:
    • Custom glassmorphism cards and inputs.
    • framer-motion for page transitions and micro-interactions.
    • lucide-react for iconography.
  • State Management: React Hooks (useState, useEffect) and URL search params for tracking.

Backend (/backend)

  • Framework: FastAPI (Python)
  • Database Driver: Motor (Async MongoDB)
  • Validation: Pydantic v2
  • AI/ML:
    • scikit-learn: Used for TF-IDF vectorization and cosine similarity calculations.
    • numpy: For vector operations.
    • gemini: For follow up conversational questions

Database

  • System: MongoDB (Atlas or Local)
  • Collections:
    • inventory: Stores found items with tags, location, and description.
    • inquiries: Stores user reports with status updates (submitted, matched, resolved).

3. Key Features

Public Features

  1. Landing Page: High-impact visual design explaining the service.
  2. Report Lost Item:
    • Detailed form with categorization.
    • Image upload capability (Frontend ready, backend stubbed).
    • Auto-generation of inquiry ID.
  3. Inquiry Tracking:
    • Users can track their item status using their Inquiry ID.
    • Shows real-time status updates (e.g., "Under Review", "Matched").

Assistant Features (Secure)

  1. Dashboard:
    • Incoming Inquiries: List of all user reports needing attention.
    • Inventory Management: View all hidden items.
  2. AI Matcher:
    • On-demand matching for specific inquiries.
    • Generates a Confidence Score (0-100%) based on text similarity (Description + Category + Tags).
  3. Review System:
    • Side-by-side comparison of Inquiry vs. Potential Matches.
    • "One-Click Match" to link items and notify the user (status update).

4. Setup & Installation

Prerequisites

  • Node.js (v18+)
  • Python (v3.10+)
  • MongoDB connection string

Step 1: Backend Setup

# From project root
python -m venv backend/venv
# Windows
backend\venv\Scripts\activate
# Mac/Linux
source backend/venv/bin/activate

# after the venv is activated, run
python -m pip install --upgrade pip setuptools wheel

# then install the requirements
pip install -r backend/requirements.txt

# Create .env file in backend/
echo "MONGODB_URL=your_connection_string" > backend/.env
# OR dump the .env file from the discord into the backend folder
# IF YOU'RE HAVING ISSUES, CONTACT A MEMBER OF THE TEAM TO GET ACCESS

# Seed Database (Optional)
python backend/seed_db.py

# Run Server (Must be run from project root)
uvicorn backend.main:app --reload

Step 2: Frontend Setup IN A DIFFERENT TERMINAL

cd frontend
npm install
npm run dev

5. API Documentation

Inquiries

  • POST /inquiries: Submit a new lost item inquiry.
  • GET /inquiries/{id}: Get inquiry details by ID.
  • GET /admin/inquiries?status={status}: List inquiries (optionally filtered by status).

Inventory

  • GET /items: List all found items (hidden inventory).
  • GET /items/{id}: Get specific item details.

Matching

  • POST /inquiries/{id}/match: Run the AI matcher for a specific inquiry. Returns a list of scored items.
  • POST /inquiries/{id}/approve: Link an inventory item to an inquiry and update status to matched.

6. Future Expansion & Roadmap

Phase 2: User Experience

  • Email/SMS Notifications: Integrate Twilio or SendGrid to notify users when a match is found, instead of them manually checking the tracking page.
  • Geospatial Search: Use MongoDB $near queries to filter matches by location (e.g., "lost in Building H" matches "found in Building H").

Phase 4: Scalability

  • Dockerization: Create Dockerfile and docker-compose.yml for easy deployment.
  • Cloud Storage: Integrate AWS S3 for storing user-uploaded images permanently.

7. Folder Structure

/
├── backend/
│   ├── main.py             # API Entry Point
│   ├── models.py           # Database Schemas (Pydantic)
│   ├── matching.py         # TF-IDF Logic
│   ├── database.py         # MongoDB Connection
│   ├── requirements.txt    # Python Dependencies
│   └── ...
├── frontend/
│   ├── src/app/
│   │   ├── page.tsx        # Landing Page
│   │   ├── report/         # Reporting Form
│   │   ├── track/          # Tracking Page
│   │   └── admin/          # Assistant Dashboard
│   ├── src/components/     # Reusable UI (Navbar, Cards)
│   └── ...
└── DOCUMENTATION.md        # This file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors