Skip to content

Crunklin/uap-research

Repository files navigation

UAP Research Platform

A web application for browsing, searching, and analyzing declassified UAP/UFO documents. Built with Next.js, Supabase, and Tailwind CSS.

Features

  • Dashboard — Stats overview with charts showing document counts by agency, type, sensor, and classification level
  • Document Browser — Filterable, paginated list of all documents with search
  • Document Detail — Full metadata, AI-generated analysis, cross-references, and extracted text
  • Map View — Interactive Leaflet map with clustered markers for geolocated sightings
  • Timeline — Chronological view of documents grouped by year, filterable by date type
  • Full-Text Search — PostgreSQL tsvector search with weighted results and ILIKE fallback
  • AI Analysis — One-click Claude API analysis that extracts structured metadata from document text

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Database: Supabase (PostgreSQL)
  • Styling: Tailwind CSS (dark theme)
  • Maps: Leaflet + react-leaflet with marker clustering
  • Charts: Recharts
  • AI: Claude API (Anthropic)
  • Hosting: Vercel

Setup

1. Clone and install

cd web
npm install

2. Create a Supabase project

Go to supabase.com, create a new project, then run the schema migration. In the Supabase dashboard, go to SQL Editor and paste the contents of supabase/migrations/001_schema.sql, then click Run.

3. Set environment variables

Copy the example env file and fill in your keys:

cp .env.local.example .env.local

Edit .env.local with your values:

  • NEXT_PUBLIC_SUPABASE_URL — from Supabase project settings > API
  • NEXT_PUBLIC_SUPABASE_ANON_KEY — from Supabase project settings > API
  • SUPABASE_SERVICE_ROLE_KEY — from Supabase project settings > API (keep secret)
  • ANTHROPIC_API_KEY — from console.anthropic.com (optional, for AI analysis)

4. Load data

The seed script reads existing JSON data files and pushes them to Supabase:

pip install requests
python supabase/seed.py

This loads documents from ../dashboard/uap_data.json, ../dashboard/data/documents.json, video and image metadata, cross-references, and extracted text files.

5. Run locally

npm run dev

Open http://localhost:3000.

6. Deploy to Vercel

Push to GitHub and import the repository in vercel.com. Set the same environment variables in the Vercel project settings. The root directory should be set to web.

Project Structure

web/
  src/
    app/
      page.tsx              # Dashboard
      documents/
        page.tsx            # Document browser
        [id]/page.tsx       # Document detail
      map/page.tsx          # Map view
      timeline/page.tsx     # Timeline view
      search/page.tsx       # Full-text search
      api/
        documents/          # GET list, GET single
        search/             # Full-text search endpoint
        map-data/           # Geolocated documents
        timeline/           # Timeline entries
        stats/              # Dashboard statistics
        crossrefs/          # Cross-references
        analyze/            # Claude AI analysis (POST)
    components/
      Sidebar.tsx           # Navigation sidebar
      DocumentCard.tsx      # Document card component
      MapView.tsx           # Leaflet map with clustering
      DashboardCharts.tsx   # Recharts dashboard charts
      FilterBar.tsx         # Agency/type filters
      SearchBar.tsx         # Search input
      StatCard.tsx          # Statistics card
    lib/
      supabase.ts           # Supabase client (browser + server)
      types.ts              # TypeScript interfaces
  supabase/
    migrations/
      001_schema.sql        # Database schema
    seed.py                 # Data migration script

API Routes

All API routes return JSON.

Method Path Description
GET /api/documents?page=0&limit=24&agency=... List documents with filters
GET /api/documents/[id] Single document with crossrefs and text
GET /api/search?q=... Full-text search
GET /api/map-data Documents with coordinates
GET /api/timeline Timeline entries
GET /api/stats Dashboard statistics
GET /api/crossrefs/[id] Cross-references for a document
POST /api/analyze/[id] Trigger Claude AI analysis

About

UAP Research Platform - Next.js + Supabase document analysis and visualization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors