FoodSnap is a mobile application designed to help users identify and track their food intake through image recognition technology. The app allows users to capture or upload images of their food, recognize the food items, and get detailed nutritional information.
- Food Recognition: Uses machine learning to identify food items from images.
- Nutritional Tracking: Tracks the nutritional value of identified foods.
- User Profiles: Allows users to create and manage their profiles.
- History Log: Keeps a history of all recognized food items and their nutritional information.
To set up the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/Food-Snap/mobile-app.git
- Navigate to the project directory:
cd mobile-app
- Copy
local.properties.example
tolocal.properties
:cp local.properties.example local.properties
- Update the configuration values as needed.
- Open the project in Android Studio.
- Ensure you have the required dependencies and SDK versions installed.
Watch the demo video of the FoodSnap app here.
You can download the APK of the FoodSnap app here.
This repository contains the backend service for the FoodSnap application. The backend service is built with Node.js, Express, and deployed on Google Cloud App Engine. It handles user authentication, food prediction, and history tracking.
- Prerequisites
- Installation
- Running the Application Locally
- Deployment
- API Endpoints
- Environment Variables
- Node.js (14 or higher)
- npm (6 or higher)
- Google Cloud Project with App Engine, Cloud Storage, Firestore enabled
- Clone the repository
git clone https://github.com/your-username/foodsnap-backend.git cd foodsnap-backend
- Install Dependencies
npm install
- Create a .env file in the root directory and add the following environment variables
GCLOUD_PROJECT_ID=your_gcloud_project_id GCLOUD_KEY_FILE=/path/to/serviceAccountKey.json GCLOUD_STORAGE_BUCKET=your_gcloud_storage_bucket_name JWT_SECRET=your_jwt_secret PORT=8080
- Start the application
npm run start
- Access the application Open your browser and navigate to http://localhost:8080
- Activate Cloud App Engine
- Create app.yaml file
- Deploy using Google Cloud CLI
gcloud app deploy
- POST /signup - Register a new user
- POST /login - Authenticate a user and return a token
- GET /profile - Get the user profile
- PUT /edit-profile - Update the user profile
- PUT /change-password - Change the user password
- GET /food - Get the list of food
- GET /food/{id} - Get Food Detail with id
- POST /predict - Preduct the food image and return food data
- GET /history - Get the user's food history
- POST /save - Save the prediction result to history
Make sure to set the following environment variables in your .env file or through your deployment platform:
- GCLOUD_PROJECT_ID : your Google Cloud Project ID
- GCLOUD_KEY_FILE : Path to your Google Cloud Service Account Key
- GCLOUD_STORAGE_BUCKET: Name of your Google Cloud Storage Bucket
- JWT_SECRET : Secret key for JWT authentication
- PORT : Port in which the app will run (default is 8080)