This guide explains how to use the ReBin Pro community features that showcase functionality with mock data. All community pages now work with realistic mock data by default when users are signed in.
- Location:
/leaderboard - Features:
- Top 10 community members with realistic mock data
- Real-time connection indicator (simulated)
- User rankings with points, items sorted, and CO₂ saved
- Time period filtering (1d, 7d, 30d, all)
- Current user highlighting
- Location:
/challenges - Features:
- 5 active community challenges with different types
- Join/leave functionality (simulated)
- Progress tracking with visual progress bars
- Challenge categories: recycling, compost, reduction, education
- Difficulty levels: easy, medium, hard
- Featured challenges highlighting
- Location:
/achievements - Features:
- 12 different achievements with various rarities
- Progress tracking for locked achievements
- Achievement categories: milestone, recycling, compost, environmental, consistency
- Rarity system: common, rare, epic, legendary
- Filtering by status (all, unlocked, locked) and category
- Sorting by rarity, progress, name, or category
- Location:
/dashboard - Features:
- Personal environmental impact metrics
- CO₂ savings visualization
- Items sorted statistics
- Achievement progress
- Real-time updates (simulated)
- Eco Emma - #1 (12,470 points, 1,247 items sorted)
- Green Gary - #2 (11,560 points, 1,156 items sorted)
- Professor Pete - #3 (10,890 points, 1,089 items sorted)
- And 7 more community members with realistic data
- Unlocked: First Steps, Recycling Rookie, Compost Champion, Century Club, CO2 Crusher, Streak Master, Waste Wizard
- Locked: Plastic Buster, Paper Pioneer, Metal Master, Glass Guardian, Eco Legend
- Spring Cleaning Challenge - Featured, 1,000 items target
- Plastic-Free Week - Easy, 50 items target
- Compost Champions - Featured, 25kg CO₂ target
- Zero Waste Hero - Hard, 20 items target
- Community Cleanup - Featured, 100 participants target
-
Navigate to any community page:
/leaderboard- Community leaderboard/challenges- Community challenges/achievements- Achievement system/dashboard- Personal stats
-
All pages automatically load with mock data
-
Interactive features work (join challenges, filter achievements, etc.)
- All components use mock data by default
- No backend API calls required
- Realistic user experience with simulated delays
- Professional UI with error handling
- Located in
frontend/src/lib/mockData.ts - Provides realistic data with simulated API delays
- Includes comprehensive mock data for all community features
- Easy to extend with additional mock data
Leaderboard.tsx- Uses mock data instead of API callsChallengeSystem.tsx- Simulated challenge managementAchievementSystem.tsx- Complete achievement trackingRealTimeStats.tsx- Mock statistics dashboard
- All components include proper error states
- Loading states with spinners
- Retry functionality for failed operations
- Graceful fallbacks for missing data
- Simulated API delays (200-500ms)
- Real-time connection indicators
- Progress animations and transitions
- Interactive buttons and filters
- Consistent design system
- Responsive layouts
- Smooth animations
- Professional UI components
- Edit
frontend/src/lib/mockData.ts - Add new entries to the appropriate arrays
- Update the service functions if needed
- Components will automatically use the new data
- All components are fully functional with mock data
- Easy to switch back to real API calls
- Comprehensive prop interfaces
- TypeScript support throughout
- Components use mock data when no user ID is provided
- Fallback to "demo-user-123" for consistent experience
- All interactive features work without authentication
- Professional demo experience for stakeholders
- Start with the leaderboard to establish community context
- Demonstrate joining a challenge to show interactivity
- Filter achievements to show the variety of content
- Highlight the progress tracking and visual feedback
- Show the stats dashboard for personal impact
- Community aspect: Multiple users competing and collaborating
- Gamification: Points, achievements, and challenges
- Progress tracking: Visual progress bars and statistics
- Real-time feel: Connection indicators and live updates
- Professional UI: Clean, modern interface design
- Components not loading: Check browser console for errors
- Mock data not showing: Ensure mock data service is imported correctly
- Styling issues: Verify Tailwind CSS is properly configured
- Run
npm run devin the frontend directory - Navigate to
http://localhost:5179(or the port shown in terminal) - Use browser dev tools to inspect components and data flow
This implementation showcases the full potential of ReBin Pro's community features with realistic, engaging mock data that demonstrates the app's value proposition for users and stakeholders. All features work seamlessly without requiring backend setup or authentication.