← Back to Home

Veritas ID

Documentation

Installation

Prerequisites

Step 1 — Clone the Repository

git clone https://github.com/[your-repo]/veritas-id
cd veritas-id

Step 2 — Install Dependencies

npm install

Step 3 — Configure Environment Variables

Create a .env.local file in the root directory and add the following:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
ANTHROPIC_API_KEY=your_anthropic_api_key
NEXT_PUBLIC_BASE_URL=http://localhost:3000

Step 4 — Set Up the Database

Open your Supabase project. Navigate to the SQL Editor. Run the schema found in /lib/supabase.ts at the top of the file as a comment.

Step 5 — Run the Application

npm run dev

Open http://localhost:3000

Step 6 — Deploy to Vercel (Optional)

  1. Push your repository to GitHub.
  2. Connect the repository to Vercel.
  3. Add all environment variables in Vercel project settings.
  4. Deploy.

Architecture Overview

Veritas ID is a single Next.js 14 application using the App Router. All frontend, backend logic, and API routes live within one codebase deployed on Vercel.

Stack

Generation Flow

  1. User submits a natural language query
  2. Claude API extracts indicator, country, and year range from the query
  3. World Bank Open API returns verified data
  4. SHA256 hash is computed from data values
  5. Unique Veritas ID is generated: VID-[COUNTRY]-[INDICATOR]-[HASH PREFIX]
  6. Record stored in Supabase with full data snapshot, hash, and metadata
  7. QR code generated pointing to verification portal
  8. Chart rendered as screenshot-ready artifact

Verification Flow — Image Upload

  1. User uploads a chart screenshot
  2. Single Claude Vision API call extracts Veritas ID and data values simultaneously
  3. Supabase queried using extracted ID
  4. Extracted values compared against stored values with ±1.0 tolerance
  5. Result: Authentic or Tampered

Verification Flow — ID Lookup

  1. User enters Veritas ID manually
  2. Supabase queried
  3. Original chart retrieved and displayed

Data360 API Integration Methodology

Veritas ID uses the World Bank Open API v2 as its verified data source. No authentication required.

Base URL

https://api.worldbank.org/v2

Query Format

https://api.worldbank.org/v2/country/{countryCode}/indicator/{indicatorCode}?date={startYear}:{endYear}&format=json&per_page=100

Supported Indicators

Natural Language Mapping

Claude API interprets user queries using a hybrid approach. Claude extracts intent from natural language. A deterministic mapping layer resolves the exact World Bank indicator code. Claude never directly handles API codes, preventing hallucination and ensuring consistent data retrieval.

Data Processing


Security and Data Handling Protocols

API Key Security

Data Integrity

Tamper Detection

Data Privacy

← Back to Home