Family Food Safety & Allergy Assistance App
A comprehensive mobile application that helps families identify whether food products are safe to consume based on ingredients, allergies, expiry dates, and health conditions.
defendish/
├── backend/ # Node.js + Express + TypeScript API
│ ├── src/
│ │ ├── controllers/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── middleware/
│ │ └── server.ts
│ ├── prisma/
│ │ └── schema.prisma
│ └── package.json
│
└── mobile/ # React Native + Expo app
├── app/
│ ├── (tabs)/
│ ├── profile/
│ ├── product/
│ └── _layout.tsx
├── services/
└── package.json
- ✅ Email + OTP verification
- ✅ Secure JWT-based authentication
- ✅ Password-protected profile switching
- ✅ Multi-profile support (self, child, parent, other)
- ✅ Health data storage (age, blood group, height, weight)
- ✅ Allergy list management
- ✅ Isolated profile data
- ✅ Barcode scanning
- ✅ Manual product entry
- ✅ Ingredient parsing
- ✅ Expiry date tracking
- ✅ Product suitability marking (✅/❌)
- ✅ Rule-based allergen detection
- ✅ Explainable recommendations
- ✅ Conflict warnings (user decision vs AI analysis)
- ✅ Confidence scoring
- ✅ Automatic expiry monitoring
- ✅ Email alerts (7 days, 1 day, 0 days)
- ✅ Visual status indicators
- ✅ Symptom reporting
- ✅ Severity-based recommendations
- ✅ Incident history tracking
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile:
cp .env.example .env-
Configure environment variables in
.env:- Database URL (PostgreSQL)
- JWT secret
- Email credentials (for OTP)
-
Initialize database:
npm run db:generate
npm run db:migrate- Start development server:
npm run devBackend will run on http://localhost:5000
- Navigate to mobile directory:
cd mobile- Install dependencies:
npm install- Start Expo development server:
npm start- Run on device/emulator:
- Press
afor Android - Press
ifor iOS - Scan QR code with Expo Go app
- Press
POST /api/auth/signup- Create accountPOST /api/auth/verify-otp- Verify emailPOST /api/auth/login- LoginPOST /api/auth/resend-otp- Resend OTP
POST /api/profiles- Create profileGET /api/profiles- Get all profilesGET /api/profiles/:id- Get profilePUT /api/profiles/:id- Update profileDELETE /api/profiles/:id- Delete profilePOST /api/profiles/verify-switch- Verify password
POST /api/products- Add productGET /api/products?profileId=xxx- Get productsGET /api/products/:id- Get productPUT /api/products/:id/suitability- Mark safe/unsafeDELETE /api/products/:id- Delete productPOST /api/products/scan-barcode- Scan barcodePOST /api/products/scan-image- Upload image
POST /api/health/records- Upload health documentGET /api/health/records/:profileId- Get recordsPOST /api/health/incidents- Report incidentGET /api/health/incidents/:profileId- Get incidents
- Runtime: Node.js
- Framework: Express.js
- Language: TypeScript
- Database: PostgreSQL
- ORM: Prisma
- Authentication: JWT + bcrypt
- Email: Nodemailer
- Scheduling: node-cron
- Framework: React Native
- Platform: Expo
- Language: TypeScript
- Navigation: Expo Router
- Camera: expo-camera
- Storage: AsyncStorage
- HTTP: Axios
- Human-in-the-loop AI - AI assists, doesn't dictate
- Transparency - All recommendations are explainable
- Safety-first - Clear warnings for allergens
- Family-focused - Multi-profile with isolated data
- Privacy-conscious - Encrypted health data
- OCR integration (Tesseract.js / Google Vision)
- Barcode API integration (Open Food Facts)
- Advanced ML model for recommendations
- Push notifications
- Offline mode with sync
- Health record OCR processing
- Location-based doctor suggestions
- Family sharing features
- Product history analytics
- Password hashing with bcrypt
- JWT-based authentication
- OTP email verification
- Password-protected profile switching
- Encrypted health data storage
- Input validation and sanitization
- SQL injection prevention (Prisma)
MIT
Built with ❤️ for family food safety
Defendish - Keeping your family safe, one ingredient at a time.