NutriScan is an AI-powered platform that helps users make informed dietary choices by scanning or uploading images of food and medicine labels. It provides detailed nutritional information, allergen alerts, and dietary suitability based on health conditions. NutriScan also suggests healthier alternatives to promote better dietary habits.
. Create a .env
file:
Before running the project, you need to create a .env
file in the server
directory with the following environment variables:
DJANGO_SECRET_KEY='<your_django_secret_key>'
DJANGO_DEBUG=True
EMAIL_HOST_USER='<your_email_host_user>'
EMAIL_HOST_PASSWORD='<your_email_host_password>'
GOOGLE_API_KEY='<your_google_api_key>'
To generate a new Django secret key, you can use one of the following methods:
-
Using an Online Tool:
- Visit a tool like Django Secret Key Generator.
- Generate a key and copy it.
-
Using Python Code:
-
Run the following Python code in your local environment:
from django.core.management.utils import get_random_secret_key print(get_random_secret_key())
-
Copy the generated key.
-
-
Update Your
.env
File:-
Paste the copied key into your
.env
file as theDJANGO_SECRET_KEY
:DJANGO_SECRET_KEY='<your_generated_secret_key>'
-
This key is used by Django for cryptographic signing and should be kept secure.
To obtain a Google API Key, follow these steps:
-
Go to the Google Cloud Console:
- Visit the Google Cloud Console.
-
Create or Select a Project:
- Create a new project or select an existing project from the project dropdown.
-
Navigate to Credentials:
- Go to APIs & Services > Credentials.
-
Create a New API Key:
- Click on Create Credentials and select API Key.
- A new API key will be generated and displayed.
-
Copy the API Key:
- Copy the generated API key.
-
Update Your
.env
File:-
Paste the copied key into your
.env
file asGOOGLE_API_KEY
:GOOGLE_API_KEY='<your_generated_api_key>'
-
This API key is used to access Google services and should be kept secure.
-
To configure email sending through Gmail, follow these steps:
-
Use Your Gmail Address:
-
Set your Gmail address as the
EMAIL_HOST_USER
in your.env
file.EMAIL_HOST_USER='<your_gmail_address>'
-
-
Set Up 2-Step Verification:
- Go to your Google Account Security settings.
- Enable 2-Step Verification if it is not already set up.
-
Generate an App Password:
- Navigate to the App Passwords page in your Google Account.
- Select Mail as the app and Other (or the device you are using) as the device.
- Click Generate to create a new app password.
-
Copy and Use the App Password:
-
Copy the generated app password.
-
Paste this password into your
.env
file asEMAIL_HOST_PASSWORD
:EMAIL_HOST_PASSWORD='<your_generated_app_password>'
-
This password is used to authenticate your email sending and should be kept secure.
-
To set up and run NutriScan locally, follow these steps:
- Install Docker Desktop: Ensure that Docker Desktop is installed on your system. You can download it here.
- Clone the repository:
git clone https://github.com/yourusername/nutriscan.git](https://github.com/Fareed95/NutriScan.git cd nutriscan
- START THE PROJECT
docker compose up --build