Skip to content
Rachel Fryan edited this page Jan 22, 2026 · 5 revisions

Tenant Lookup System

The application uses Vercel Edge Config for fast, globally distributed tenant lookups.

How It Works

The system operates with these priorities:

  1. Edge Config Lookup (primary) - Fast tenants lookup (~10ms globally)
  2. Cached API Route (fallback) - Database query with 5-minute cache when Edge Config fails

Infra

We have two edge config stores in Vercel:

  1. For prod environment avy-edge-config-prod

  2. For preview environments avy-edge-config-preview

    NOTE: This should also be used for local dev. Our preview environments still use our seed script so these values should be in sync with our local environments. The preview edge config can updated manually in Vercel if you need additional tenants in your local env.

Enabling pre-commit hook with Husky

This repo uses Husky and lint-staged to run a pre-commit hook that affects staged files. This ensures code formatting consistency across the project. Our pre-commit hook formats staged files before committing.

The pre-commit hook is automatically configured when you run pnpm install. If it's not running, manually configure it:

pnpm prepare

Static Generation and Revalidation

This application uses Next.js Incremental Static Regeneration (ISR) for optimized performance.

See Revalidation Documentation for details on cache strategies and invalidation patterns.

Using Claude via GitHub Issues

Approved team members (part of the claude-users team) can request code changes by creating GitHub issues mentioning @claude.

See Claude GitHub Issues Guide for detailed instructions and best practices.

Reviewing Pull Requests with Turso

When reviewing PRs with significant database changes, you can clone the preview database instead of re-seeding:

# Install turso CLI
# (See https://docs.turso.tech/cli/installation)

# Clone the preview database locally
branch="skuznets/some-feature-thing"
turso db shell "payloadcms-preview-${branch//[^a-z0-9\-]/x}" .dump | sqlite3 dev.db
This is faster than running the seed script when reviewing pull requests.

Clone this wiki locally