Getting Started - jariwala-jay/food-rx-app GitHub Wiki
This guide will walk you through setting up the Food Rx project on your local machine for development.
- An understanding of Flutter and Dart.
- Flutter SDK installed (version >=3.0.0 <4.0.0).
- An IDE like VS Code or Android Studio with the Flutter plugin.
- Access to a MongoDB instance, Spoonacular API key, and a Google Cloud Platform project with Dialogflow enabled.
Clone the project to your local machine:
git clone <your-repository-url>
cd food-rx-app
Install the required Dart packages as defined in pubspec.yaml
:
flutter pub get
The application uses environment variables to manage sensitive keys and configuration details.
-
Create a file named
.env
in the root directory of the project. -
Copy the contents of
.env.example
(or create from scratch) and fill in the values. The app requires the following variables:# Spoonacular API Key for recipe and ingredient data SPOONACULAR_API_KEY="YOUR_SPOONACULAR_API_KEY" # MongoDB Connection String MONGODB_URL="mongodb+srv://<user>:<password>@<cluster-uri>/<database-name>?retryWrites=true&w=majority" # Dialogflow Configuration DIALOGFLOW_PROJECT_ID="your-gcp-project-id" DIALOGFLOW_AGENT_ID="your-dialogflow-agent-id" DIALOGFLOW_LOCATION="global" # Or your specific location DIALOGFLOW_LANGUAGE_CODE="en"
-
Dialogflow Service Account: Place your Google Cloud service account JSON key file in
assets/dialogflow_auth.json
. This file is used by theDialogflowService
to authenticate requests.
Security Note: The
.env
anddialogflow_auth.json
files are included in the.gitignore
and should never be committed to version control.
Once the setup is complete, you can run the application on a connected device or simulator:
flutter run
The application uses provider
for state management. The main providers and services are initialized in lib/main.dart
. The app will start with a LoginPage
and navigate to the MainScreen
upon successful authentication.