A modern web application for reporting and finding lost items with real-time Firebase integration and location-based matching.
- 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
- Node.js (v14 or higher)
- Firebase project with Firestore enabled
- Firebase service account key
-
Clone the repository
git clone <your-repo-url> cd global-lost-found-backend
-
Install dependencies
npm install cd backend && npm install
-
Configure Firebase
- Place your Firebase service account key as
serviceAccountKey.json.jsonin the root directory - Update
backend/.envwith 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
- Place your Firebase service account key as
-
Start the application
npm run dev
This will start:
- Backend server on
http://localhost:3000 - Frontend server on
http://localhost:3001
- Backend server on
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
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
GET /api/items/all- Retrieve all itemsPOST /report-item- Submit a new lost/found item reportGET /api/items/nearby?lat={lat}&lng={lng}&radius={radius}- Find items near location
GET /health- Server health status
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
- Create a Firebase project at Firebase Console
- Enable Firestore Database
- Generate a service account key
- Update the configuration files with your project details
Copy backend/.env.example to backend/.env and fill in your Firebase credentials.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the browser console for JavaScript errors
- Verify Firebase configuration
- Ensure both servers are running
- Check the API endpoints are responding
Made with ❤️ for helping people find their lost items