358 lines
6.6 KiB
Markdown
358 lines
6.6 KiB
Markdown
# ๐ Publish PollCelo on Farcaster
|
|
|
|
## โ
How to Launch as a Mini App
|
|
|
|
---
|
|
|
|
## ๐ Prerequisites
|
|
|
|
1. **Deployed App** - Your app must be live on a public URL
|
|
2. **Farcaster Account** - You need a Farcaster account
|
|
3. **Frame Metadata** - Add Frame tags to your app
|
|
|
|
---
|
|
|
|
## ๐ฏ Step 1: Add Frame Metadata
|
|
|
|
### Update app/layout.tsx
|
|
```typescript
|
|
export const metadata: Metadata = {
|
|
title: 'PollCelo',
|
|
description: 'Daily prediction market on Farcaster',
|
|
metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL!),
|
|
openGraph: {
|
|
title: 'PollCelo - Daily Prediction Market',
|
|
description: 'Vote with cUSD, win daily rewards',
|
|
images: ['/og-image.png'],
|
|
},
|
|
other: {
|
|
'fc:frame': 'vNext',
|
|
'fc:frame:image': `${process.env.NEXT_PUBLIC_APP_URL}/og-image.png`,
|
|
'fc:frame:button:1': 'Vote Now',
|
|
'fc:frame:button:1:action': 'link',
|
|
'fc:frame:button:1:target': process.env.NEXT_PUBLIC_APP_URL!,
|
|
},
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ผ๏ธ Step 2: Create Images
|
|
|
|
### Icon (512x512)
|
|
Create `public/icon.png`:
|
|
- Square image
|
|
- 512x512 pixels
|
|
- PollCelo logo
|
|
- Transparent background
|
|
|
|
### Splash Screen (1200x630)
|
|
Create `public/splash.png`:
|
|
- 1200x630 pixels
|
|
- PollCelo branding
|
|
- Solid background (#35D07F)
|
|
|
|
### OG Image (1200x630)
|
|
Create `public/og-image.png`:
|
|
- 1200x630 pixels
|
|
- Shows today's poll
|
|
- Eye-catching design
|
|
|
|
---
|
|
|
|
## ๐ฑ Step 3: Create Farcaster Manifest
|
|
|
|
### app/.well-known/farcaster.json/route.ts
|
|
```typescript
|
|
import { NextResponse } from 'next/server'
|
|
|
|
export async function GET() {
|
|
return NextResponse.json({
|
|
accountAssociation: {
|
|
header: "eyJmaWQiOjEyMzQ1..." // Your signature
|
|
},
|
|
frame: {
|
|
version: "1",
|
|
name: "PollCelo",
|
|
iconUrl: `${process.env.NEXT_PUBLIC_APP_URL}/icon.png`,
|
|
splashImageUrl: `${process.env.NEXT_PUBLIC_APP_URL}/splash.png`,
|
|
splashBackgroundColor: "#35D07F",
|
|
homeUrl: process.env.NEXT_PUBLIC_APP_URL,
|
|
}
|
|
})
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ Step 4: Generate Account Association
|
|
|
|
### Install Farcaster Auth Kit
|
|
```bash
|
|
npm install @farcaster/auth-kit
|
|
```
|
|
|
|
### Generate Signature
|
|
```typescript
|
|
import { createAppClient, viemConnector } from '@farcaster/auth-kit'
|
|
|
|
const appClient = createAppClient({
|
|
ethereum: viemConnector(),
|
|
})
|
|
|
|
// Sign with your custody address
|
|
const signature = await appClient.createAccountAssociation({
|
|
fid: YOUR_FID,
|
|
custody: YOUR_CUSTODY_ADDRESS,
|
|
})
|
|
|
|
console.log(signature) // Use this in manifest
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ Step 5: Deploy
|
|
|
|
### 1. Deploy to Vercel
|
|
```bash
|
|
vercel --prod
|
|
```
|
|
|
|
### 2. Verify Manifest
|
|
```bash
|
|
curl https://your-app.vercel.app/.well-known/farcaster.json
|
|
```
|
|
|
|
Should return:
|
|
```json
|
|
{
|
|
"accountAssociation": {...},
|
|
"frame": {...}
|
|
}
|
|
```
|
|
|
|
### 3. Test Frame Metadata
|
|
```bash
|
|
curl -I https://your-app.vercel.app
|
|
```
|
|
|
|
Should include:
|
|
```
|
|
fc:frame: vNext
|
|
fc:frame:image: https://...
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ข Step 6: Share on Warpcast
|
|
|
|
### Option A: Cast with Link
|
|
1. Open Warpcast
|
|
2. Create new cast
|
|
3. Paste your URL: `https://your-app.vercel.app`
|
|
4. Warpcast will show Frame preview
|
|
5. Cast it!
|
|
|
|
### Option B: Submit to Frame Directory
|
|
1. Go to [Warpcast Frames](https://warpcast.com/~/developers/frames)
|
|
2. Click "Submit Frame"
|
|
3. Enter your URL
|
|
4. Fill out details
|
|
5. Submit for review
|
|
|
|
---
|
|
|
|
## ๐ฏ Step 7: Optimize for Discovery
|
|
|
|
### Add to Cast
|
|
```
|
|
๐ฏ PollCelo is live!
|
|
|
|
Vote on today's poll with cUSD
|
|
Win daily rewards ๐ฐ
|
|
|
|
Try it now ๐
|
|
https://your-app.vercel.app
|
|
```
|
|
|
|
### Use Hashtags
|
|
```
|
|
#Farcaster #Celo #Predictions #DeFi #MiniApp
|
|
```
|
|
|
|
### Tag Relevant Accounts
|
|
```
|
|
@celo @farcaster
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ Frame Validator
|
|
|
|
### Test Your Frame
|
|
1. Go to [Frame Validator](https://warpcast.com/~/developers/frames)
|
|
2. Enter your URL
|
|
3. Check for errors
|
|
4. Fix any issues
|
|
5. Re-test
|
|
|
|
### Common Issues
|
|
- โ Missing `fc:frame` tag
|
|
- โ Invalid image URL
|
|
- โ Missing manifest
|
|
- โ CORS errors
|
|
|
|
---
|
|
|
|
## ๐จ Frame Preview
|
|
|
|
### What Users See
|
|
1. **In Feed** - OG image with "Vote Now" button
|
|
2. **Click Button** - Opens your app in Warpcast
|
|
3. **In App** - Full PollCelo experience
|
|
4. **Vote** - Uses their Farcaster account
|
|
|
|
---
|
|
|
|
## ๐ง Advanced: Dynamic Frames
|
|
|
|
### Show Different Polls
|
|
```typescript
|
|
// app/poll/[id]/page.tsx
|
|
export async function generateMetadata({ params }: { params: { id: string } }) {
|
|
const poll = await getPoll(params.id)
|
|
|
|
return {
|
|
other: {
|
|
'fc:frame': 'vNext',
|
|
'fc:frame:image': `${process.env.NEXT_PUBLIC_APP_URL}/api/og?pollId=${params.id}`,
|
|
'fc:frame:button:1': `Vote: ${poll.question}`,
|
|
'fc:frame:button:1:action': 'link',
|
|
'fc:frame:button:1:target': `${process.env.NEXT_PUBLIC_APP_URL}/poll/${params.id}`,
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ Track Performance
|
|
|
|
### Analytics to Monitor
|
|
- Frame impressions
|
|
- Button clicks
|
|
- App opens
|
|
- Votes cast
|
|
- Share rate
|
|
|
|
### Add to Vercel Analytics
|
|
```typescript
|
|
import { Analytics } from '@vercel/analytics/react'
|
|
|
|
export default function RootLayout({ children }) {
|
|
return (
|
|
<html>
|
|
<body>
|
|
{children}
|
|
<Analytics />
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## โ
Launch Checklist
|
|
|
|
### Pre-Launch
|
|
- [ ] App deployed to production
|
|
- [ ] Frame metadata added
|
|
- [ ] Images created (icon, splash, OG)
|
|
- [ ] Manifest endpoint working
|
|
- [ ] Frame validator passes
|
|
- [ ] Tested in Warpcast
|
|
|
|
### Launch Day
|
|
- [ ] Cast announcement
|
|
- [ ] Share in channels
|
|
- [ ] Tag relevant accounts
|
|
- [ ] Submit to Frame directory
|
|
- [ ] Monitor analytics
|
|
|
|
### Post-Launch
|
|
- [ ] Respond to feedback
|
|
- [ ] Fix any issues
|
|
- [ ] Share user testimonials
|
|
- [ ] Create more casts
|
|
- [ ] Iterate based on data
|
|
|
|
---
|
|
|
|
## ๐ฏ Growth Tips
|
|
|
|
### 1. Daily Casts
|
|
Share today's poll every day:
|
|
```
|
|
๐ณ๏ธ Today's Poll: Will BTC hit $120K?
|
|
|
|
Vote now and win cUSD! ๐ฐ
|
|
https://your-app.vercel.app
|
|
```
|
|
|
|
### 2. Share Results
|
|
Post yesterday's results:
|
|
```
|
|
๐ Yesterday's Results:
|
|
|
|
โ
67% predicted correctly
|
|
๐ฐ Winners earned 0.15 cUSD each
|
|
|
|
Today's poll is live ๐
|
|
```
|
|
|
|
### 3. User Testimonials
|
|
Recast user wins:
|
|
```
|
|
๐ @alice just won 0.25 cUSD!
|
|
|
|
Your turn to predict and win ๐
|
|
```
|
|
|
|
### 4. Collaborate
|
|
Partner with other Frames:
|
|
```
|
|
๐ค PollCelo x OtherFrame
|
|
|
|
Special poll today!
|
|
Vote and win double rewards ๐ฐ
|
|
```
|
|
|
|
---
|
|
|
|
## ๐ Resources
|
|
|
|
- [Farcaster Frames Docs](https://docs.farcaster.xyz/developers/frames)
|
|
- [Frame Validator](https://warpcast.com/~/developers/frames)
|
|
- [Frame Examples](https://github.com/farcasterxyz/frames)
|
|
- [Warpcast Developer Portal](https://warpcast.com/~/developers)
|
|
|
|
---
|
|
|
|
## ๐ Summary
|
|
|
|
**To Publish PollCelo:**
|
|
|
|
1. โ
Add Frame metadata
|
|
2. โ
Create images
|
|
3. โ
Add manifest endpoint
|
|
4. โ
Deploy to production
|
|
5. โ
Cast your URL on Warpcast
|
|
6. โ
Submit to Frame directory
|
|
|
|
**Time to Launch:** 30 minutes
|
|
**Cost:** $0
|
|
**Reach:** All Farcaster users
|
|
|
|
**Ready to go viral! ๐**
|