Skip to content

✨ SpotHole helps users report potholes with ease. Capture images, tag locations, and share reports on Twitter to raise awareness. Track all submissions via a simple dashboard. Built with Node.js, this app empowers communities to improve road safety. Open for contributions! ✨

License

Notifications You must be signed in to change notification settings

alienx5499/Pot-Hole-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Pot Hole Detector 🌟

Empowering citizens to report potholes and raise awareness

Build Passing Node.js Contributions Welcome License: MIT Platform Twitter Integration Views ⭐ GitHub stars 🍴 GitHub forks Commits 🐛 GitHub issues 📂 GitHub pull requests 💾 GitHub code size


📱 What is Pot Hole Detector?

The Pot Hole Detector is a web application built using Node.js that enables users to:

  • Capture and report potholes with precise location tagging.
  • Automatically share pothole information on Twitter to raise awareness.
  • Keep track of reported potholes in a user-friendly dashboard.

"Drive change by reporting potholes to ensure safer roads for everyone!"


📚 Table of Contents

  1. ✨ Features
  2. 🦾 Tech Stack
  3. 📸 Screenshots
  4. 🧩 Try the App
  5. 👨‍🔧 Setup Instructions
  6. 📍 API Endpoints
  7. 🚨 Resource Warning
  8. 🎯 Target Audience
  9. 🤝 Contributing
  10. 🌟 Awesome Contributors
  11. 📜 License
  12. 📬 Feedback & Suggestions

✨ Features

Image Capture

  • Capture clear images of potholes through user uploads.
  • Image Clarity Verification: Prompt users for a re-upload if the image is blurry or unclear.

Location Tagging

  • GPS Auto-Tagging: Automatically fetch and tag the pothole's GPS coordinates.
  • Address Conversion: Convert coordinates into readable addresses using a geolocation API (e.g., Google Maps).
  • Manual Location Input: Allow users to input location manually if permissions are denied.

Social Media Integration (Twitter)

  • Automatically create a Twitter post with:
    • The pothole image.
    • The location (GPS coordinates or address).
    • A warning message to alert authorities.
  • Users can customize warning messages.

User Dashboard

  • View the history of reported potholes.
  • Track the status of each report (e.g., pending, acknowledged, resolved).

🦾 Tech Stack

🌐 Backend Technologies

  • Backend Framework: Node.js with Express.js
  • Database: MongoDB
  • Image Storage: Cloudinary or Amazon S3
  • Geolocation: Google Maps API for GPS and address lookup
  • Social Media Integration: Twitter API for posting

Frontend Framework

  • React Native with expo

📸 Screenshots

Login Screen Splash Screen Home Screen
Login Screen Splash Screen Home Screen
Camera Screen Map Screen Dashboard Screen
Camera Screen Map Screen Dashboard Screen

🧩 Try the App

Want to Try the App?

Head over to the Releases tab on our GitHub repository to download and install the APK for Android devices. Experience firsthand how the Pot Hole Detector empowers you to report potholes effortlessly!
Or click the download button below:

Download APK


👨‍🔧 Setup Instructions

Frontend Setup

  • Prerequisites
    • Node.js (v16.10.0 or higher)
    • Expo CLI: Install globally using npm install -g expo-cli
    • Git: For version control
    • API Keys:
      • Google Maps API: For geolocation and address lookup
      • Twitter API: For posting reports
      • Cloudinary/Amazon S3: For image storage
  1. Clone the Repository

    git clone https://github.com/alienx5499/Pot-Hole-Detector.git
  2. Navigate to the Project Directory

    cd Pot-Hole-Detector
  3. Install Dependencies

    npm install
  4. Set Up APIs

    • Obtain API keys for:
      • Google Maps API (geolocation and address lookup).
      • Twitter API (posting reports).
    • Add these keys to a .env file:
      GOOGLE_MAPS_API_KEY=your_google_maps_api_key
      TWITTER_API_KEY=your_twitter_api_key
      TWITTER_API_SECRET=your_twitter_api_secret
      
  5. Configure Expo Ensure that your app.json or app.config.js is set up correctly with necessary permissions for location and camera access.

  6. Run the Application

    expo start
    • For iOS: Press i to open in the iOS simulator.
    • For Android: Press a to open in the Android emulator.
    • On Physical Devices: Use the Expo Go app to scan the QR code.
  7. Build for Production Use Expo’s build service to create standalone builds:

    expo build:android
    expo build:ios
  8. Deployment Deploy the backend server using platforms like Heroku, AWS, or DigitalOcean. For the mobile app, publish to Google Play Store and Apple App Store.

Backend Setup

  • Prerequisites
    • Node.js v16.10.0 or higher
    • MongoDB v4.4 or higher
    • NPM or Yarn package manager
    • At least 1GB of free disk space
    • Active internet connection for API integrations
  1. Navigate to Backend Directory

    cd Pot-Hole-Detector-Backend
  2. Install Dependencies

    npm install
  3. Environment Configuration

    • Create a .env file in the backend root directory
    • Copy contents from .env.example and fill in your values:
      MONGO_URL=your_mongodb_connection_string
      JWT_SECRET=your_jwt_secret_key
      
  4. Database Setup

    • Ensure MongoDB is installed and running
    • Create a new MongoDB database
    • Add the connection string to your .env file
  5. Create Upload Directory

    mkdir uploads
  6. Start Development Server

    npm run dev
  7. Verify Installation

    • The server should be running on http://localhost:3000
    • Test the endpoints:
      • Auth: POST http://localhost:3000/api/v1/auth/signup
      • Pothole: POST http://localhost:3000/api/v1/pothole/upload

📍 API Endpoints

  1. Authentication

    • Register new user POST /api/v1/auth/signup
    • Login existing user POST /api/v1/auth/signin
    • Login as guest POST /api/v1/auth/guest-signin
    • Convert guest to regular user POST /api/v1/auth/convert-guest
  2. Pothole Reports

    • Upload new pothole report POST /api/v1/pothole/upload
    • Get user dashboard data GET /api/v1/pothole/dashboard
    • Get recent reports GET /api/v1/pothole/recent-reports
    • Get specific report details GET /api/v1/pothole/report/:id

🚨 Resource Warning

This project involves API calls and real-time geolocation processing, which may consume significant server resources. If your server has limited capabilities, ensure:

  • Efficient caching mechanisms for frequently used API responses.
  • Testing with smaller datasets during the development phase.

Alternatively, use mock data during initial development to simulate production behavior.


🎯 Target Audience

  1. Commuters: Easily report road hazards and improve safety.
  2. Local Authorities: Gain better insights into road conditions.
  3. Activists and Environmentalists: Leverage social media to raise awareness about infrastructure issues.
  4. Developers: Expand the repository with new features or APIs.

🤝 Contributing

We ❤️ open source! Contributions are welcome to make this project even better.

  1. Fork the repository.
  2. Create your feature branch.
    git checkout -b feature/new-feature
  3. Commit your changes.
    git commit -m "Add a new feature"
  4. Push to the branch and open a pull request.

Awesome Contributors

Thank you for contributing to our repository



📜 License

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


📬 Feedback & Suggestions

We value your input! Share your thoughts through GitHub Issues.

💡 Let's work together to improve road safety and awareness!

About

✨ SpotHole helps users report potholes with ease. Capture images, tag locations, and share reports on Twitter to raise awareness. Track all submissions via a simple dashboard. Built with Node.js, this app empowers communities to improve road safety. Open for contributions! ✨

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •