A modern social photo sharing and event management application with AI-powered face recognition, built with React and Firebase.
- Create & Organize Events: Plan gatherings with date, location, and description
- Member Management: Invite friends and manage event participants
- Event Statistics: Track photo uploads, member activity, and event engagement
- Real-time Updates: See live changes as members interact with events
- Bulk Photo Upload: Upload multiple photos simultaneously with drag-and-drop
- AI-Powered Face Recognition: Automatically identify and tag people in photos using face-api.js
- Face Profile Management: Train the system to recognize you and your friends
- Photo Gallery: Beautiful grid and masonry layouts for browsing event photos
- Download Options: Download individual photos or entire event albums as ZIP files
- Photo Filtering: Find your photos instantly with AI face matching
- Friend System: Connect with friends and manage relationships
- User Presence: See who's online in real-time
- Event Invitations: Send and receive event invites
- User Profiles: Customizable profiles with bio, location, and profile pictures
- Dark/Light Mode: Seamless theme switching with system preference detection
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Accessibility: WCAG-compliant with keyboard navigation and screen reader support
- Smooth Animations: Page transitions and interactive UI elements
- Performance Optimized: Lazy loading, code splitting, and efficient rendering
- Email Verification: Secure account verification system
- Password Reset: Safe password recovery flow
- Protected Routes: Authentication-required pages and resources
- Firestore Security Rules: Server-side data access control
- Turnstile CAPTCHA: Bot protection for authentication
- Free Tier: Basic features for casual users
- Pro Plan: Enhanced limits via Stripe integration
- Usage Tracking: Monitor photo uploads and storage consumption
- Plan Enforcement: Automatic limit enforcement based on subscription tier
- Framework: React 19 with Hooks
- Build Tool: Vite 6
- Routing: React Router DOM 7
- Styling: Tailwind CSS 3 with custom theme
- UI Components:
- Radix UI primitives
- Material-UI components
- Custom component library
- Lucide & Phosphor icons
- Backend: Firebase (Firestore, Storage, Functions, Hosting)
- Authentication: Firebase Auth with custom email verification
- Database: Cloud Firestore with real-time sync
- Storage: Firebase Cloud Storage for photos
- Functions: Node.js 20 serverless functions
- Email: Nodemailer with custom HTML templates
- Payments: Stripe integration for subscriptions
- Face Detection: face-api.js (SSD MobileNetV1)
- Face Recognition: 128D face descriptors with Euclidean distance matching
- Face Landmarks: 68-point facial landmark detection
- Age/Gender: Optional demographic analysis
- Expression Detection: Emotion recognition capabilities
- Testing: Jest with React Testing Library
- Linting: ESLint with React plugins
- Version Control: Git with conventional commits
- Package Manager: npm with workspaces
- CI/CD: Firebase Hosting with GitHub integration
Groupify/
├── client/ # Frontend React application
│ ├── public/ # Static assets
│ │ ├── models/ # Face recognition ML models
│ │ └── groupifyLogo.png # App logo
│ ├── src/
│ │ ├── auth-area/ # Authentication module
│ │ │ ├── components/ # Auth UI components
│ │ │ ├── contexts/ # AuthContext provider
│ │ │ ├── hooks/ # useAuth, useAuthValidation
│ │ │ ├── pages/ # SignIn, SignUp, ForgotPassword, etc.
│ │ │ └── services/ # authService API
│ │ ├── dashboard-area/ # Main application area
│ │ │ ├── components/ # Dashboard UI components
│ │ │ ├── features/
│ │ │ │ ├── events/ # Event management
│ │ │ │ │ └── ViewEvent/ # Event detail page
│ │ │ │ │ ├── features/
│ │ │ │ │ │ ├── faceRecognition/ # Face detection & matching
│ │ │ │ │ │ ├── gallery/ # Photo grid/masonry
│ │ │ │ │ │ ├── header/ # Event header
│ │ │ │ │ │ ├── members/ # Member management
│ │ │ │ │ │ └── statistics/ # Event stats
│ │ │ │ ├── friends/ # Friend system
│ │ │ │ ├── photos/ # Personal photo library
│ │ │ │ ├── profile/ # User profile
│ │ │ │ └── settings/ # App settings
│ │ │ ├── hooks/ # Dashboard-specific hooks
│ │ │ └── pages/ # Dashboard page components
│ │ ├── public-area/ # Landing and public pages
│ │ │ ├── components/ # Public UI components
│ │ │ ├── pages/ # Landing, About, Contact, etc.
│ │ │ └── services/ # Public API services
│ │ ├── shared/ # Shared resources
│ │ │ ├── components/ # Reusable UI components
│ │ │ │ ├── accessibility/ # A11y providers
│ │ │ │ ├── routing/ # Route controllers
│ │ │ │ └── ui/ # UI primitives
│ │ │ ├── constants/ # App constants
│ │ │ ├── contexts/ # Global contexts (Theme, Friends, Events)
│ │ │ ├── hooks/ # Shared hooks
│ │ │ ├── services/ # Firebase services
│ │ │ │ ├── firebase/ # Firebase SDK wrappers
│ │ │ │ └── presence/ # User presence system
│ │ │ └── utils/ # Utility functions
│ │ ├── styles/ # Global styles
│ │ │ ├── base/ # Reset & base styles
│ │ │ ├── components/ # Component styles
│ │ │ ├── themes/ # Theme definitions
│ │ │ └── utilities/ # CSS utilities
│ │ ├── tests/ # Test suites
│ │ │ ├── __mocks__/ # Test mocks
│ │ │ ├── api/ # API tests
│ │ │ ├── components/ # Component tests
│ │ │ └── database/ # Firestore query tests
│ │ ├── App.jsx # Root component
│ │ └── main.jsx # App entry point
│ ├── index.html # HTML template
│ ├── vite.config.js # Vite configuration
│ ├── tailwind.config.js # Tailwind configuration
│ ├── jest.config.js # Jest configuration
│ └── package.json # Frontend dependencies
├── functions/ # Firebase Cloud Functions
│ ├── email-templates/ # HTML email templates
│ │ ├── contactus.html # Contact form template
│ │ ├── resetpassword.html # Password reset template
│ │ ├── verification.html # Email verification template
│ │ └── welcome.html # Welcome email template
│ ├── index.js # Functions entry point
│ ├── openweather-proxy.js # Weather API proxy
│ └── package.json # Functions dependencies
├── docs/ # Documentation
│ ├── firebaseCollection.txt # Firestore schema
│ ├── gitCommands.txt # Git workflow guide
│ └── projectStructure.txt # Project structure
├── firebase.json # Firebase configuration
├── firestore.rules # Firestore security rules
├── firestore.indexes.json # Firestore indexes
├── storage.rules # Storage security rules
└── package.json # Root workspace config
- Node.js: v18.x or v20.x (LTS recommended)
- npm: v9.x or higher
- Firebase CLI: Latest version
- Git: For version control
Clone the repository
git clone https://github.com/groupify-team/Groupify.git cd GroupifyInstall all dependencies
npm run install-all # Or install individually:# npm install # Root dependencies# cd client && npm install # Frontend dependencies# cd functions && npm install # Functions dependencies
Firebase Setup
Create a Firebase project at console.firebase.google.com
Enable the following services:
- Authentication (Email/Password)
- Cloud Firestore
- Cloud Storage
- Cloud Functions
- Hosting
Environment Configuration
Create
client/src/shared/services/firebase/config.js:import{initializeApp}from'firebase/app';import{getAuth}from'firebase/auth';import{getFirestore}from'firebase/firestore';import{getStorage}from'firebase/storage';import{getFunctions}from'firebase/functions';constfirebaseConfig={apiKey: "your-api-key",authDomain: "your-project.firebaseapp.com",projectId: "your-project-id",storageBucket: "your-project.appspot.com",messagingSenderId: "your-sender-id",appId: "your-app-id"};constapp=initializeApp(firebaseConfig);exportconstauth=getAuth(app);exportconstdb=getFirestore(app);exportconststorage=getStorage(app);exportconstfunctions=getFunctions(app);
Configure Function Secrets
Set up required secrets for Cloud Functions:
firebase functions:secrets:set EMAIL_USER firebase functions:secrets:set EMAIL_PASSWORD firebase functions:secrets:set STRIPE_SECRET_KEY firebase functions:secrets:set STRIPE_WEBHOOK_SECRET firebase functions:secrets:set OPENWEATHER_API_KEY
Start the development server
npm run dev # Runs: Vite dev server + OpenWeather proxy# Frontend: http://localhost:5173# Weather Proxy: http://localhost:3001
Run Firebase emulators (optional)
firebase emulators:start
Run tests
cd client npm test# Run all tests npm run test:watch # Watch mode npm run test:coverage # With coverage report
Build the client
npm run build # Output: client/dist/Deploy to Firebase
# Deploy everything npm run deploy # Or deploy individually: npm run deploy:hosting # Frontend only npm run deploy:functions # Functions only npm run deploy:firestore # Rules only npm run deploy:storage # Storage rules only
{uid: string,// Firebase Auth UIDemail: string,displayName: string,photoURL: string,profilePicture: string,bio: string,location: string,birthdate: timestamp,gender: string,friends: array,// Array of friend UIDsevents: array,// Array of event IDsphotoCount: number,emailVerified: boolean,createdAt: timestamp,updatedAt: timestamp,joinedAt: timestamp}{id: string,name: string,description: string,location: string,startDate: timestamp,endDate: timestamp,createdBy: string,// User UIDadmins: array,// Admin UIDsmembers: array,// Member UIDsphotoCount: number,planAtCreation: string,// 'free' | 'pro'planLimits: object,createdAt: timestamp,updatedAt: timestamp}{eventId: string,uploadedBy: string,// User UIDfileName: string,originalName: string,filePath: string,downloadURL: string,type: string,// MIME typesize: number,// BytesplanAtUpload: string,facesDetected: number,facesProcessed: boolean,faceMatches: array,// Array of matched user UIDsuploadedAt: timestamp,lastModified: timestamp}{userId: string,images: array,// Training image URLsmethod: string,// 'face-api' | 'mediapipe'engine: string,metadata: object,createdAt: timestamp,updatedAt: timestamp}{from: string,// Sender UIDto: string,// Recipient UIDstatus: string,// 'pending' | 'accepted' | 'rejected'createdAt: timestamp}{eventId: string,inviterUid: string,inviteeUid: string,status: string,// 'pending' | 'accepted' | 'declined'createdAt: timestamp}Key features in client/vite.config.js:
- Path aliases (
@/,@auth/,@shared/, etc.) - React plugin with Fast Refresh
- Optimized chunking strategy
- Development server on port 5173
Custom theme extends in client/tailwind.config.js:
- Custom color palette
- Extended spacing scale
- Custom animations
- Dark mode support via class strategy
Services configured in firebase.json:
- Hosting: SPA rewrites, custom headers
- Functions: Node.js 20 runtime
- Firestore: Security rules and indexes
- Storage: Access control rules
- Emulators: Storage on port 9199
client/src/tests/
├── setup.js # Test environment setup
├── __mocks__/ # Mock implementations
│ └── firebase.js
├── api/ # API integration tests
│ └── userServices.test.js
├── components/ # Component unit tests
│ └── EventCard.test.js
└── database/ # Firestore query tests
└── firestoreQueries.test.js
cd client
# All tests
npm test# Specific test file
npm test EventCard
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
# Pricing enforcement tests
npm run test:pricing- Provider:
ThemeContextwith system preference detection - Storage: LocalStorage persistence
- Toggle: Smooth transitions between light/dark modes
- Variables: CSS custom properties for dynamic theming
Edit client/tailwind.config.js to customize:
- Colors and gradients
- Typography scale
- Spacing and sizing
- Border radius
- Shadow depths
- Animation timings
- User signs up with email/password
- Verification code sent via email
- User verifies code to activate account
- Password reset with secure token flow
- Turnstile CAPTCHA for bot protection
- User data readable only by owner or friends
- Events readable by members only
- Photos accessible only to event members
- Admin-only operations protected
- Rate limiting on sensitive operations
- Users can upload to their own folders
- Event photos restricted to event members
- File size and type validation
- Authenticated access required
- Mobile: < 640px
- Tablet: 640px - 1024px
- Desktop: > 1024px
- Touch-optimized interactions
- Swipe gestures on photo galleries
- Responsive navigation patterns
- Optimized image loading
- Code Splitting: Route-based lazy loading
- Image Optimization: Lazy loading with react-lazy-load-image-component
- Memoization: React.memo and useMemo for expensive computations
- Virtual Scrolling: Efficient rendering of large photo lists
- Bundle Analysis: Optimized chunk sizes
- Firestore Indexes: Optimized query performance
- Pagination: Cursor-based pagination for large collections
- Caching: Strategic use of Firebase cache
- Batch Operations: Grouped writes for efficiency
- Model Loading: Progressive model loading
- Worker Threads: Face detection in Web Workers
- Descriptor Caching: Store computed face descriptors
- Threshold Tuning: Optimized matching thresholds
npm run dev # Start client dev server
npm run build # Build client for production
npm run start # Preview production build
npm run install-all # Install all workspace dependencies
npm run deploy # Deploy everything to Firebase
npm run deploy:hosting # Deploy only hosting
npm run deploy:functions # Deploy only functions
npm run deploy:firestore # Deploy only Firestore rules
npm run deploy:storage # Deploy only Storage rules
npm run serve # Serve with Firebase locallynpm run dev # Vite dev server + weather proxy
npm run build # Production build
npm run preview # Preview production build
npm run lint # Run ESLint
npm test# Run Jest tests
npm run test:watch # Jest watch mode
npm run test:coverage # Generate coverage report
npm run test:pricing # Test pricing enforcementnpm run serve # Serve functions locally
npm run deploy # Deploy functions to Firebase
npm run logs # View function logs
npm run shell # Functions shell for testing- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow ESLint configuration
- Use Prettier for formatting
- Write meaningful commit messages
- Add tests for new features
- Update documentation
feat: Add new feature
fix: Bug fix
docs: Documentation changes
style: Code style changes
refactor: Code refactoring
test: Add or update tests
chore: Maintenance tasks
This project is proprietary and confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.
- React Team: For the amazing React framework
- Firebase: For the comprehensive backend platform
- Tailwind Labs: For Tailwind CSS
- Vite Team: For the blazing-fast build tool
- face-api.js: For face recognition capabilities
- Radix UI: For accessible component primitives
- React Router: Client-side routing
- React Hot Toast: Elegant notifications
- Lucide Icons: Beautiful icon set
- date-fns: Date manipulation
- JSZip: ZIP file generation
- Stripe: Payment processing
For support, email support@groupify.com or visit our Help Center.
- Website: https://groupify-77202.web.app
- Repository: https://github.com/groupify-team/Groupify
- Documentation: https://docs.groupify.com
- Issue Tracker: https://github.com/groupify-team/Groupify/issues
Made with ❤️ by the Groupify Team