DATARIOT Internal Docs

System Overview

Datariot is a cross-platform educational short-video platform built with a modern mobile-first stack. It focuses on structured intellectual discourse and AI-guided synthesis of knowledge.

Tech Stack

Layer Technology
Frontend React Native + Expo (v50+)
Navigation Expo Router (File-based)
Backend Supabase (PostgreSQL, Auth, Storage)
AI Engine OpenAI GPT-4 / Anthropic Claude
State Zustand

Project Structure

The repository follows a monorepo-lite structure managed by Vercel subdomains.

/datariot
├── datariot-docs/    # This documentation site
├── datariot-info/    # Main landing page (marketing)
├── datariot-xyz/     # Production web build of the Expo app
├── src/              # Expo application source code
│   ├── app/          # Expo Router pages
│   ├── components/   # UI components
│   ├── lib/          # Utilities (Supabase, API clients)
│   └── constants/    # Global constants & Theme
├── vercel.json       # Routing & subdomain configuration
└── package.json      # Main project dependencies
                

Backend Setup (Supabase)

Follow these steps to initialize the database and services on Supabase.

1. Database Initialization

Execute the schema found in src/lib/supabase/schema.sql using the Supabase SQL Editor to create all necessary tables, relationships, and RLS policies.

2. Storage Buckets

Create a public bucket named videos for hosting video assets.

Operation Policy
SELECT Public (All)
INSERT Authenticated User
DELETE Owner / Admin

Database Schema

The core tables and their primary fields are detailed below. For the full OpenAPI specification, refer to full_db_schema.json.

Table Description
profiles User profiles, avatars, and logic scores.
videos Video metadata, URLs, and creator mapping.
debates Structured debate threads and logic scoring.
later_actions User "Watch Later" interactions.
leaderboard Calculated rankings for the Creator DNA section.

Environment Configuration

Configuration is managed via .env. Do not commit this file to version control.

EXPO_PUBLIC_SUPABASE_URL=https://[YOUR_ID].supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=[YOUR_ANON_KEY]
SUPABASE_SERVICE_ROLE_KEY=[SECRET_ROLE_KEY]
OPENAI_API_KEY=[OPENAI_KEY]
ANTHROPIC_API_KEY=[ANTHROPIC_KEY]
                

Vercel Rewrites

The platform uses host-based rewrites in vercel.json to serve content from directories based on the requested subdomain.

  • docs.datariot.xyz → /datariot-docs/
  • info.datariot.xyz → /datariot-info/
  • datariot.xyz → /datariot-xyz/