# Project export: Eatelligent

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: CruzHacks 2026
- Tagline: Saving food has never tasted better.
- Devpost: https://devpost.com/software/eatelligent
- GitHub: https://github.com/Pinkspring01/Eatelligent.git
- Video: https://www.youtube.com/embed/2Ngxnctttj8?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 3 GitHub contributor(s) — kamaDe25 (16 commits), Swarna Kona (10 commits), Arya Srinivasan (9 commits)

## Devpost submission (written by the team)

### Inspiration

According to NRDC and Harvard Law’s study, around 91% of individuals throw perfectly good food away due to labels like “sell by” and “best by.” In doing so, these individuals contribute to the huge issue of food waste. More importantly, the perfectly good food that gets wasted ends up rotting in landfills, emitting potent greenhouse gases and contributing to the impending climate crisis.

### What it does

Our solution is Eatelligent! Eatelligent is an online platform for users to manage their food waste by allowing users to add data about their groceries and they can find recipes that specifically prioritize ingredients which are going to expire soon.

### How we built it

Frontend: Typescript, Javascript, CSS Database: MongoDB Atlas to store data about user preferences, ingredients, and recipes Tech Stack: MERN Authentication: Firebase Authentication LLM: Python, HuggingFace API, Llama-3.1-8B-Instruct to generate user-specific recipes

### Challenges we ran into

Initially, we had planned for our project to be a mobile application. However, due to issues of not being able to convert our MERN stack web application into a mobile application and time constraints, we had to resort to making a web application rather than a mobile application. Another challenge we faced was trying to get the LLM portion of the project to connect to the rest of web application. Despite a lot of trial and error, we were not able to fix the issue. However, something we would like to do in the future is create a seamless connection between the LLM and the web application to show the full impact of our idea.

### Accomplishments we're proud of

We are proud of ourselves for participating and pushing out a product that has features that work well and convey our vision despite facing a lot of problems in implementation.

### What we learned

As it was most of our members' first time implementing the MERN stack, we are happy that we gained valuable experience learning how this specific tech stack works and can be implemented. Additionally, we learned how to manage and connect the stack with authentication by implementing Firebase authentication to handle secure user sign-up, login, and session management.

### What's next

Some things we hope to implement in the future for Eatelligent is: Fixing the LLM implementation and integration with our current web application Converting the application into mobile application -Add a system that allows the user to take images of their groceries to extract information rather than manually adding information for their groceries Implementation push notifications Deploy with Vercel

## README (from the GitHub repository)

# Eatelligent

# Project Descrption:
According to studies by the NRDC and Harvard Law, approximately 91% of individuals discard perfectly good food due to confusing labels like “sell by” and “best by.” This contributes significantly to food waste, which eventually rots in landfills and emits potent greenhouse gases. Eatelligent is an online platform designed to combat the climate crisis by helping users manage food waste. Users can track their groceries and generates custom recipes that specifically prioritize those soon-to-expire ingredients.

# Tracks
 - Sustainability
 - Best SlugHacks
 - Use of GenAI
 - Most Start-up Potential
 - Best Use of MongoDB

# Tech Stack:
Frontend: TypeScript, JavaScript, CSS (React/Vite)

Database: MongoDB Atlas to store user preferences, ingredients, and recipe data.

Authentication: Firebase Authentication for secure sign-up, login, and session management.

LLM: Python, HuggingFace (Llama-3.1-8B-Instruct) to generate dynamic, user-specific recipes based on inventory.

# Challenges & Learnings:

We originally envisioned Eatelligent as a mobile application. However, due to the complexities of converting a MERN stack web app into a mobile environment within the hackathon time constraints, we pivoted to a high-quality web application.

# What We Learned:

As first-time users of the MERN stack, we gained deep experience in connecting a full-stack architecture with external services. We successfully integrated Firebase for security and LLMs for intelligent response    generation, learning how to manage data flow between the database and the AI.

# What’s Next for Eatelligent:

1. Mobile Conversion: Porting the web experience to a native mobile app.

2. Computer Vision: Implementing an image-recognition system so users can photograph groceries to auto-extract data instead of manual entry.

3. Deployment: Launching a live version via Vercel.

# Steps to Run the Application:

1. Start the Server Navigate to the server directory in your terminal:
   python recipe_generation.py
2. Run these two commands:
   cd server
   npm install
   node --env-file=.env server
3. Start the Client Open a new terminal window and navigate to the client directory:
   cd client
   npm run dev
4. Access the App Click the local link provided in your terminal (e.g., http://localhost:5173) to view the live project.


## Detected evidence (automated analysis)

Indexed codebase: 63 recognized source files, 131 KB.
- CSS (language) — detected in the code
- Express (technology) — detected in the code
- FastAPI (technology) — detected in the code
- HTML (language) — detected in the code
- Hugging Face (technology) — detected in the code
- JavaScript (language) — detected in the code
- MongoDB (technology) — detected in the code
- Python (language) — detected in the code
- PyTorch (technology) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Firebase (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (86 of 86)

```
.firebaserc
.gitignore
client/.gitignore
client/eslint.config.js
client/index.html
client/package.json
client/postcss.config.cjs
client/README.md
client/src/App.css
client/src/App.tsx
client/src/Apps.tsx
client/src/components/AddIngredientPage.jsx
client/src/components/FridgeList.css
client/src/components/FridgePage.jsx
client/src/components/Home.css
client/src/components/Home.jsx
client/src/components/Login.tsx
client/src/components/ModifyRecord.jsx
client/src/components/Navbar.css
client/src/components/Navbar.jsx
client/src/components/PantryList.css
client/src/components/PantryPage.jsx
client/src/components/RecipeList.css
client/src/components/RecipesPage.jsx
client/src/components/Record.jsx
client/src/components/RecordList.jsx
client/src/components/UserProfilePage.jsx
client/src/index.css
client/src/main
client/src/main.tsx
client/src/styles/Login.css
client/tailwind.config.js
client/tsconfig.app.json
client/tsconfig.json
client/tsconfig.node.json
client/vite.config.ts
EatelligentMobile/.gitignore
EatelligentMobile/.vscode/extensions.json
EatelligentMobile/.vscode/settings.json
EatelligentMobile/app.json
EatelligentMobile/app/_layout.tsx
EatelligentMobile/app/(tabs)/_layout.tsx
EatelligentMobile/app/(tabs)/explore.tsx
EatelligentMobile/app/(tabs)/index.tsx
EatelligentMobile/app/modal.tsx
EatelligentMobile/components/external-link.tsx
EatelligentMobile/components/haptic-tab.tsx
EatelligentMobile/components/hello-wave.tsx
EatelligentMobile/components/parallax-scroll-view.tsx
EatelligentMobile/components/themed-text.tsx
EatelligentMobile/components/themed-view.tsx
EatelligentMobile/components/ui/collapsible.tsx
EatelligentMobile/components/ui/icon-symbol.ios.tsx
EatelligentMobile/components/ui/icon-symbol.tsx
EatelligentMobile/constants/theme.ts
EatelligentMobile/eslint.config.js
EatelligentMobile/hooks/use-color-scheme.ts
EatelligentMobile/hooks/use-color-scheme.web.ts
EatelligentMobile/hooks/use-theme-color.ts
EatelligentMobile/package.json
EatelligentMobile/README.md
EatelligentMobile/scripts/reset-project.js
EatelligentMobile/tsconfig.json
firebase.json
firestore.indexes.json
firestore.rules
functions/.gitignore
functions/index.js
functions/package.json
package.json
public/404.html
public/index.html
README.md
recipe_generation.py
requirements.txt
server/config/passport.js
server/db/connection.js
server/models/User.js
server/package.json
server/routes/auth.js
server/routes/ingredient.js
server/routes/profile.js
server/routes/recipe.js
server/routes/record.js
server/routes/server.js
server/server.js
```

### Dependencies

- client/package.json: @eslint/js@^9.39.1, @tailwindcss/postcss@^4.1.18, @types/node@^24.10.1, @types/react@^19.2.5, @types/react-dom@^19.2.3, @vitejs/plugin-react@^5.1.1, autoprefixer@^10.4.23, eslint@^9.39.1, eslint-plugin-react-hooks@^7.0.1, eslint-plugin-react-refresh@^0.4.24, expo@^54.0.31, globals@^16.5.0, postcss@^8.5.6, react@^19.2.0, react-dom@^19.2.0, react-native-safe-area-context@~5.6.0, react-router-dom@^7.12.0, tailwindcss@^4.1.18, typescript@~5.9.3, typescript-eslint@^8.46.4, vite@^7.2.4
- EatelligentMobile/package.json: @expo/vector-icons@^15.0.3, @react-navigation/bottom-tabs@^7.4.0, @react-navigation/elements@^2.6.3, @react-navigation/native@^7.1.8, @types/react@~19.1.0, @types/react-native@^0.72.8, eslint@^9.25.0, eslint-config-expo@~10.0.0, expo@~54.0.31, expo-constants@~18.0.13, expo-font@~14.0.10, expo-haptics@~15.0.8, expo-image@~3.0.11, expo-linking@~8.0.11, expo-router@~6.0.21, expo-splash-screen@~31.0.13, expo-status-bar@~3.0.9, expo-symbols@~1.0.8, expo-system-ui@~6.0.9, expo-web-browser@~15.0.10, react@19.1.0, react-dom@19.1.0, react-native@0.81.5, react-native-gesture-handler@~2.28.0, react-native-reanimated@~4.1.1, react-native-safe-area-context@~5.6.0, react-native-screens@~4.16.0, react-native-web@~0.21.0, react-native-worklets@0.5.1, typescript@~5.9.2
- functions/package.json: firebase-admin@^12.6.0, firebase-functions@^6.0.1, firebase-functions-test@^3.1.0
- package.json: cors@^2.8.5, mongodb@^7.0.0
- requirements.txt: accelerate@==1.12.0, faiss-cpu@==1.13.2, fastapi@==0.115.0, ftfy@==6.3.1, google-cloud-firestore@==2.23.0, huggingface-hub@==0.36.0, loguru@==0.7.0, numpy@==2.2.4, opencv-python@==4.12.0.88, pandas@==2.2.1, pillow@==10.1.0, psycopg2-binary@==2.9.9, pytesseract@==0.3.10, python-dotenv, regex@==2026.1.15, requests, scikit-learn@==1.4.2, sentencepiece@==0.1.99, sqlalchemy@==2.0.32, torch@==2.2.2, torchaudio@==2.2.2, torchvision@==0.17.2, tqdm@==4.66.1, transformers@==4.43.0, uvicorn@==0.25.0
- server/package.json: cors@^2.8.5, dotenv@^17.2.3, express@^5.2.1, express-session@^1.18.2, mongodb@^7.0.0, mongoose@^9.1.4, passport@^0.7.0, passport-google-oauth20@^2.0.0

### Recent commits (newest first)

- Edited README
- final working version
- wip
- google and ingredients
- profile
- Revise README with project details and instructions
- stuff together
- Merge branch 'master' of https://github.com/Pinkspring01/Eatelligent
- Delete server/config.env
- Merge branch 'master' of https://github.com/Pinkspring01/Eatelligent
- pantry,fridge, gitignore
- Merge pull request #4 from Pinkspring01/mycode1
- CONFIG
- config
- Login Page II
- Login page
- Add new ingredient page and connected to button
- Linked fridge and recipes to homepage
- Fixed bug
- buggy

## Key source files (fetched from GitHub, selected and truncated for size)

### package.json

```
{
  "name": "cruzhacks2026",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "cors": "^2.8.5",
    "mongodb": "^7.0.0"
  }
}

```

### requirements.txt

```
numpy==2.2.4
torch==2.2.2
torchvision==0.17.2
torchaudio==2.2.2
transformers==4.43.0
accelerate==1.12.0
huggingface-hub==0.36.0
opencv-python==4.12.0.88
pillow==10.1.0
pytesseract==0.3.10
sentencepiece==0.1.99
ftfy==6.3.1
regex==2026.1.15
faiss-cpu==1.13.2
fastapi==0.115.0
uvicorn==0.25.0
sqlalchemy==2.0.32
psycopg2-binary==2.9.9
python-dotenv==1.0.1
requests==2.32.5
loguru==0.7.0
google-cloud-firestore==2.23.0
scikit-learn==1.4.2
pandas==2.2.1
tqdm==4.66.1
requests
python-dotenv


```

### server/package.json

```
{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "type": "module",
  "dependencies": {
    "cors": "^2.8.5",
    "dotenv": "^17.2.3",
    "express": "^5.2.1",
    "express-session": "^1.18.2",
    "mongodb": "^7.0.0",
    "mongoose": "^9.1.4",
    "passport": "^0.7.0",
    "passport-google-oauth20": "^2.0.0"
  }
}

```

### functions/package.json

```
{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "22"
  },
  "main": "index.js",
  "dependencies": {
    "firebase-admin": "^12.6.0",
    "firebase-functions": "^6.0.1"
  },
  "devDependencies": {
    "firebase-functions-test": "^3.1.0"
  },
  "private": true
}

```

### client/package.json

```
{
  "name": "client",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "expo": "^54.0.31",
    "react": "^19.2.0",
    "react-dom": "^19.2.0",
    "react-native-safe-area-context": "~5.6.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.39.1",
    "@tailwindcss/postcss": "^4.1.18",
    "@types/node": "^24.10.1",
    "@types/react": "^19.2.5",
    "@types/react-dom": "^19.2.3",
    "@vitejs/plugin-react": "^5.1.1",
    "autoprefixer": "^10.4.23",
    "eslint": "^9.39.1",
    "eslint-plugin-react-hooks": "^7.0.1",
    "eslint-plugin-react-refresh": "^0.4.24",
    "globals": "^16.5.0",
    "postcss": "^8.5.6",
    "react-router-dom": "^7.12.0",
    "tailwindcss": "^4.1.18",
    "typescript": "~5.9.3",
    "typescript-eslint": "^8.46.4",
    "vite": "^7.2.4"
  }
}

```

### EatelligentMobile/package.json

```
{
  "name": "eatelligentmobile",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "reset-project": "node ./scripts/reset-project.js",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "lint": "expo lint"
  },
  "dependencies": {
    "@expo/vector-icons": "^15.0.3",
    "@react-navigation/bottom-tabs": "^7.4.0",
    "@react-navigation/elements": "^2.6.3",
    "@react-navigation/native": "^7.1.8",
    "expo": "~54.0.31",
    "expo-constants": "~18.0.13",
    "expo-font": "~14.0.10",
    "expo-haptics": "~15.0.8",
    "expo-image": "~3.0.11",
    "expo-linking": "~8.0.11",
    "expo-router": "~6.0.21",
    "expo-splash-screen": "~31.0.13",
    "expo-status-bar": "~3.0.9",
    "expo-symbols": "~1.0.8",
    "expo-system-ui": "~6.0.9",
    "expo-web-browser": "~15.0.10",
    "react": "19.1.0",
    "react-dom": "19.1.0",
    "react-native": "0.81.5",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-reanimated": "~4.1.1",
    "react-native-safe-area-context": "~5.6.0",
    "react-native-screens": "~4.16.0",
    "react-native-web": "~0.21.0",
    "react-native-worklets": "0.5.1"
  },
  "devDependencies": {
    "@types/react": "~19.1.0",
    "@types/react-native": "^0.72.8",
    "eslint": "^9.25.0",
    "eslint-config-expo": "~10.0.0",
    "typescript": "~5.9.2"
  },
  "private": true
}

```

### functions/index.js

```javascript
/**
 * Import function triggers from their respective submodules:
 *
 * const {onCall} = require("firebase-functions/v2/https");
 * const {onDocumentWritten} = require("firebase-functions/v2/firestore");
 *
 * See a full list of supported triggers at https://firebase.google.com/docs/functions
 */

const {onRequest} = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");

// Create and deploy your first functions
// https://firebase.google.com/docs/functions/get-started

// exports.helloWorld = onRequest((request, response) => {
//   logger.info("Hello logs!", {structuredData: true});
//   response.send("Hello from Firebase!");
// });

```

### server/server.js

```javascript
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import session from "express-session";
import passport from "passport";
import mongoose from "mongoose";
import profile from "./routes/profile.js";
import recipeRoutes from "./routes/recipe.js";


// Load environment variables
dotenv.config({ path: './config.env' });


// Import routes
import records from "./routes/record.js";
import authRoutes from "./routes/auth.js";

// Import passport config
import passportConfig from "./config/passport.js";

const PORT = process.env.PORT || 5050;
const app = express();

app.use("/profile", profile);
app.use("/api", recipeRoutes);

// Connect to MongoDB
mongoose.connect(process.env.ATLAS_URI)
.then(() => console.log('MongoDB connected'))
.catch(err => console.error('MongoDB connection error:', err));

// Middleware
app.use(cors({
  origin: process.env.CLIENT_URL || 'http://localhost:5173',
  credentials: true
}));
app.use(express.json());

// Session middleware (must be before passport)
app.use(
  session({
    secret: process.env.SESSION_SECRET,
    resave: false,
    saveUninitialized: false,
    cookie: {
      maxAge: 24 * 60 * 60 * 1000 // 24 hours
    }
  })
);

// Passport middleware
app.use(passport.initialize());
app.use(passport.session());

// Passport config
passportConfig(passport);

// Routes
app.use("/ingredient", records);
app.use("/auth", authRoutes);

// Test route
app.get('/', (req, res) => {
  res.json({ message: 'Eatelligent API is running!' });
});

// Start server
app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});
```

### EatelligentMobile/app/_layout.tsx

```typescript
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import 'react-native-reanimated';

import { useColorScheme } from '@/hooks/use-color-scheme';

export const unstable_settings = {
  anchor: '(tabs)',
};

export default function RootLayout() {
  const colorScheme = useColorScheme();

  return (
    <ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
      <Stack>
        <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
        <Stack.Screen name="modal" options={{ presentation: 'modal', title: 'Modal' }} />
      </Stack>
      <StatusBar style="auto" />
    </ThemeProvider>
  );
}

```

### server/routes/server.js

```javascript
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import session from "express-session";
import passport from "passport";
import mongoose from "mongoose";

// Load environment variables
dotenv.config({ path: './config.env' });

// Import routes
import records from "./routes/ingredient.js";
import authRoutes from "./routes/auth.js";
import profileRoutes from "./routes/profile.js";
import recipeRoutes from "./routes/recipe.js";

// Import passport config
import passportConfig from "./config/passport.js";

const PORT = process.env.PORT || 5050;
const app = express();

// Connect to MongoDB
mongoose.connect(process.env.ATLAS_URI)
  .then(() => console.log('MongoDB connected'))
  .catch(err => console.error('MongoDB connection error:', err));

// Middleware - CORS MUST BE BEFORE ROUTES
app.use(cors({
  origin: 'http://localhost:5173', // Your frontend URL
  credentials: true // Allow cookies and authorization headers
}));
app.use(express.json());

// Session middleware (must be before passport)
app.use(
  session({
    secret: process.env.SESSION_SECRET || 'your-secret-key-here',
    resave: false,
    saveUninitialized: false,
    cookie: {
      maxAge: 24 * 60 * 60 * 1000 // 24 hours
    }
  })
);

// Passport middleware
app.use(passport.initialize());
app.use(passport.session());

// Passport config
passportConfig(passport);

// Routes
app.use("/ingredient", records);
app.use("/auth", authRoutes);
app.use("/profile", profileRoutes);
app.use("/api", recipeRoutes);

// Test route
app.get('/', (req, res) => {
  res.json({ message: 'Eatelligent API is running!' });
});

// Start server
app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});
```

[54 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]