Skip to content

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

  1. Create a Firebase Project: Head over to the Firebase Console and create a new project.

  2. 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

  3. Log in to Firebase: Authenticate the Firebase CLI with your Google account: sh firebase login

  4. Install the FlutterFire CLI: This tool is essential for configuring Firebase in a Flutter project. If the flutterfire command is not found afterwards, make sure Dart's global executable directory (~/.pub-cache/bin on Linux and macOS) is on your PATH: sh dart pub global activate flutterfire_cli

  5. 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 configure This command will automatically generate lib/firebase_options.dart and configure your Android and iOS apps.

  6. Download and Place Configuration Files (if needed): In most cases, flutterfire configure handles 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

Installation

  1. Clone the repo: sh git clone https://github.com/JoachimTislov/foodsavr.git cd foodsavr

  2. Get packages: sh flutter pub get

  3. Run it! The app requires a product flavor; flutter run without 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.