A real-time, map-based platform for reporting and managing potholes, built with TypeScript, React, and Node.js. This application empowers users to quickly report road defects and provides an administration interface for tracking and managing these reports, potentially with real-time updates.
- Interactive Map: Report potholes using an intuitive map interface powered by Leaflet and React-Leaflet.
- Real-time Updates: Potentially offers real-time notifications or updates on report statuses via Socket.IO.
- User-Friendly Interface: Modern and responsive design using React and Framer Motion.
- State Management: Efficient client-side state management with Zustand.
- Data Visualization: Dashboards and charts for report statistics using Recharts.
- Hot Toast Notifications: User feedback with
react-hot-toast.
This project leverages a modern tech stack to deliver a robust and scalable application:
- Frontend:
- TypeScript
- React
- Leaflet & React-Leaflet (Mapping)
- Zustand (State Management)
- Framer Motion (Animations)
- Recharts (Data Visualization)
- Socket.IO Client (Real-time communication)
- React Hot Toast (Notifications)
- Backend:
- TypeScript
- Node.js (Likely Express.js for API)
- Socket.IO (Real-time communication)
- MongoDB (Storing User data)
Follow these steps to set up the project locally.
Ensure you have the following installed:
- Node.js (LTS recommended)
- npm (comes with Node.js)
- Navigate into the
backenddirectory:cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackenddirectory based on a.env.example(if available, otherwise assumePORTandMONGO_URIor similar).# Example .env content PORT=5000 # Add your database connection string here, e.g., for MongoDB # MONGO_URI=mongodb://localhost:27017/pothole-report
- Start the backend server:
The backend should now be running, typically on
npm start
http://localhost:5000.
- Navigate into the
project(frontend) directory from the root:cd project - Install dependencies:
npm install
- Create a
.envfile in theprojectdirectory (e.g.,REACT_APP_API_URL,REACT_APP_SOCKET_URL).# Example .env content REACT_APP_API_URL=http://localhost:5000/api REACT_APP_SOCKET_URL=http://localhost:5000
- Start the frontend development server:
The frontend application should open in your browser, typically at
npm run dev
http://localhost:5173.
Once both the backend and frontend servers are running:
- Open your web browser and navigate to
http://localhost:5173. - Interact with the map to report new potholes.
The repository is organized into two main parts:
Pothole-report/
├── backend/ # Contains the Node.js/Express server logic and API endpoints
│ ├── src/ # Source code for the backend
│ └── package.json # Backend dependencies and scripts
├── project/ # Contains the React frontend application
│ ├── src/ # Source code for the frontend (components, pages, state management)
│ └── package.json # Frontend dependencies and scripts
├── .gitignore # Specifies intentionally untracked files to ignore
├── package-lock.json # Records the exact dependency tree (root level)
└── package.json # Root-level project metadata (can be used for workspaces or global scripts)