Documentation
Documentation
Introduction

Getting Started

Getting started
Getting StartedInstallationQuick StartProject Structure

Configuration

Configuration
ConfigurationEnvironment ConfigurationEdge ConfigDatabaseAuth SecretStripeFirebaseStorageGoogle Maps And Cloud Service AccountOAuth ProvidersEmail DeliverySentryFeature Flags

Architecture

Architecture
Architecture OverviewTech StackoRPC MiddlewareDesign Principles

Patterns

Patterns
Code Patterns & ConventionsFeature ModulesError HandlingType Safety

Database

Database
DatabaseSetupSchema DefinitionDatabase OperationsMigrationsCaching
Data Tables

API

oRPCProceduresRoutersoRPC Proxy Setup
APIsOpenAPIREST Endpoints

Auth & Access

AuthenticationConfigurationOAuth ProvidersRolesSession Management
AuthorizationUser RolesPermissions

Routing & i18n

RoutingDeclarative RoutingNavigation
InternationalizationTranslationsLocale Routing

Components & UI

ComponentsButtonsFormsNavigationDialogs
StylesTailwind CSSThemingTypography

Storage

Storage
StorageConfigurationUsageBuckets
Stripe Billing

Extra

Caching

Templates

Templates
Template GuidesCreate New FeatureCreate New PageCreate Database TableCreate oRPC RouterAdd Translations

Development

Development
DevelopmentCommandsAI AgentsBest Practices
Pulling Updates

Google Maps And Cloud Service Account

Configure maps API key, map style ID, and service account credentials

Variables

VariableRequiredPurpose
NEXT_PUBLIC_GOOGLE_MAPS_API_KEYYesBrowser API key for maps/places requests.
NEXT_PUBLIC_GOOGLE_MAP_IDConditionalRequired only for map view components that use styled map IDs.
GOOGLE_CLOUD_CLIENT_EMAILYesService account client_email.
GOOGLE_CLOUD_PRIVATE_KEYYesService account private_key.

Enable APIs

  1. Open https://console.cloud.google.com/welcome.
  2. Select your project.
  3. In the top search bar, type Maps and open the APIs & Services result (Google Maps icon).
  4. In APIs & Services, open Library.
  5. Enable required APIs:
    • Geolocation API
    • Geocoding API
    • Places API
    • Places API (New)
    • Maps JavaScript API
    • Maps Embed API
    • Directions API (optional)

Some map APIs may require billing to be enabled on the Google Cloud project.

Create Maps API Key

  1. In Google Cloud search bar, type APIs & Services.
  2. Open Credentials.
  3. Click Create credentials -> API key.
  4. Give the key a name.
  5. In application restrictions, choose:
    • no restrictions, or
    • HTTP referrers with localhost:3000 and your production domain.
  6. In API restrictions, allow only the map APIs you enabled above.
  7. Copy key into NEXT_PUBLIC_GOOGLE_MAPS_API_KEY.

Create Map Style ID

  1. Open Google Maps Platform.
  2. Go to Styles (map styles).
  3. Click Create map style.
  4. Save style with a name.
  5. Copy style/map ID into NEXT_PUBLIC_GOOGLE_MAP_ID.

Service Account Credentials

  1. Open Firebase console for the same project.
  2. Go to Project Settings -> Service Accounts.
  3. Click Generate new private key.
  4. Confirm key generation and download the JSON file.
  5. Extract fields:
    • JSON client_email -> GOOGLE_CLOUD_CLIENT_EMAIL
    • JSON private_key -> GOOGLE_CLOUD_PRIVATE_KEY
GOOGLE_CLOUD_CLIENT_EMAIL="firebase-adminsdk-xxx@project-id.iam.gserviceaccount.com"
GOOGLE_CLOUD_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

Private Key Newlines

Keep newline formatting intact. If stored with escaped \n, runtime parsing should convert it back to real newlines.

Screenshots

Google Cloud search for maps platform

Google Cloud search for APIs and services

Google Cloud create credentials menu

On this page

Variables
Enable APIs
Create Maps API Key
Create Map Style ID
Service Account Credentials
Screenshots