Skip to content

drtyrell969/truthpoll

Repository files navigation

PollTrust AI

AI-Generated Polling Platform with Trust & Authenticity Filtering

A production-grade polling platform where an AI service generates polls, the system collects votes from human accounts, and an authenticity engine computes per-account trust weights. The UI exposes a live trust slider that interpolates between:

  • Right (Raw): All votes included
  • Left (Strict): Only votes meeting strict trust criteria

Quick Start

Option 1: Docker (recommended)

Permission requirements: Your user must be in the docker group, or run with sudo. See DOCKER.md.

./run.sh
# or: make run

Opens at http://localhost:8080

Option 2: Local PHP

Requires PHP 8.2+ and Composer.

# Install dependencies
composer install

# Start server
php -S localhost:8080 -t public

Open http://localhost:8080

Features

  • Home feed: Trending polls by category
  • Poll page: Vote, view results, and use the trust slider
  • Trust slider: See how results change as you filter from raw (everyone) to strict (verified signals only)
  • Vote stream: Live feed of recent votes, filtered by trust
  • API: REST JSON API at /api/v1/ for polls, votes, results, auth

API Endpoints

Method Endpoint Description
GET /api/v1/polls List published polls
GET /api/v1/polls/{id} Poll detail
POST /api/v1/polls/{id}/vote Cast vote (option_id required)
GET /api/v1/polls/{id}/results Aggregates (?trust=0..1)
GET /api/v1/polls/{id}/votes/stream Recent votes (?trust=0..1)
POST /api/v1/auth/register Create account
POST /api/v1/auth/login Get JWT

Trust Slider

  • trust=1.0 (100%): Raw results, all votes included
  • trust=0.0 (0%): Strict filter, only high-trust accounts

Trust weights use maturation tiers (New < 7 days, Young 7–30 days, Mature 30–180 days, Established 180+ days).

Tech Stack

  • PHP 8.2+, Slim 4 (API)
  • SQLite (dev) / MySQL (production)
  • Bootstrap 5, Chart.js, vanilla JS
  • JWT auth (Firebase)

Configuration

Copy .env.example to .env and adjust:

  • DB_PATH: Database file path
  • JWT_SECRET: Secret for JWT signing
  • APP_URL: Base URL for the app

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors