Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 Global Lost & Found System

A modern web application for reporting and finding lost items with real-time Firebase integration and location-based matching.

✨ Features

  • Report Lost Items: Submit detailed reports with descriptions, categories, and locations
  • Report Found Items: Help others by reporting items you've found
  • View All Items: Browse through all lost and found items with filtering options
  • Real-time Updates: Powered by Firebase Firestore for instant data synchronization
  • Location-based Matching: Find items near specific locations
  • Category Organization: Items organized by categories (Keys, Wallet, Electronics, etc.)
  • Responsive Design: Works seamlessly on desktop and mobile devices

🚀 Quick Start

Prerequisites

  • Node.js (v14 or higher)
  • Firebase project with Firestore enabled
  • Firebase service account key

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd global-lost-found-backend
  2. Install dependencies

    npm install
    cd backend && npm install
  3. Configure Firebase

    • Place your Firebase service account key as serviceAccountKey.json.json in the root directory
    • Update backend/.env with your Firebase project details:
    FIREBASE_PROJECT_ID=your-project-id
    FIREBASE_PRIVATE_KEY_ID=your-private-key-id
    FIREBASE_PRIVATE_KEY=your-private-key
    FIREBASE_CLIENT_EMAIL=your-client-email
    FIREBASE_CLIENT_ID=your-client-id
    FIREBASE_AUTH_URI=https://accounts.google.com/o/oauth2/auth
    FIREBASE_TOKEN_URI=https://oauth2.googleapis.com/token
  4. Start the application

    npm run dev

    This will start:

    • Backend server on http://localhost:3000
    • Frontend server on http://localhost:3001

📱 Usage

Main Interface

Visit http://localhost:3001 to access the main application where you can:

  • Report lost items using the "📢 Report Lost Item" button
  • Report found items using the "🎯 Report Found Item" button
  • View all items using the "📋 View All Items" link

List View

Access http://localhost:3001/list.html to:

  • Browse all reported items
  • Filter by status (All Items, Lost Items, Found Items)
  • View detailed information including categories, locations, and timestamps

🛠️ API Endpoints

Items

  • GET /api/items/all - Retrieve all items
  • POST /report-item - Submit a new lost/found item report
  • GET /api/items/nearby?lat={lat}&lng={lng}&radius={radius} - Find items near location

Health Check

  • GET /health - Server health status

📁 Project Structure

global-lost-found-backend/
├── backend/
│   ├── models/
│   │   └── firestoreSchema.js    # Database schema definitions
│   ├── middleware/
│   │   └── identityManager.js    # Authentication middleware
│   ├── src/
│   │   ├── models/
│   │   │   └── chatModel.js      # Chat functionality models
│   │   └── services/
│   │       └── imageService.js   # Image handling services
│   ├── server.js                 # Main backend server
│   ├── firebaseConfig.js         # Firebase configuration
│   └── package.json              # Backend dependencies
├── frontend/
│   ├── index.html                # Main application page
│   ├── list.html                 # Items list view
│   ├── simple.html               # Simplified interface
│   ├── app.js                    # Main application logic
│   ├── firebase-config.js        # Frontend Firebase config
│   └── styles.css                # Application styles
├── docs/                         # Documentation files
└── start-dev.js                  # Development server starter

🔧 Configuration

Firebase Setup

  1. Create a Firebase project at Firebase Console
  2. Enable Firestore Database
  3. Generate a service account key
  4. Update the configuration files with your project details

Environment Variables

Copy backend/.env.example to backend/.env and fill in your Firebase credentials.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

If you encounter any issues or have questions:

  1. Check the browser console for JavaScript errors
  2. Verify Firebase configuration
  3. Ensure both servers are running
  4. Check the API endpoints are responding

Made with ❤️ for helping people find their lost items

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages