A secure, comprehensive workforce platform connecting data collectors with job opportunities, featuring AI-powered training, job matching, offline data collection, and instant payment processing.
- Adaptive Training: AI-generated questions based on system objectives and user skill level
- Intelligent Job Matching: AI analyzes profiles and matches collectors with optimal opportunities
- AI Recommendations: Smart recommendations for projects, collectors, and consultants
- 24/7 AI Support: Real-time chatbot assistance powered by OpenRouter
- Profile Verification: Automated AI-powered identity and profile verification
- Secure Authentication: Supabase-powered authentication with role-based access control
- Three User Roles: Collectors, Clients, and Admins
- Complete Registration Flow: Multi-step registration with verification
- Profile Management: Comprehensive profile system with skills, experience, and certifications
- Interactive Modules: Engaging training content with progress tracking
- AI-Generated Assessments: Personalized questions adapting to user competency
- Certifications: Earn certifications upon completing modules with passing scores
- Progress Tracking: Real-time monitoring of training completion and scores
- AI Job Matching: Smart recommendations based on skills, location, and experience
- AI Recommendation Widget: Interactive popup recommendations on dashboards
- One-Click Applications: Streamlined application process
- Match Confidence Scores: See how well you match each opportunity
- Application Tracking: Monitor status of all submitted applications
- Offline-First: Collect data even without internet connection
- Auto-Sync: Automatic synchronization when connection is restored
- IndexedDB Storage: Reliable offline data storage
- Sync Status Indicators: Always know your online/offline status
- Multiple Methods: M-Pesa, Airtel Money, and Bank Transfer support
- Instant Payments: Payments processed within 24 hours
- Transaction History: Complete payment tracking and history
- Secure Processing: Industry-standard payment security
- React 18: Modern UI library
- React Router: Client-side routing
- Supabase JS: Real-time database and authentication
- IndexedDB (idb): Offline data storage
- React Toastify: Elegant notifications
- Lucide React: Beautiful icon library
- Node.js: Runtime environment
- Express: Web application framework
- Supabase: Database and authentication (PostgreSQL)
- OpenRouter: AI services integration
- Helmet: Security middleware
- Express Rate Limit: API rate limiting
- Supabase: Authentication, database, real-time subscriptions
- OpenRouter: AI-powered features (GPT-3.5-turbo)
- M-Pesa Daraja API: Mobile money payments
- Airtel Money API: Alternative payment method
- Node.js 18+ and npm
- Supabase account (free tier works)
- OpenRouter API key
- M-Pesa/Airtel Money API credentials (optional for payments)
# Install frontend dependencies
npm install
# Install backend dependencies
cd server
npm install
cd ..- Create a new project at supabase.com
- Go to Project Settings β API
- Copy your Project URL and anon/public key
- Open SQL Editor and execute the schema from
DATABASE_SCHEMA.md
- Sign up at openrouter.ai
- Generate an API key from your dashboard
- Add credits to your account (as low as $5 to start)
For detailed environment setup, see ENVIRONMENT_SETUP.md
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_OPENROUTER_API_KEY=your_openrouter_key
VITE_APP_URL=http://localhost:5173PORT=5000
NODE_ENV=development
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_KEY=your_supabase_service_key
OPENROUTER_API_KEY=your_openrouter_key
# Generate with: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
JWT_SECRET=your_128_char_minimum_secure_random_string
# Payment APIs (optional - use sandbox for testing)
MPESA_CONSUMER_KEY=your_key
MPESA_CONSUMER_SECRET=your_secret
MPESA_PASSKEY=your_passkey
MPESA_SHORTCODE=174379
MPESA_ENVIRONMENT=sandbox
AIRTEL_CLIENT_ID=your_client_id
AIRTEL_CLIENT_SECRET=your_client_secret
AIRTEL_ENVIRONMENT=sandbox
CLIENT_URL=http://localhost:5173.env.production with real credentials. See ENVIRONMENT_SETUP.md for production deployment.
# Terminal 1: Start frontend (http://localhost:5173)
npm run dev
# Terminal 2: Start backend (http://localhost:5000)
cd server
npm run dev- Sign up with email/password
- Complete 3-step collector registration:
- Personal information (phone, ID, county)
- Skills and experience
- Payment preferences
- AI-powered profile verification
- Access training modules
- Browse and apply to matched jobs
- Collect data (works offline!)
- Receive instant payments
- Sign up with email/password
- Complete client registration with company details
- Create job postings with requirements
- Review AI-matched collector applications
- Monitor data collection progress
- Approve and process payments
- Helmet.js: Security headers
- Rate Limiting: API request throttling
- Row Level Security: Database-level access control via Supabase
- JWT Authentication: Secure session management
- Environment Variables: Sensitive data protection
- CORS Configuration: Cross-origin resource sharing protection
POST /register- Register new userPOST /login- Login userPOST /verify-session- Verify session tokenPOST /logout- Logout user
GET /modules- Get all training modulesGET /modules/:id- Get specific modulePOST /start/:id- Start training moduleGET /questions/:moduleId- Get AI-generated questionsPOST /submit/:moduleId- Submit training assessmentGET /progress- Get user's training progressPOST /certify/:moduleId- Award certification
GET /listings- Get active job listingsGET /matched- Get AI-matched jobs for userPOST /apply/:id- Apply to job (one-click)GET /applications- Get user's applicationsPOST /create- Create new job (clients only)
POST /initiate- Initiate paymentGET /status/:id- Check payment statusGET /history- Get payment historyPOST /mpesa/callback- M-Pesa webhookPOST /airtel/callback- Airtel Money webhook
POST /submit- Submit collected dataPOST /sync- Bulk sync offline dataGET /jobs/:jobId- Get data collection form
POST /support-chat- AI chatbot supportPOST /verify-profile- AI profile verification
- AISupportChat: Floating AI chatbot
- OfflineIndicator: Connection status and sync indicator
- ProtectedRoute: Role-based route protection
- AuthContext: Global authentication state
- Training Modules: Interactive learning experiences
- Job Cards: Beautiful job listings with match scores
- Payment Dashboard: Transaction history and management
The complete database schema is available in DATABASE_SCHEMA.md. Key tables include:
- profiles: User information and roles
- training_modules: Available training content
- training_progress: User training completion
- certifications: Earned certifications
- jobs: Job listings
- applications: Job applications with AI match scores
- collected_data: Submitted data from collectors
- payments: Payment transactions and history
datacollect-pro/
βββ src/ # Frontend source
β βββ components/ # React components
β βββ contexts/ # React contexts (Auth)
β βββ lib/ # Libraries (Supabase)
β βββ pages/ # Page components
β βββ styles/ # CSS files
β βββ utils/ # Utilities (offline, sync, protected routes)
βββ server/ # Backend source
β βββ config/ # Configuration (Supabase)
β βββ routes/ # API routes
β βββ services/ # Business logic (AI, payments)
βββ DATABASE_SCHEMA.md # Database setup guide
βββ .env.example # Environment template
- Supabase over PostgreSQL: Simplified authentication and real-time capabilities
- OpenRouter for AI: Flexible AI provider with multiple model support
- Offline-First: Critical for field data collection
- Role-Based Access: Clean separation between collectors, clients, and admins
- Component-Based: Reusable, maintainable React components
- Ensure all dependencies are installed:
npm install - Check that
.envfile exists with correct Supabase credentials - Clear node_modules and reinstall:
rm -rf node_modules && npm install
- Navigate to server directory:
cd server - Install dependencies:
npm install - Check
server/.envhas all required variables - Ensure Supabase service key is correct (not anon key)
- Verify OpenRouter API key is valid
- Check you have credits in your OpenRouter account
- Review server logs for specific error messages
- Ensure you're using sandbox environment for testing
- Verify payment API credentials are correct
- Check webhook URLs are accessible (use ngrok for local development)
This project is proprietary software developed for DataCollect Pro.
For support, contact the development team or use the in-app AI assistant.
Built with β€οΈ for empowering data collectors and enabling efficient data collection