geovault

GeoVault — Development Guide

Project Overview

GeoVault is a privacy-first, zero-backend personal location notebook built with React Native (Expo). All data lives on the user’s device. Google Drive backup is optional and uses the REST API directly from the client — no server involved.

Tech Stack

Architecture

Zero-Backend Constraint

All features must work client-side only. Never suggest server-side components, hosted databases, or third-party APIs with usage fees. Google Drive backup uses the REST API directly from the client with OAuth tokens managed by the native SDK.

Directory Structure

app/                    # expo-router screens (file-based routing)
  (tabs)/               # Bottom tab navigator (Places, Search, Settings)
  place/                # Place CRUD screens ([id], new, edit/[id])
src/
  db/                   # SQLite database layer (database, migrations, repositories, seed)
  services/             # Business logic
    url-parser.service.ts       # Google/Apple Maps URL parsing
    export.service.ts           # JSON export/import
    google-auth.service.ts      # Google Sign-In wrapper
    google-drive.service.ts     # Drive REST API (list, upload, download, delete)
    backup.service.ts           # Backup orchestration (performBackup, performRestore)
    auto-backup.service.ts      # Background fetch task registration
  stores/               # Zustand state stores
    places.store.ts             # Places with pagination (PAGE_SIZE=30)
    search.store.ts             # Search with pagination
    settings.store.ts           # Theme, auto-backup preferences
    backup.store.ts             # Google Drive backup state
  components/           # Reusable UI components
  constants/            # Categories, tags, theme colors
  types/                # TypeScript interfaces (place.types, backup.types)
  utils/                # Helpers (uuid, date formatting)

Database

State Management

Zustand stores are thin caches over SQLite. Places and search use pagination (30 items per page) with infinite scroll. Backup store is the exception — it handles async Google API calls with loading states.

Google Drive Backup

Icons

Dialogs

Code Standards

Type Safety

Error Handling

Accessibility

Styling

Performance

Commands

npx expo start              # Start dev server (JS only, no native modules)
npx expo run:ios            # Build and run on iOS (required for native modules)
npx expo run:android        # Build and run on Android (required for native modules)
npx expo prebuild           # Generate native projects
npx expo prebuild --clean   # Regenerate native projects from scratch
node node_modules/typescript/bin/tsc --noEmit   # Type check
npx expo export --platform ios                  # Test production bundle

Important: Google Sign-In and Background Fetch require development builds (run:android/run:ios). They do NOT work with Expo Go or npx expo start.

Key Files

Google Cloud Console Setup

The app uses these OAuth client IDs (project: GeoVault):

OAuth consent screen scope: https://www.googleapis.com/auth/drive.appdata

Adding New Features

  1. Add DB migration in src/db/migrations.ts and bump version in database.ts
  2. Add/update repository methods in src/db/
  3. Update types in src/types/
  4. Create/update screen in app/
  5. Use StatusDialog/ConfirmDialog for user feedback — never Alert.alert()
  6. Run tsc --noEmit to verify zero type errors
  7. Test on both iOS and Android via npx expo run:*

Dev Tools

In development (__DEV__), Settings shows a “DEV TOOLS” section with:

Seed data is in src/db/seed.ts and only runs when manually triggered.