A comprehensive Chrome extension + hosted website that uses webcam + AI to detect user emotions while working and provide real-time suggestions with analytics.
- Real-time Emotion Detection: Uses webcam and face-api.js to detect focused, tired, and stressed states
- AI-Powered Suggestions: Google Gemini API provides personalized productivity recommendations
- Analytics Dashboard: Beautiful charts and insights using Recharts
- Chrome Notifications: Smart notifications with customizable intervals
- User Authentication: Auth0 integration with email and Google login
- Data Persistence: MongoDB storage for emotion events and user preferences
- Frontend: Next.js 15, React 19, TailwindCSS, shadcn/ui
- Backend: Next.js API routes + MongoDB (Mongoose)
- Authentication: Auth0
- ML Model: face-api.js for emotion recognition
- Charts: Recharts (stacked bar charts)
- AI Suggestions: Google Gemini API
- Browser Extension: Manifest v3, service worker, content scripts
Copy the environment template:
cp env.example .env.localFill in your API keys and configuration:
MONGODB_URI=mongodb://localhost:27017/workflow-ai
GEMINI_API_KEY=your-gemini-api-key
JWT_SECRET_TOKEN=your-secret-tokennpm installnpm run check-depsnpm run devVisit http://localhost:3000 to see the website.
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
chrome-extension/folder - The extension will appear in your browser toolbar
├── src/
│ ├── app/ # Next.js app router
│ │ ├── api/ # API routes
│ │ ├── dashboard/ # Dashboard page
│ │ └── page.tsx # Landing page
│ ├── components/ui/ # shadcn/ui components
│ ├── lib/ # Utilities (auth, db, gemini)
│ └── models/ # MongoDB schemas
├── chrome-extension/ # Chrome extension files
│ ├── manifest.json # Extension manifest
│ ├── popup.html # Extension popup UI
│ ├── popup.js # Popup logic
│ ├── background.js # Service worker
│ ├── content.js # Content script
│ └── face-detection.js # Emotion detection
├── scripts/
│ └── check-deps.js # Dependency validation
└── README.md
All branding logos should be placed in /public/logos/. These are referenced in code via /logos/logo1.png, /logos/logo2.png, etc.
logo1.png- intention.ai with cubelogo2.png- intentionalailogo3.png- intentionallogo4.png- intentional highlighted
You can replace the placeholder files with the actual PNGs.
POST /api/emotions- Record emotion eventGET /api/emotions?week=current- Get emotion analyticsPOST /api/suggestions- Get AI suggestionsGET /api/user- Get user profilePUT /api/user- Update user settings
- Webcam Monitoring: Continuous emotion detection via webcam
- Smart Notifications: AI-powered suggestions with customizable intervals
- Settings Management: Toggle monitoring and notifications
- Dashboard Access: Quick link to web dashboard
- Recent History: View recent emotion detections
storage- Save user settingsnotifications- Show AI suggestionsactiveTab- Access current tabscripting- Inject content scripts
{
auth0Id: String (unique),
email: String,
name: String,
settings: {
notificationInterval: Number (default: 15),
notificationsEnabled: Boolean (default: true),
webcamEnabled: Boolean (default: true)
}
}{
userId: ObjectId,
timestamp: Date,
emotion: String (enum: ["focused", "tired", "stressed"]),
confidence: Number,
timeOfDay: String (enum: ["morning", "afternoon", "evening", "late_night"])
}- Package the
chrome-extension/folder - Submit to Chrome Web Store
- Or distribute as unpacked extension
The project includes a comprehensive dependency check script:
- Validates all required environment variables
- Checks for outdated packages
- Tests MongoDB connection
- Verifies API configurations
Run before deployment:
npm run check-deps- Update API routes in
src/app/api/ - Add UI components in
src/components/ - Update Chrome extension in
chrome-extension/ - Test with dependency check script
-
MongoDB Connection Failed
- Check
MONGODB_URIin.env.local - Ensure MongoDB is running locally or use cloud instance
- Check
-
Auth0 Authentication Issues
- Verify Auth0 domain and client credentials
- Check callback URLs in Auth0 dashboard
-
Gemini API Errors
- Ensure
GEMINI_API_KEYis set correctly - Check API quotas and billing
- Ensure
-
Chrome Extension Not Working
- Check browser console for errors
- Verify webcam permissions
- Ensure all files are loaded correctly
Set NODE_ENV=development for detailed error logging.
- Fork the repository
- Create a feature branch
- Make your changes
- Run dependency check:
npm run check-deps - Submit a pull request
MIT License - see LICENSE file for details.
Built with LOVE for PennApps 2025