Getting Started
Want to tinker with the code? Here's how to get a dev environment up and running.
Prerequisites
You'll need the Flutter SDK on your machine. If you don't have it, the official guide is the way to go:
You'll also need a Firebase project.
Firebase Setup
-
Create a Firebase Project: Head over to the Firebase Console and create a new project.
-
Install the Firebase CLI: If you don't have it, install the Firebase command-line tool. This requires Node.js and npm:
sh npm install -g firebase-tools -
Log in to Firebase: Authenticate the Firebase CLI with your Google account:
sh firebase login -
Install the FlutterFire CLI: This tool is essential for configuring Firebase in a Flutter project. If the
flutterfirecommand is not found afterwards, make sure Dart's global executable directory (~/.pub-cache/binon Linux and macOS) is on yourPATH:sh dart pub global activate flutterfire_cli -
Configure Firebase for the App: From the root of the project, run the following command and follow the prompts to select your Firebase project:
sh flutterfire configureThis command will automatically generatelib/firebase_options.dartand configure your Android and iOS apps. -
Download and Place Configuration Files (if needed): In most cases,
flutterfire configurehandles everything. However, if you need to manually add the configuration files, download them from your Firebase project settings and place them as follows:- Android:
android/app/google-services.json - iOS:
ios/Runner/GoogleService-Info.plist
- Android:
Installation
-
Clone the repo:
sh git clone https://github.com/JoachimTislov/foodsavr.git cd foodsavr -
Get packages:
sh flutter pub get -
Run it! The app requires a product flavor;
flutter runwithout one fails on non-web platforms.sh flutter run --flavor development
Running on the Web
For quick iteration in a browser, use:
make dev-chrome
To build a release web bundle locally (same command CI uses for the web artifact) and serve it:
make serve-web
If you will host the bundle under a subpath (like GitHub Pages does), set the base href to match:
make serve-web BASE_HREF=/foodsavr/
Published documentation and web builds
GitHub Pages hosts the app's vision,
canonical specification, and contributor documentation. It does not run the
Flutter app. The Documentation Pages workflow builds pull requests and deploys
trusted main changes; it is the only Pages deployment owner.
The Web Build workflow still compiles the Flutter app and uploads its
web-build artifact. Download that artifact from a successful workflow run
or use make serve-web for a local browser preview.
To build the documentation locally, run:
python3 -m venv /tmp/foodsavr-docs-venv
/tmp/foodsavr-docs-venv/bin/pip install -r scripts/docs/requirements.txt
/tmp/foodsavr-docs-venv/bin/python scripts/docs/prepare.py
/tmp/foodsavr-docs-venv/bin/python -m mkdocs build --strict
/tmp/foodsavr-docs-venv/bin/python scripts/docs/check_site.py build/docs-site
The build stages existing repository sources in build/docs-source and writes
the site to build/docs-site. Edit the original Markdown, schemas, or contracts;
generated copies aren't maintained separately. The landing page source is
doc/pages-home.md. Code and directory links open their repository sources.