A modern crowdsourced repair platform that connects people who need repairs with skilled professionals in their area. Built with Next.js, TypeScript, Supabase, and modern web technologies.
- Overview
- Features
- Tech Stack
- Getting Started
- Project Structure
- Database Schema
- API Documentation
- Testing
- Deployment
- Contributing
- Environment Variables
- License
RepairMatch is a full-stack web application that facilitates connections between repair service requesters and professional repairers. The platform features real-time messaging, location-based job discovery, bidding systems, and comprehensive user management.
- Requesters: Users who post repair jobs and need services
- Repairers: Professional service providers who bid on and complete jobs
- Jobs: Repair requests with location, budget, and category information
- Bids: Proposals submitted by repairers with pricing and timeline estimates
- Real-time Communication: Built-in chat system for seamless coordination
- Create detailed repair job listings with photos and specifications
- Set budgets and receive competitive bids from qualified repairers
- Interactive map view to visualize available repairers in the area
- Real-time chat with selected repairers
- Job status tracking and management dashboard
- Secure payment processing integration
- Rating and review system for completed jobs
- Browse and filter available jobs by category, location, and budget
- Map-based job discovery with geographic filtering
- Submit detailed proposals with custom pricing and timelines
- Business profile management with portfolio and credentials
- Real-time notifications for new job opportunities
- Bid tracking and status management
- Customer communication tools
- User authentication with email/password and OAuth (Google)
- Role-based access control (Requester/Repairer)
- Real-time notifications and messaging
- Location-based services with Mapbox integration
- Responsive design for desktop and mobile devices
- Dark/light theme support
- Comprehensive search and filtering capabilities
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe JavaScript
- TailwindCSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- React Query - Server state management
- React Hook Form - Form validation and management
- Framer Motion - Animation library
- Supabase - Backend-as-a-Service with PostgreSQL
- Row Level Security (RLS) - Database-level authorization
- Real-time subscriptions - Live updates for chat and notifications
- Supabase Auth - Authentication and user management
- Mapbox GL JS - Interactive maps and geocoding
- React Map GL - React wrapper for Mapbox
- Jest - JavaScript testing framework
- Selenium WebDriver - End-to-end testing
- ESLint - Code linting
- Prettier - Code formatting
- Docker - Containerization
- Vercel/Netlify - Hosting platform options
- Node.js 18 or higher
- npm or yarn package manager
- Supabase account
- Mapbox account (for maps functionality)
- Clone the repository:
git clone https://github.com/yourusername/repair-match.git
cd repair-match/project- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.local-
Configure your environment variables (see Environment Variables section)
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm test # Run unit tests
npm run test:e2e # Run end-to-end testsproject/
├── app/ # Next.js App Router pages
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout component
│ ├── page.tsx # Home page
│ ├── dashboard/ # User dashboard
│ ├── jobs/ # Job-related pages
│ ├── post/ # Job posting page
│ ├── repairers/ # Repairer directory
│ └── signin/ # Authentication pages
├── components/ # Reusable React components
│ ├── auth/ # Authentication components
│ ├── jobs/ # Job-related components
│ ├── map/ # Map components
│ ├── messages/ # Chat components
│ ├── notifications/ # Notification components
│ └── ui/ # Base UI components
├── hooks/ # Custom React hooks
│ ├── use-auth.ts # Authentication hook
│ ├── use-profile.ts # User profile hook
│ └── use-toast.ts # Toast notification hook
├── lib/ # Utility functions and configurations
│ ├── supabase/ # Supabase client and types
│ ├── types/ # TypeScript type definitions
│ ├── notifications/ # Notification utilities
│ └── constants/ # Application constants
├── supabase/ # Database migrations and config
│ └── migrations/ # SQL migration files
└── __tests__/ # Test files
└── e2e/ # End-to-end tests
The application uses PostgreSQL through Supabase with the following main tables:
profiles
- User information for both requesters and repairers
- Includes role designation, location data, and business information
repair_jobs
- Job listings with title, description, budget, and location
- Status tracking (open, in_progress, completed, closed)
- Category classification and geographic coordinates
bids
- Proposals from repairers on specific jobs
- Includes pricing, estimated timeline, and detailed descriptions
- Status management (pending, accepted, rejected)
messages
- Real-time chat system between users
- Job-specific conversation threads
- Read status tracking
notifications
- In-app notification system
- Type-based notifications (new_bid, bid_accepted, job_completed, message)
- User-specific targeting with read status
- profiles (1) → repair_jobs (many) via requester_id
- profiles (1) → repair_jobs (many) via repairer_id
- repair_jobs (1) → bids (many) via job_id
- profiles (1) → bids (many) via repairer_id
- repair_jobs (1) → messages (many) via job_id
- profiles (1) → messages (many) via sender_id/receiver_id
The application uses Supabase Auth for user management:
- Email/password authentication
- OAuth integration (Google)
- Role-based access control
- Session management
Jobs
GET /api/jobs- List all open jobs with filteringPOST /api/jobs- Create new job (authenticated requesters)GET /api/jobs/:id- Get job details with bidsPUT /api/jobs/:id- Update job status (job owner only)
Bids
GET /api/jobs/:id/bids- Get bids for a jobPOST /api/jobs/:id/bids- Submit bid (authenticated repairers)PUT /api/bids/:id/accept- Accept bid (job owner only)
Messages
GET /api/jobs/:id/messages- Get chat messagesPOST /api/jobs/:id/messages- Send message- WebSocket connection for real-time updates
Run unit tests with Jest:
npm testThe application includes comprehensive E2E tests using Selenium WebDriver:
npm run test:e2eTest Coverage:
- User authentication flows
- Job posting and management
- Bidding system functionality
- Real-time messaging
- Map interactions
- Jest configuration:
jest.config.e2e.js - Test setup:
jest.setup.e2e.ts - Browser automation with Chrome headless mode
Build and run with Docker:
docker build -t repair-match .
docker run -p 3000:3000 repair-matchThe application supports multiple deployment environments:
- Development:
npm run dev - Production:
npm run build && npm start - Docker: Multi-stage build with optimized production image
Compatible with:
- Vercel (recommended for Next.js)
- Netlify
- Docker containers
- Traditional VPS/cloud servers
Create a .env.local file with the following variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Mapbox Configuration
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_access_token
# Optional: Analytics and Monitoring
NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id
# Optional: Payment Processing
STRIPE_SECRET_KEY=your_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
# Optional: SMS Notifications
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token- Supabase Project: Create at supabase.com
- Mapbox Account: Get API key at mapbox.com
- Stripe Account: For payment processing (optional)
- Twilio Account: For SMS notifications (optional)
We welcome contributions to RepairMatch! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes with appropriate tests
- Ensure all tests pass:
npm test && npm run test:e2e - Commit with conventional commits:
git commit -m "feat: add new feature" - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Write comprehensive tests for new features
- Follow React/Next.js conventions
- Maintain responsive design principles
When reporting issues, please include:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Browser/environment information
- Relevant console errors or logs
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Check existing documentation
- Review the test files for usage examples
Upcoming features and improvements:
- Mobile application (React Native)
- Advanced payment processing
- Enhanced notification system
- Multilingual support
- Advanced analytics dashboard
- API rate limiting and optimization