Skip to content

kazuki-netizen/Honne-X-API

Repository files navigation

Honne XAPI Exhibition

An automated web exhibition that listens to public language on X, verifies real posts, translates surface text into a quieter human voice, generates artwork, and publishes the result as an archive.

Honne is built as a small but complete production system: static frontend, cloud API, scheduled pickup jobs, Supabase persistence, X API integration, generated imagery, cost controls, and quality gates.

What It Shows

  • Public X post discovery with strict intake rules
  • X API / oEmbed validation before model selection
  • Deterministic JST scheduling with daily pickup quotas
  • xAI-powered selection, translation, reply drafting, and image generation
  • Supabase/Postgres storage with public views and RLS-oriented schema
  • Vercel serverless API for pickup execution
  • GitHub Actions and Supabase Cron compatible scheduling
  • Local admin dashboard for dry runs, prompt tuning, and diagnostics
  • Node test coverage for auth and schedule behavior

Architecture

GitHub Actions / Supabase Cron
        |
        v
Vercel API: api/pick-signal.js
        |
        +--> X API / oEmbed verification
        +--> xAI search, selection, author-context, artwork
        +--> Supabase tables and public view
        +--> optional X reply / mention post
        |
        v
Static exhibition frontend

Local Preview

npm install
npm start

Open:

  • Site: http://localhost:4173/#/
  • Signals: http://localhost:4173/#/signals
  • Archive: http://localhost:4173/#/archive

Local Admin Dashboard

npm run admin

Open:

  • Admin dashboard: http://127.0.0.1:4174/admin.html
  • Setup guide: docs/admin-dashboard.md

Quality Gate

npm run check

The check command validates JavaScript syntax, safety invariants, scheduler configuration, and the test suite.

Production Environment

Copy .env.example and configure the required cloud secrets in Vercel, GitHub Actions, or your scheduler environment.

Required variables:

  • SUPABASE_URL
  • SUPABASE_SERVICE_ROLE_KEY
  • XAI_API_KEY
  • XAI_SEARCH_MODEL
  • XAI_IMAGE_MODEL
  • DISPLAY_LANGUAGE
  • SIGNALS_PER_PICKUP
  • MAX_SEARCH_CALLS_PER_PICKUP
  • MAX_DAILY_PICKUPS
  • SITE_URL
  • CRON_SECRET
  • SCHEDULE_SALT

X posting can use either OAuth2 user context:

  • X_USER_ACCESS_TOKEN

Or OAuth 1.0a:

  • X_API_KEY
  • X_API_KEY_SECRET
  • X_ACCESS_TOKEN
  • X_ACCESS_TOKEN_SECRET

Data And Safety Model

Honne treats public X posts as public source material, but the system is intentionally conservative:

  • Replies and video-dependent posts are excluded.
  • Political/news reactions, promotion, aggression, trend-heavy posts, and high-risk self-harm content are filtered out.
  • Candidate URLs are validated before model selection.
  • The model is not allowed to invent post URLs, authors, or source text.
  • Internal run logs and author-context analysis are kept out of the public frontend view.
  • Visitor submissions require explicit consent flags before insertion.

The frontend config may contain publishable Supabase/PostHog keys. Those are not service-role secrets; the database schema is designed around a public published_signals view plus RLS.

Repository Notes

This public repository is a clean snapshot of the X API pickup system for portfolio/review purposes. It intentionally does not include private environment files, deployment tokens, service role keys, local OAuth artifacts, or the private repository history.

The production scheduler/deploy workflows are left as manually triggered workflows in this public copy, so the repository can be reviewed without automatically calling a live endpoint or requiring private deployment secrets.

License

MIT

About

Automated X API web exhibition with scheduled post discovery, verification, AI translation, generated artwork, and Supabase archive.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages