Domain: https://baseposting.online/
Mini App that:
- Scrapes latest X/Twitter posts from an Apify Dataset
- Uses OpenAI GPT to generate Base-focused banger posts (1 click = 1 post)
- Uses a credit system (10 free credits on first use)
- Lets users earn credits via:
- 1 Base tx to
0xB331328F506f2D35125e367A190e914B1b6830cF= +1 credit (server verifies receipt on chainId 8453) - 1 share per UTC day = +2 credits
- 1 Base tx to
Required:
OPENAI_API_KEYAPIFY_TOKENAPIFY_DATASET_IDUPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN
Notifications (Base + Farcaster):
NEYNAR_API_KEY(required to verify notification webhooks)CRON_SECRET(protects cron + admin endpoints)NOTIF_APP_URL(optional, defaults to https://baseposting.online)NOTIF_CADENCE_HOURS(optional, default 2)
Recommended:
OPENAI_MODEL(defaultgpt-4o-mini)BASE_RPC_URL(defaulthttps://mainnet.base.org)
Set these to your signed values (publish guide):
FARCASTER_ACCOUNT_ASSOCIATION_HEADERFARCASTER_ACCOUNT_ASSOCIATION_PAYLOADFARCASTER_ACCOUNT_ASSOCIATION_SIGNATURE
npm install
npm run devDeploy to Vercel as a Vite app with Serverless Functions.
- Output directory:
dist - Build command:
npm run build
/.well-known/farcaster.json is served via a Vercel rewrite to /api/farcaster (and also exists as a static fallback in public/.well-known/farcaster.json).
-
Make sure
public/.well-known/farcaster.json(and/api/farcaster) includes:miniapp.webhookUrl(and/orframe.webhookUrl) pointing tohttps://<your-domain>/api/webhook
-
Set env vars in Vercel:
NEYNAR_API_KEY(used byparseWebhookEventverification)CRON_SECRET(a long random string)
-
Create a QStash schedule to call:
https://<your-domain>/api/cron/notifications- method: POST
- header:
Upstash-Forward-Authorization: Bearer <CRON_SECRET> - cadence: every 10 minutes (the server enforces the 2 hour cadence per user)
-
Debug endpoints (also protected by
CRON_SECRETviaAuthorization: Bearer <CRON_SECRET>):GET /api/admin/notifs/statusGET /api/admin/notifs/eventsPOST /api/admin/notifs/send-testPOST /api/admin/notifs/reschedulewith{ "hours": 2 }
Leaderboard shows Top 50 users by credits spent (post + photo generation) with two ranges:
- Last 7 days
- Previous week
- Each successful generation logs per-day counters in Upstash Redis.
- A cron endpoint aggregates these per-day hashes and stores a precomputed Top 50 list.
Create a QStash schedule to call:
https://<your-domain>/api/cron/leaderboard- method: POST
- header:
Upstash-Forward-Authorization: Bearer <CRON_SECRET> - cadence: every 10 minutes
The cron also stores readable strings:
admin:leaderboard_7dadmin:leaderboard_prev
public/builder-attribution.js imports Attribution exactly from:
import { Attribution } from "https://esm.sh/ox/erc8021";It exposes window.__ERC8021_DATA_SUFFIX__ which is passed into the wallet request via:
request.capabilities = { dataSuffix }Replace TODO_REPLACE_BUILDER_CODE with your real Builder Code.