Prerequisites
Before you begin, make sure you have the following:- Node.js (v20 or higher recommended)
- npm (bundled with Node.js)
- Google Gemini API key — a free tier key from Google AI Studio is sufficient for local development
If you don’t have a Gemini API key yet, you can still run Postcard in fake mode using mock data — no key required.
Installation
Install Playwright browsers
Postcard requires specifically configured browser binaries for forensic scraping. Install them with:
Playwright is used by the automated test suite (
npm run test) to run end-to-end tests of the forensic pipeline and UI flows.Configure environment variables
Copy the environment template to create your local Open See Environment variables for a full reference of all available options.
.env file:.env and set your Gemini API key for live pipeline mode:Initialize the database
Sync the schema to your local SQLite file:This creates a
local.db file in the project root. No external database service is required for local development.Fake mode
SetNEXT_PUBLIC_FAKE_PIPELINE=true in your .env to run the full UI without a real Gemini API key or live scraping. All forensic stages return mock data instantly.
.env.example and is useful for rapid UI development or demos. To simulate a processing delay or failure, use the related variables:
Verification
Run lint and type checks to confirm your environment is configured correctly:src, app, and components, followed by a TypeScript type check with no emitted output.