Skip to content

google/ground-platform

Ground

Open Source Helpers

Ground is a map-first data collection platform which seamlessly connects the offline world with cloud-based storage and computation. It addresses the needs of non-technical local community members, smallholder farmers, and professionals and researchers working in the areas of climate, sustainability, and humanitarian aid. It consists of a web app for survey management, and an Android app for offline data collection backed by Firebase.

Note: Ground is not an officially supported product; it is being developed and maintained on a best-effort basis.

About this repository

This repo contains Ground's hosted components and related docs:

Directory Component
docs/ Public documentation, including Ground homepage
firestore/ Firestore config defining Firebase rules and other database settings
functions/ Firebase Cloud Functions, used to sync with Google Sheets and import/export data to/from other data sources
lib/ Ground TypeScript libs, used by both web and functions
proto/ Ground data model, shared between web and mobile apps and used to infer the structure of data in Firestore
storage/ Firebase Storage config for offline imagery and user photo storage
web/ Ground web console used to set up and manage surveys, and to view, edit, and analyze collected data online

Contributing guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

Quick start

One time setup

  1. Install nvm
  2. Install Node.js:
nvm install 20
  1. Install Firebase CLI and Nx:
npm install -g firebase-tools nx

Build and run locally

  1. Install dependencies:
npm install
  1. Build and start local Firebase emulator and Angular dev server:
nx start
  1. Once started, the app will be available at http://localhost:4200. For development, and testing, the Firebase Emulator Suite UI is accessible at http://localhost:4000. Changes to the web app in web/ and to the Cloud Functions in functions/ are automatically rebuilt and reloaded on save.

Note: The local build variant doesn't require API keys to run, but warnings related to missing Maps API keys will appear in the console. Authentication is also disabled.

The local emulator is preloaded with a demo survey. Run nx export to save the updated demo data to the local filesystem for use on the next run.

Run against live staging environment

Members of the core maintainers team can run the app against the live staging environment with:

nx run web:serve:staging

Deploy

To build and deploy to staging, first sign into Firebase with:

npx firebase login

You can then deploy to prod with:

nx run deploy:staging

To deploy to your own production Firebase:

  1. Override firebaseConfig in environment.production.ts with your Firebase project config.
  2. Update the project ID placeholder in package.json.
  3. Run nx run deploy:production.

Next steps

For instructions on how to deploy to your own production Firebase project, see the Ground Developer's Guide.