A comprehensive technical service request management application for tracking device repairs and service operations with full CRUD functionality, user authentication, and Supabase backend.
- Secure Login/Signup with email authentication
- Protected Routes - all data is private to each user
- Session Management - automatic session handling
- User Isolation - each user sees only their own data
- Create: Add new service requests with comprehensive details
- Read: View all requests on the dashboard or individual request details
- Update: Edit any existing service request
- Delete: Remove service requests from the system
- Search & Filter: Find requests by customer name, phone, device, ID, or status
- Single-Page Form: All fields visible on one scrollable page (no tabs)
- 8 Sections:
- Shop Information (shop name, technician, date)
- Customer Information (name, phone, email, address)
- Device Information (model, brand, serial number, OS, accessories)
- Problem Description (detailed issue report)
- Diagnosis & Repair (diagnosis date, technician, fault, parts, action, status)
- Cost Summary (service charge, parts cost, auto-calculated totals and balance)
- Repair Timeline (track multiple repair steps with dates and notes)
- Customer Confirmation (signature, device collection, technician sign-off)
- Statistics Cards:
- Total requests count
- Completed requests
- Pending requests
- In-progress requests
- Total revenue
- Outstanding balance
- Request Cards: Quick overview of each request with essential info
- Fast Actions: Edit, view details, or delete from the dashboard
- Smart Search: Real-time search across multiple fields
- Auto-Calculation: Total cost = service charge + parts cost
- Balance Tracking: Balance = total cost - deposit paid
- Payment Status: Mark payments as completed
- Financial Overview: Dashboard shows total revenue and outstanding balance
- Supabase Backend: Cloud-based PostgreSQL database
- Row-Level Security: Data encrypted and protected per user
- Real-Time Updates: Instant synchronization across sessions
- Automatic Timestamps: Created and updated times tracked automatically
- Frontend: React + TypeScript
- Styling: Tailwind CSS + shadcn-ui components
- Routing: React Router v6
- Backend: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Build Tool: Vite
- UI Components: shadcn-ui
- Icons: Lucide React
- State Management: React Query (TanStack Query)
- Data Validation: TypeScript types
src/
├── pages/
│ ├── LoginPage.tsx # Authentication (login/signup)
│ ├── ServiceRequestForm.tsx # Create/edit service requests
│ ├── ServiceRequestViewPage.tsx # View request details
│ ├── DashboardPage.tsx # Dashboard with all requests & stats
│ └── NotFound.tsx # 404 error page
├── components/
│ ├── ProtectedRoute.tsx # Route protection wrapper
│ └── ui/ # shadcn-ui components
├── contexts/
│ └── AuthContext.tsx # Authentication context & provider
├── lib/
│ ├── supabase.ts # Supabase client setup
│ └── api.ts # API service layer (CRUD operations)
├── types/
│ └── database.ts # TypeScript type definitions
├── hooks/
│ └── use-toast.ts # Toast notification hook
└── main.tsx # Entry point
Configuration Files:
├── DATABASE_SCHEMA.sql # Supabase SQL schema
├── SUPABASE_SETUP.md # Detailed setup instructions
├── vite.config.ts
├── tsconfig.json
├── tailwind.config.ts
└── .env.example # Environment variables template
- Node.js 16+ and npm
- Supabase account (free at https://supabase.com)
-
Clone the repository
git clone <your-repo-url> cd service-hub-pro
-
Install dependencies
npm install
-
Configure Supabase
- Create a Supabase project
- Copy
.env.exampleto.env.local - Add your Supabase URL and Anon Key
- See
SUPABASE_SETUP.mdfor detailed instructions
-
Set up database
- Run the SQL from
DATABASE_SCHEMA.sqlin Supabase SQL Editor - This creates all necessary tables with Row-Level Security
- Run the SQL from
-
Start development server
npm run dev
-
Open in browser
- Navigate to
http://localhost:5173 - Create account or login
- Navigate to
/login- Authentication page (login/signup)/- Create new service request (protected)/edit/:id- Edit existing service request (protected)/view/:id- View request details (protected)/dashboard- Dashboard with all requests and statistics (protected)
- Click "New Request" or go to home page
- Fill in all the details across the 8 sections
- Costs automatically calculate as you enter values
- Add timeline steps by clicking "Add Step"
- Click "Create Request" to save
- Go to dashboard
- Click "Edit" on any request card
- Modify the details
- Click "Update Request" to save changes
- Go to dashboard
- Click "View" on any request card
- See all information in a read-only format
- Print the request if needed
- Click "Edit Request" to make changes
- Use the search box on the dashboard
- Type to filter by:
- Customer name
- Phone number
- Device brand/model
- Request ID
- Status
All CRUD operations are available through the serviceRequestAPI:
// Create
serviceRequestAPI.create(request: ServiceRequest)
// Read one
serviceRequestAPI.getById(id: string)
// Read all for user
serviceRequestAPI.getByUserId(userId: string)
// Update
serviceRequestAPI.update(id: string, updates: Partial<ServiceRequest>)
// Delete
serviceRequestAPI.delete(id: string)
// Search
serviceRequestAPI.search(userId: string, query: string)
// Get by status
serviceRequestAPI.getByStatus(userId: string, status: string)
// Get statistics
serviceRequestAPI.getStats(userId: string)The app uses Supabase Authentication with:
- Email-based login/signup
- Automatic session management
- Protected routes that redirect to login
- User context available throughout the app
All data is protected by:
- Row-Level Security (RLS): Each user sees only their data
- User Isolation: Queries automatically filtered by user ID
- Timestamps: Automatic created_at and updated_at tracking
- Constraints: Data validation at database level
Create .env.local with:
VITE_SUPABASE_URL=your_project_url
VITE_SUPABASE_ANON_KEY=your_anon_key
npm run buildnpm run previewnpm run lint- Export to PDF - Generate downloadable service reports
- Email Notifications - Send updates to customers
- Photo Upload - Attach device photos to requests
- SMS Alerts - Send status updates via text
- Payment Integration - Accept online payments
- Inventory Management - Track spare parts stock
- Mobile App - React Native version for field work
- Customer Portal - Public page for customers to track repairs
- Advanced Reports - Generate business analytics
- Multi-location Support - Manage multiple shops
- Ensure you're logged in
- Check
.env.localhas correct Supabase credentials
- Verify Supabase tables were created from
DATABASE_SCHEMA.sql - Check that RLS policies are enabled
- Ensure you're viewing your own data
- Check browser console for errors
- Verify all required fields are filled (marked with *)
- Check Supabase connection in Network tab
- Supabase Docs: https://supabase.com/docs
- React Docs: https://react.dev
- TypeScript Docs: https://www.typescriptlang.org/docs
- Tailwind CSS: https://tailwindcss.com/docs
- shadcn-ui: https://ui.shadcn.com
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
- ✅ Added Supabase backend integration
- ✅ Implemented user authentication (login/signup)
- ✅ Created full CRUD operations
- ✅ Built comprehensive dashboard with statistics
- ✅ Converted tabbed form to single-page layout
- ✅ Added protected routes
- ✅ Implemented Row-Level Security
- ✅ Added advanced search and filtering
- ✅ Initial release with local storage
- ✅ Tabbed service request form
- ✅ Basic CRUD operations
- ✅ Service request list view