A modern web application that empowers citizens to report road potholes to municipal authorities, streamlining infrastructure maintenance and improving community engagement.
- Overview
- Features
- Tech Stack
- Screenshots
- Getting Started
- Installation
- Configuration
- Usage
- Project Structure
- Database Schema
- API Documentation
- Deployment
- Roadmap
- Contributing
- License
- Contact
PotholeFix is a full-stack web application designed to bridge the gap between citizens and municipal authorities in infrastructure maintenance. The platform enables:
- Citizens to report road potholes instantly with photos and GPS locations
- Municipal Officials to track, prioritize, and manage infrastructure repairs
- Communities to monitor progress and hold authorities accountable
- π Zero Friction: No account creation required for reporting
- π Precise Location: Interactive maps with GPS integration
- π Transparency: Public dashboard shows all reported issues
- β‘ Real-time Updates: Instant notifications to officials
- π± Mobile First: Optimized for on-the-go reporting
- π Secure: Row-level security and data validation
-
Quick Reporting
- Upload photos directly from mobile camera
- Pin exact location on interactive map or use GPS
- Select severity level (Minor/Moderate/Severe)
- Optional description and contact information
- No login required
-
Public Map View
- See all reported potholes in your area
- Color-coded markers by severity
- Filter by status (Reported/In Progress/Resolved)
- Click markers to view details and photos
- Track repair progress
-
Live Statistics
- Total potholes reported
- Issues in progress
- Resolved issues
- Updated in real-time
-
Admin Dashboard
- Secure password-protected access
- View all reports in tabular format
- Sort by date, severity, or location
- Filter by status or severity level
- Update repair status in real-time
-
Report Management
- Change status: Reported β In Progress β Resolved
- View reporter contact information
- Click location to open in Google Maps
- See uploaded photos and descriptions
- Track time metrics
-
Analytics (Future Enhancement)
- Severity distribution charts
- Resolution time metrics
- Geographic heat maps
- Trend analysis over time
- React 18 - UI library for building component-based interfaces
- TypeScript - Type-safe JavaScript for better code quality
- Vite - Next-generation frontend build tool for faster development
- Tailwind CSS - Utility-first CSS framework for responsive design
- React Router - Client-side routing for single-page application
- React Leaflet - Interactive map components using OpenStreetMap
- Supabase - Backend-as-a-Service platform providing:
- PostgreSQL Database - Relational database with full SQL support
- Storage - File storage for uploaded images
- Authentication - User authentication (ready for future expansion)
- Row Level Security (RLS) - Database-level access control
- Edge Functions - Serverless functions for email notifications
- Lucide React - Modern icon library
- Leaflet - Interactive maps library
- clsx & tailwind-merge - Utility for conditional className management
- ESLint - Code linting for consistency
- PostCSS - CSS processing with Autoprefixer
- TypeScript Compiler - Type checking and compilation
Hero section with live statistics and call-to-action
Interactive map picker and image upload interface
All reported potholes with filtering options
Management interface for municipal officials
- Node.js 18+ and npm
- Supabase Account (free tier available)
- Modern web browser (Chrome, Firefox, Safari, Edge)
# Clone the repository
git clone https://github.com/yourusername/potholefix.git
# Navigate to project directory
cd potholefix
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your Supabase credentials
# Run development server
npm run devVisit http://localhost:5173 in your browser.
git clone https://github.com/yourusername/potholefix.git
cd potholefixnpm installThis installs:
- React ecosystem packages
- TypeScript and build tools
- Supabase client library
- Leaflet and mapping libraries
- UI component libraries
- Create a free account at Supabase
- Create a new project
- Go to SQL Editor in Supabase dashboard
- Copy contents of
supabase-migration.sql - Paste and execute in SQL Editor
This creates:
pothole_reportstable with proper indexesadmin_userstable for authentication- Row Level Security policies
- Database triggers and functions
- Analytics views
- Navigate to Storage in Supabase
- Create new bucket:
pothole-images - Make it public (check the public option)
- Storage policies are automatically configured
Create .env file in project root:
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
VITE_MUNICIPAL_EMAIL=officials@city.govGet credentials from Supabase:
- Dashboard β Settings β API
- Copy Project URL and anon/public key
npm run dev| Variable | Description | Required |
|---|---|---|
VITE_SUPABASE_URL |
Supabase project URL | β Yes |
VITE_SUPABASE_ANON_KEY |
Supabase anonymous key | β Yes |
VITE_MUNICIPAL_EMAIL |
Email for notifications | Optional |
Default admin password: admin123
Change this immediately!
Edit src/pages/Admin.tsx:
if (password === 'your_secure_password') {For production, implement proper authentication using Supabase Auth.
Default map center (New York City):
- Latitude:
40.7128 - Longitude:
-74.0060
To change for your city, edit:
src/components/report/MapPicker.tsx(line ~60)src/components/map/PotholeMap.tsx(line ~64)
- Navigate to the Report page
- Click "Use My Current Location" or click on map
- Upload one or more photos
- Select severity level
- Add optional description
- Submit (no login required)
- Navigate to Map page
- Use filters to show specific severity or status
- Click markers to see details and photos
- Monitor resolution progress
- Go to
/adminroute - Enter admin password
- View all reports in table format
- Update status via dropdown
- Click location to view in Google Maps
potholefix/
βββ public/ # Static assets
βββ src/
β βββ components/ # React components
β β βββ common/ # Shared components (Navbar, Footer)
β β βββ landing/ # Landing page components
β β βββ report/ # Report form components
β β βββ map/ # Map view components
β β βββ admin/ # Admin dashboard components
β βββ pages/ # Page components (routes)
β β βββ Home.tsx # Landing page
β β βββ Report.tsx # Report submission
β β βββ Map.tsx # Public map view
β β βββ Admin.tsx # Admin dashboard
β β βββ About.tsx # About page
β βββ lib/ # Utility functions
β β βββ supabase.ts # Supabase client setup
β β βββ types.ts # TypeScript type definitions
β β βββ database.types.ts # Database schema types
β β βββ utils.ts # Helper functions
β βββ App.tsx # Main app component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ supabase-migration.sql # Database schema
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ vite.config.ts # Vite config
βββ tailwind.config.js # Tailwind CSS config
βββ README.md
| Column | Type | Description |
|---|---|---|
id |
UUID | Primary key, auto-generated |
created_at |
TIMESTAMP | Report creation time |
updated_at |
TIMESTAMP | Last modification time |
latitude |
DECIMAL(10,8) | GPS latitude coordinate |
longitude |
DECIMAL(11,8) | GPS longitude coordinate |
severity |
TEXT | 'minor', 'moderate', or 'severe' |
status |
TEXT | 'reported', 'in_progress', or 'resolved' |
description |
TEXT | Optional details from reporter |
reporter_name |
TEXT | Optional reporter name |
reporter_email |
TEXT | Optional contact email |
image_urls |
TEXT[] | Array of image URLs from storage |
idx_pothole_location- Geospatial queriesidx_pothole_status- Status filteringidx_pothole_severity- Severity filteringidx_pothole_created_at- Date sorting
- Public can read and insert reports
- Only authenticated admins can update/delete
- Email-based authorization for admin access
Fetch all reports:
const { data, error } = await supabase
.from('pothole_reports')
.select('*')
.order('created_at', { ascending: false })Insert new report:
const { data, error } = await supabase
.from('pothole_reports')
.insert({
latitude: 40.7128,
longitude: -74.0060,
severity: 'moderate',
description: 'Large pothole on Main St',
image_urls: ['https://...']
})Update status:
const { error } = await supabase
.from('pothole_reports')
.update({ status: 'in_progress' })
.eq('id', reportId)Upload image:
const { data, error } = await supabase.storage
.from('pothole-images')
.upload(fileName, file)
const { data: { publicUrl } } = supabase.storage
.from('pothole-images')
.getPublicUrl(fileName)- Install Vercel CLI:
npm install -g vercel- Build and deploy:
npm run build
vercel --prod- Add environment variables in Vercel dashboard:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEYVITE_MUNICIPAL_EMAIL
- Install Netlify CLI:
npm install -g netlify-cli- Build and deploy:
npm run build
netlify deploy --prod --dir=dist- Add environment variables in Netlify dashboard
- Change admin password from default
- Set up proper authentication (Supabase Auth)
- Configure custom domain
- Set up email notifications (Resend/SendGrid)
- Enable HTTPS
- Add error monitoring (Sentry)
- Set up analytics (Google Analytics/Plausible)
- Create backup strategy for database
- Test on multiple devices and browsers
- Public pothole reporting
- Interactive map view
- Admin dashboard
- Status management
- Image upload
- Email notifications via Resend/SendGrid
- User authentication for reporters
- Report history and tracking
- Advanced analytics dashboard
- Export reports to CSV/PDF
- Multi-language support
- Mobile application (React Native)
- Push notifications
- Integration with city GIS systems
- Automated severity detection (ML)
- Public API for third-party integrations
- Work order management system
- Multi-city support
- Role-based access control
- Performance optimization
- Offline mode (PWA)
- Real-time collaboration features
Contributions are welcome! This project is designed to help cities improve infrastructure management.
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Add comments for complex logic
- Test on multiple browsers
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Aakash Sen
- GitHub: @AakashSen
- LinkedIn: My LinkedIn
- Email: senaakash237@gmail.com
- Built with React
- Backend by Supabase
- Maps by Leaflet and OpenStreetMap
- Icons from Lucide
- Styling with Tailwind CSS
For municipal partnerships, internship opportunities, or questions:
Email: senaakash237@gmail.com
- Streamline citizen engagement
- Prioritize infrastructure repairs
- Track maintenance efficiency
- Demonstrate transparency
- Reduce manual reporting overhead
- Report issues without bureaucracy
- Track resolution progress
- Hold authorities accountable
- Contribute to community improvement
- Full-stack portfolio project
- Modern tech stack demonstration
- Real-world application example
- Open-source contribution opportunity
Built with β€οΈ to make roads safer and communities better