Miniapp Template
A Farcaster Frame mini-app with React, database, and Neynar API integration.
jack new my-miniapp -t miniappWhat You Get
- React + Vite - Fast frontend development
- Hono API - Backend routes on the same deployment
- D1 Database - SQLite database included
- Neynar API - Farcaster data integration
- Tailwind CSS - Styling ready to go
Project Structure
my-miniapp/
├── src/
│ ├── App.tsx
│ ├── main.tsx
│ ├── worker.ts
│ ├── wagmi.ts
│ ├── hooks/
│ ├── lib/
│ └── index.css
├── schema.sql
├── package.json
├── vite.config.ts
├── wrangler.jsonc
└── AGENTS.mdsrc/App.tsx— React applicationsrc/main.tsx— Entry pointsrc/worker.ts— Hono API routessrc/wagmi.ts— Wallet configurationsrc/hooks/— React hookssrc/lib/— Utilitiessrc/index.css— Stylesschema.sql— Database schemawrangler.jsonc— Deployment configAGENTS.md— AI context
Requirements
This template requires a Neynar API key for Farcaster integration.
- Get a free key at neynar.com
- jack will prompt for it on first deploy
Database Schema
The template includes a guestbook example:
CREATE TABLE IF NOT EXISTS guestbook (
id INTEGER PRIMARY KEY AUTOINCREMENT,
fid INTEGER NOT NULL,
username TEXT NOT NULL,
display_name TEXT,
pfp_url TEXT,
message TEXT NOT NULL CHECK(length(message) <= 140),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);API Routes
The backend includes working examples:
// GET /api/notifications?fid=123
// Proxies to Neynar API with your API key
// GET /api/guestbook
// Fetch recent guestbook entries from D1
// POST /api/guestbook
// Add a new entry { fid, username, message }Frontend
The React app uses the Farcaster Miniapp SDK:
import { useMiniAppContext } from "@farcaster/miniapp-react";
function App() {
const { context } = useMiniAppContext();
// context.user contains the current Farcaster user
// context.client contains frame information
}Deploying
jack shipAfter deploy, jack will:
- Copy the URL to your clipboard
- Open the Farcaster manifest signing tool
- Prompt you to paste the signed
accountAssociationJSON intopublic/.well-known/farcaster.json - Link to the Farcaster preview tool
The manifest file lives at public/.well-known/farcaster.json and is served as a static asset at
/.well-known/farcaster.json after deploy. Use the miniapp key (not frame).
Development
Run locally with hot reload:
bun run devThe frontend runs on localhost:5173, proxying API requests to the worker.