Geo Engine Docs

Copy into your app

Reusable address picker

This is an optional copyable React component example, not a requirement for using Geo Engine. It loads a country’s root areas, then the selected area’s direct children. Use Geocoding separately for street, building, and coordinate completion.

Load the Philippines address data

The Geo Engine repository already includes the Philippines region, province, city, district, and barangay JSON seed files under src/seed/address/json. They were prepared from the philippine-addresses project. You do not need to download a dataset separately.

Start PostgreSQL and configure the repository's existing database connection. From the repository root run make seed_address, or from the web-app directory run make seed-address. This applies the address migration and seeds the catalog. The seed can be run again safely to fill in missing source rows.

For the live API examples and picker, start Geo Engine and create the local development credentials with NODE_ENV=development and make app_seed_dev from the repository root, or make seed-dev-apps from web-app. Put the printed postman app ID and key in web-app/.env.local, then restart Next.js.

GEO_ENGINE_BASE_URL=http://localhost:8000
GEO_ENGINE_APP_ID=postman
GEO_ENGINE_API_KEY=<credential-id>.<secret>

The browser examples call the web app's same-origin proxy. It adds these credentials on the server. See the authentication setup for details.

Copy the address-picker folder from GitHub into your React app and customize it for your own form and design system. This component is one client-side example; if it needs adaptation, the headless Address API still works with any frontend or server client.

Loading address options…

Selection payload

This is the value your form can save.

null

Supporting packages and shadcn UI

The picker uses Button, Label, Popover, and Command. Copy Dialog too because the existing Command primitive imports it.

pnpm add cmdk lucide-react @radix-ui/react-popover @radix-ui/react-dialog @radix-ui/react-label @radix-ui/react-slot class-variance-authority clsx tailwind-merge

Copy the five shadcn UI files and the address-picker folder. Configure the @/* alias for src/* or adjust imports. Keep the shadcn CSS variables mapped in Tailwind and copy the cn helper from src/lib/utils.ts.

React integration

Point the client to your BFF. It should attach the Geo Engine app credentials server-side.

'use client';

import { useMemo } from 'react';
import {
  AddressPicker,
  createAddressPickerClient,
} from '@/components/customs/address-picker';

export function ShippingAddressFields() {
  const client = useMemo(
    () => createAddressPickerClient('/api/geo'),
    [],
  );

  return (
    <AddressPicker
      client={client}
      initialSelection={{ countryCode: 'PH', areaCode: 'PH-000001' }}
      onChange={(selection) => saveAddress(selection)}
    />
  );
}

For hosting, set GEO_ENGINE_BASE_URL, GEO_ENGINE_APP_ID, and GEO_ENGINE_API_KEY as server-side environment variables in the web app deployment. The proxy never forwards BYOK credentials.