OOOC Fête Finder supports three data modes controlled by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/KingPsychopath/oooc-fete-finder/llms.txt
Use this file to discover all available pages before exploring further.
DATA_MODE environment variable. Each mode determines the primary source and fallback chain for live event reads.
Available modes
Remote mode
Value:DATA_MODE=remote
Default: Yes (when DATA_MODE is unset in development)
Recommended for: Production and preview deployments
Remote mode uses a two-tier source chain with automatic fallback:
- Primary: Postgres event store (managed via admin)
- Fallback: Local CSV file (
data/events.csv) if Postgres is unavailable
Remote mode is the required mode for Vercel preview and production deployments. Missing or invalid
DATA_MODE in these environments triggers a startup failure.- Production deployments with Postgres configured
- Environments where admin-managed content is the source of truth
- Applications requiring real-time event updates via admin panel
DATABASE_URLmust be configured for Postgres reads- Local CSV file (
data/events.csv) should exist as a fallback safety net
“Managed store unavailable; serving local CSV fallback (stale-safe mode).”This ensures the site remains functional even during database outages, though the data may be stale.
Local mode
Value:DATA_MODE=local
Recommended for: Local development without Postgres
Local mode reads events exclusively from the local CSV file at data/events.csv.
Source priority:
When to use:
- Local development without a Postgres connection
- Testing with a static dataset
- Environments where admin-managed content is not needed
data/events.csvmust exist and contain valid event data
- No Postgres connection required
- No fallback chain (local CSV is the only source)
- Coordinate population is disabled by default in local mode
Test mode
Value:DATA_MODE=test
Recommended for: Automated testing and CI/CD pipelines
Test mode uses in-memory static data from data/events.ts without reading files or databases.
Source priority:
When to use:
- Automated tests (Jest, Playwright, etc.)
- CI/CD environments without database access
- Development scenarios requiring deterministic test data
- No file reads
- No database connections
- Instant data availability (no I/O)
- Deterministic and reproducible results
Test mode is ideal for integration and E2E tests where you need predictable event data without external dependencies.
Mode comparison
| Feature | Remote | Local | Test |
|---|---|---|---|
| Primary source | Postgres store | Local CSV | In-memory data |
| Fallback source | Local CSV | None | None |
| Admin management | ✅ Yes | ❌ No | ❌ No |
| Requires DATABASE_URL | ✅ Yes | ❌ No | ❌ No |
| Coordinate population | ✅ Enabled | ❌ Disabled | N/A |
| Real-time updates | ✅ Yes | ❌ No | ❌ No |
| Stale-safe fallback | ✅ Yes | ❌ No | ❌ No |
| Production use | ✅ Required | ❌ Not recommended | ❌ Not recommended |
Data flow in remote mode
Remote mode follows this detailed flow:- Request initiated: Server component or API route calls
DataManager.getEventsData() - Try Postgres store:
- Query
LocalEventStore.getCsv()for event sheet data - Process CSV data with
processCSVData() - Hydrate event keys and validate data
- Populate coordinates from KV cache (if geocoding enabled)
- Query
- On Postgres success: Return events with source
"store" - On Postgres failure:
- Log failure reason
- Attempt local CSV fallback at
data/events.csv
- On local CSV success: Return events with source
"local"and stale-safe warning - On both failures: Return empty data with error messages
Coordinate population in remote mode is durable and KV-backed (
maps:locations:v1). Coordinates are prewarmed on admin writes to reduce live geocoding churn.Runtime validation
All modes validate event data after loading:- Row count check: Must return at least 1 event
- Schema validation: Events must match the
Eventtype - Required fields: Each event must have
Event Key,Venue, etc.
Configuration examples
Production setup (remote mode)
Production setup (remote mode)
Local development (local mode)
Local development (local mode)
data/events.csv without requiring Postgres.Testing (test mode)
Testing (test mode)
Switching modes
To switch data modes:- Update
DATA_MODEin your.envfile or deployment platform - Restart the development server or redeploy
- Verify the mode in admin at
/admin/operations→ Data Store Status
The active data mode and current source are displayed in the startup banner and in the admin Operations panel.
Production requirements
Troubleshooting
Startup failure: Missing DATA_MODE
Startup failure: Missing DATA_MODE
Error message:
Missing required DATA_MODE in production. Set DATA_MODE to remote, local, or test.Solution: Add
DATA_MODE=remote to your production environment variables and redeploy.Remote mode falls back to local CSV
Remote mode falls back to local CSV
Warning message:
Managed store unavailable; serving local CSV fallback (stale-safe mode).Possible causes:
DATABASE_URLnot configured- Postgres connection failure
- Event store tables not initialized
- Verify
DATABASE_URLis set correctly - Run
pnpm bootstrap:postgres-storeto seed the event store - Check database connectivity with
pnpm health:check
Local mode returns no events
Local mode returns no events
Error message:
Local CSV fallback failed: [specific error]Possible causes:
data/events.csvdoes not exist- CSV file is empty or malformed
- CSV headers do not match expected schema
- Verify
data/events.csvexists in the project root - Check CSV headers match the expected schema
- Ensure at least one valid event row exists
Related configuration
- Environment variables - Complete environment variable reference
- Caching policy - ISR and revalidation behavior