Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
e558f42
Initial commit
boubli Dec 9, 2025
ed90766
Fix line endings
boubli Dec 9, 2025
1959c6e
Update project files
boubli Dec 9, 2025
27cd7f3
Update admin and user components
boubli Dec 9, 2025
3baed09
Update project configuration and actions
boubli Dec 9, 2025
f34b918
feat: Remove USDA integration, implement secure API key system, clean…
boubli Dec 9, 2025
f64b2be
feat: Add VIP cinematic onboarding, fix firestore permissions, and im…
boubli Dec 9, 2025
95dbe7e
feat: content update
boubli Dec 9, 2025
8cac333
feat: Integrate reCAPTCHA v3 and persistent Special Welcome
boubli Dec 9, 2025
6032abc
feat: Add PWA support, dynamic icons, and copyright
boubli Dec 9, 2025
4dd7fd4
fix: Enhance PWA prompt for iOS and secure manifest configuration
boubli Dec 9, 2025
6340659
fix: Resolve build errors, enhance PWA persistence, and secure Firest…
boubli Dec 9, 2025
190e2e5
feat: Update PWA branding, Admin Chat names, and Notifications
boubli Dec 9, 2025
0ce8052
feat: Hide PWA prompt permanently after installation
boubli Dec 9, 2025
f2a8a00
fix: explicit iOS PWA install instructions
boubli Dec 9, 2025
e2b2cf3
fix: Robust iOS PWA support in manifest
boubli Dec 9, 2025
407222f
feat: Add Visual PWA Install Guide for iOS
boubli Dec 9, 2025
e9d0cce
chore: Update favicon, deploy rules, final polish
boubli Dec 9, 2025
fe24ddb
fix: Wrap adjacent JSX elements in Fragment
boubli Dec 9, 2025
3e1ddb0
fix: Resolve manifest TS error for icon purpose
boubli Dec 9, 2025
43f5d27
feat: Final PWA Push Notification Implementation
boubli Dec 9, 2025
ae1f22c
fix: Barcode scanner redirects to search results instead of broken pr…
boubli Dec 9, 2025
4f60704
feat: Final Scanner Polish (FooDB + Redirects)
boubli Dec 9, 2025
11dbea9
feat: Realtime User Presence & Chat Names Integration
boubli Dec 9, 2025
cab8afd
fix: Special Welcome Reliability (Delayed Mark-as-Seen)
boubli Dec 9, 2025
0ecfa21
fix(support): Robust Chat Deletion (Batching) & Admin Trash Button
boubli Dec 9, 2025
a05162f
fix(auth): Enforce strict admin redirection with replace
boubli Dec 9, 2025
98cf7cf
fix(admin): Use Server Action for Secure Admin Recovery
boubli Dec 9, 2025
0c76f50
fix(admin): Allow legacy recovery tokens (Emergency Bypass)
boubli Dec 9, 2025
7e02f48
feat: add active users graph to admin dashboard
boubli Dec 9, 2025
566a050
feat: implement web push notification system structure
boubli Dec 9, 2025
fc84bce
feat: integrate admin push notifications and frontend setup
boubli Dec 9, 2025
713313e
fix: ensure correct user tier fetching and saving in admin panel
boubli Dec 9, 2025
c8a96ff
feat: implement multi-lingual system with persistence and darija support
boubli Dec 9, 2025
f91bf3c
feat: comprehensive global translation support (ar_MA, fr, es, pt) - …
boubli Dec 9, 2025
bab0b98
fix: resolve build error in ChatWindow (timestamp -> createdAt)
boubli Dec 9, 2025
2ac5320
feat: deep localization updates and verified ar_MA translations
boubli Dec 9, 2025
eccb272
fix: added missing AiPreferenceOnboardingProps interface
boubli Dec 9, 2025
9834769
feat: localize scan page
boubli Dec 9, 2025
c734a84
refactor(i18n): remove Darija (ar_MA) support
boubli Dec 10, 2025
7749e3a
feat(ai-chat): use AI-generated suggestions from admin-stored Groq key
boubli Dec 10, 2025
9c23918
feat(quest): improve quest generation to focus on health/nutrition ob…
boubli Dec 10, 2025
f07530f
feat(search): integrate SearXNG self-hosted search to replace paid Se…
boubli Dec 10, 2025
52ad787
feat(ai): add self-hosted Ollama LLM integration (TinyLlama)
boubli Dec 10, 2025
0acd9a7
docs: update README with self-hosted AI infrastructure details
boubli Dec 10, 2025
bc8f498
docs: overhaul README with pro styling, official link, and API guide
boubli Dec 10, 2025
49f486e
feat: add Azure AI (Ollama) support and update creator info
boubli Dec 10, 2025
6b0555a
fix: add ollama to UserApiKeys interface
boubli Dec 10, 2025
826e27a
fix: initialize ollama key in ApiKeyManager state
boubli Dec 10, 2025
bdbf608
fix: resolve typescript error in aiChatService
boubli Dec 10, 2025
d0d0fd5
fix: repair corrupted resolveApiKey function in aiChatService and fix…
boubli Dec 10, 2025
078f0c2
feat: Implement tiered AI access with BYOK, DeepSeek support, and upd…
boubli Dec 10, 2025
b75c623
chore: Update license to proprietary
boubli Dec 10, 2025
8daada6
optim: search performance, azure ai upgrade, & scanner redesign
boubli Dec 10, 2025
22b09a0
fix(scanner): switch to html5-qrcode for universal barcode support
boubli Dec 10, 2025
e545f45
fix(scanner): correct file structure and imports
boubli Dec 10, 2025
2139330
fix(scanner): auto-start camera to fix black screen
boubli Dec 10, 2025
beaf2b4
fix(scanner): resolve TS error and finalize optimizations
boubli Dec 10, 2025
0ad08f8
fix(scanner): bypass getCameras check to fix permission loops
boubli Dec 10, 2025
c61bac7
fix(scanner): add manual permission button for secure gesture
boubli Dec 10, 2025
4009c0f
chore: update documentation with v2 features
boubli Dec 10, 2025
1f4110c
fix(scanner): disable experimentals and add debug logs
boubli Dec 10, 2025
ed3a097
feat: add ReliableBarcodeScanner with iOS fallback
boubli Dec 11, 2025
c59aacf
fix: resolve build error in ReliableBarcodeScanner parameters
boubli Dec 11, 2025
816fd28
feat: redesign scanner UI with AI theme, remove backend logic, fix build
boubli Dec 11, 2025
323a5b7
refactor: rename scanner to ScanBarcode
boubli Dec 11, 2025
daf57fd
refactor: remove ZXing library, use native camera, implementation vis…
boubli Dec 11, 2025
ea22fee
fix(ai): add fallback for gemini-1.5-flash 404 error
boubli Dec 11, 2025
c09ffab
fix(ai): enforce usage of free gemini-1.5-flash variants only
boubli Dec 11, 2025
1771e9c
fix(ai): update ollama default model to tinyllama to match deployed env
boubli Dec 11, 2025
088e77b
fix(ai): update ollama to use llama3.2:1b default, installed remote m…
boubli Dec 11, 2025
5e5214d
feat(admin): add azure ai model management (toggle models, firebase p…
boubli Dec 11, 2025
4857027
feat(ai): add fallback ollama url and default model control
boubli Dec 11, 2025
7ba341d
feat: Add Oracle VM MySQL backup, tier feature expansion, automation
boubli Dec 11, 2025
7ced470
feat: migrate Event Manager to Admin Sidebar, add Special Message con…
boubli Dec 11, 2025
74c4c23
fix: syntax error in upload route
boubli Dec 11, 2025
86fc226
fix: resolve build error in admin/keys/route.ts
boubli Dec 11, 2025
b2ccef5
fix: remove deprecated Grid item prop to resolve build errors
boubli Dec 11, 2025
f12d75d
fix: resolve all build errors including useWindowSize and duplicate a…
boubli Dec 11, 2025
dfa84ab
fix: seasonal event guest support and phase logic separation
boubli Dec 11, 2025
231c2d7
feat(ui): layout quick actions as 2x2 grid on mobile phones
boubli Dec 11, 2025
924ce84
fix(ui): resolve syntax and type errors in UserHome quick actions
boubli Dec 11, 2025
f5c882b
feat(admin): implement notification menu for messages and access requ…
boubli Dec 11, 2025
a0734ba
feat(events): add explicit start/end times for Climax and Special mes…
boubli Dec 11, 2025
1392f8a
fix(events): restrict event message overly to logged-in users only
boubli Dec 11, 2025
a6a7c18
feat: Add PC Geek Builder module + Scanner redesign + Favicon update
boubli Dec 12, 2025
2aa4bf6
fix: PC Builder access check for Pro/Ultimate users
boubli Dec 12, 2025
2e2855a
feat: Move PC Builder location to user profile
boubli Dec 12, 2025
f0ea0b0
fix: Add missing adminDb import in pcBuilderService
boubli Dec 12, 2025
11d217b
feat: notifications, admin visibility, and auth fixes
boubli Dec 12, 2025
34975fe
Fix build errors: Update PC Builder types, fix MUI Grid usage, and re…
boubli Dec 12, 2025
cbf8265
Fix build: Wrap pc-builder in Suspense
boubli Dec 12, 2025
623c61d
Update AI actions, admin pages, and configuration files
boubli Dec 12, 2025
7ff1b05
feat: Add auto-reload on tier change and confirm API key enforcement …
boubli Dec 12, 2025
f530346
Refactor search: Enforce strict Food APIs (USDA, FooDB, OFF), remove …
boubli Dec 13, 2025
a285ac6
feat: Add password visibility toggle to login page
google-labs-jules[bot] Dec 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2025-02-20 - Password Visibility Toggle
**Learning:** Adding a password visibility toggle is a high-value micro-UX improvement for login forms, especially on mobile. Using MUI's `InputAdornment` and `IconButton` with `Visibility/VisibilityOff` icons makes this easy and consistent with the design system. Crucially, `onMouseDown={e => e.preventDefault()}` is needed to prevent focus loss from the input field when clicking the toggle.
**Action:** Always verify keyboard accessibility and focus management when adding interactive elements inside form fields.
15 changes: 15 additions & 0 deletions .github/workflows/weekly-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Weekly Database Backup
on:
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight UTC
workflow_dispatch: # Allow manual trigger from GitHub Actions tab

jobs:
run-backup:
runs-on: ubuntu-latest
steps:
- name: Trigger Backup API
run: |
curl -X POST ${{ secrets.APP_URL }}/api/admin/backup \
-H "x-backup-secret: ${{ secrets.BACKUP_SECRET }}" \
-H "Content-Type: application/json"
59 changes: 33 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
# Dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
.pnp.js

# Testing
/coverage

# next.js
# Next.js
/.next/
/out/

# production
# Production
/build

# misc
# Environment Variables
.env
.env.local
.env.production
.env.development
.env.test
.env*.local

# Firebase
.firebase/
firebase-debug.log
firebase-debug.log*

# Vercel
.vercel/

# System & Editor
.DS_Store
.vscode/
.idea/
*.pem

# debug
# TypeScript
*.tsbuildinfo

# Debug Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
pnpm-debug.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
# Local Security/Keys (Preserved from previous configuration)
certificates/
serviceAccountKey.json
71 changes: 71 additions & 0 deletions ADMIN_TIER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Admin Tier Management Guide

## ✅ Functionality Already Exists!

Admin can change any user's tier and it saves to Firebase automatically.

## How to Change User Tiers

### Step 1: Access User Management
Navigate to: `/admin/users`

### Step 2: Find the User
- **Users Tab**: Regular users
- **Admins Tab**: Admin users

### Step 3: Edit User
Click the **Edit** button (pencil icon) on any user row

### Step 4: Select New Tier
In the dialog, choose from the dropdown:
- **Free** - Limited features (5 scans/day, basic AI)
- **Plus** - Enhanced features (20 scans/day, global search, 10 AI chats/day)
- **Pro** - Full features (unlimited scans, meal planner, PC builder, visual search)
- **Ultimate** - All Pro + white label, beta access, unlimited compare

### Step 5: Save
Click **"Save Changes"** button

## What Happens When You Change a Tier

1. **Immediate Firebase Update**: Tier is saved to `users/{userId}/subscription/tier`
2. **Timestamp Added**: `updatedAt` field is automatically updated
3. **Features Update**: User immediately gets access to new tier features
4. **Real-time Effect**: Next time user refreshes or navigates, new features appear

## Backend Details

**API Endpoint**: `/api/admin/action`
**Action**: `updateTier`
**Firebase Path**: `users/{userId}/subscription`

```typescript
// Backend saves as:
{
subscription: {
tier: 'pro', // or free, plus, ultimate
updatedAt: new Date()
}
}
```

## Feature Access by Tier

| Feature | Free | Plus | Pro | Ultimate |
|---------|:----:|:----:|:---:|:--------:|
| Daily Scans | 5 | 20 | ∞ | ∞ |
| History | 10 | 50 | ∞ | ∞ |
| AI Chat | ❌ | 10/day | ∞ | ∞ |
| Global Search | ❌ | ✅ | ✅ | ✅ |
| Visual Search | ❌ | ❌ | ✅ | ✅ |
| Meal Planner | ❌ | ❌ | ✅ | ✅ |
| PC Builder | ❌ | ❌ | ✅ | ✅ |
| Product Compare | 0 | 2 | 5 | ∞ |
| Beta Access | ❌ | ❌ | ❌ | ✅ |

## Notes

- **Admin Role**: Admins automatically get Ultimate-level features regardless of tier
- **Instant Effect**: Changes take effect immediately upon save
- **Safe Operation**: Uses Firebase `merge: true` to prevent data loss
- **Audit Trail**: `updatedAt` timestamp tracks when tier was last changed
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2024 Youssef Boubli (TRADMSS)

All rights reserved.

This software and its documentation are the property of Youssef Boubli.
Unauthorized copying, modification, distribution, or use of this software,
via any medium, is strictly prohibited without the express written permission
of the copyright holder.

This software is NOT open source. It is proprietary software.
Loading