A decentralized Farcaster Frame application for broadcasting and viewing Space Invaders flash photos, featuring IPFS storage via Pinata and real-time global feed.
- Global Flash Feed: Browse Space Invaders flash photos from players worldwide
- Personal Feed: View your own flash history with Farcaster integration
- IPFS Storage: Decentralized image storage via Pinata for reliability
- City Filtering: Filter flashes by location with trending cities
- Real-time Updates: Live feed updates with infinite scroll
- Farcaster Integration: Seamless authentication and social features
- Responsive Design: Mobile-first design with retro terminal aesthetics
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- TailwindCSS - Utility-first styling with retro theme
- React Query - Data fetching and caching
- NextAuth - Authentication with Farcaster
- IPFS: Decentralized storage via Pinata gateway (
fuchsia-rich-lungfish-648.mypinata.cloud) - Fully Decentralized: All images stored on IPFS for censorship resistance and permanence
- Flashcastr API: All flash data, user management, and global feed
- Neynar API: Farcaster protocol integration and authentication
- Node.js 18+
- npm or yarn
- Neynar API key
- Clone the repository:
git clone https://github.com/gitpancake/flashcastr.git
cd flashcastr- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env-
Configure your
.envfile with your actual values:- Get a Neynar API key from neynar.com
- Generate a NextAuth secret:
openssl rand -base64 32 - Set your Flashcastr API key (contact the team)
- Configure your deployment URL for production
-
Run the development server:
npm run devOpen http://localhost:3000 to see the application.
src/
βββ app/ # Next.js app router pages
β βββ api/ # API routes
β βββ flash/[id]/ # Individual flash page
β βββ profile/ # User profile pages
β βββ page.tsx # Homepage
βββ components/ # React components
β βββ atom/ # Atomic components
β βββ molecule/ # Molecular components
β βββ organism/ # Organism components
β βββ ui/ # shadcn/ui components
βββ hooks/ # Custom React hooks
βββ lib/ # Utility libraries
β βββ api.flashcastr.app/ # Flashcastr API client (unified API)
β βββ neynar/ # Neynar/Farcaster API client
β βββ help/ # Helper utilities
β βββ constants.ts # App constants
βββ auth.ts # NextAuth configuration
Flashcastr uses decentralized IPFS storage for all images:
- All images are stored on IPFS for permanence and censorship resistance
- Retrieved via Pinata gateway for optimal performance and reliability
- URLs:
https://fuchsia-rich-lungfish-648.mypinata.cloud/ipfs/{cid}
The getImageUrl() utility handles IPFS URL construction:
// Returns IPFS URL from ipfs_cid
const imageUrl = getImageUrl(flash);
// Returns: https://gateway.../ipfs/{cid}Flash Data Structure:
interface FlashData {
flash_id: number;
player: string;
city: string;
timestamp: number;
img: string; // Legacy field for backwards compatibility
ipfs_cid?: string; // IPFS content identifier (primary)
}Global Flash Structure:
interface GlobalFlash {
flash_id: number;
player: string;
city: string;
text: string;
timestamp: number;
img: string;
ipfs_cid?: string; // New IPFS content identifier
}- Theme: Retro terminal/hacker aesthetic
- Colors: Green terminal text, dark backgrounds
- Typography: Monospace fonts (Visitor)
- Layout: Mobile-first responsive grid
- Components: Custom styled with TailwindCSS
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run deploy:vercel- Deploy to Vercel
The app uses multiple environment files:
.env- Your local configuration (gitignored for security).env.example- Template showing all required variables- Environment variables are automatically loaded by Next.js
- TypeScript: Strict type checking enabled
- ESLint: Custom rules for Next.js and React
- Prettier: Code formatting (via ESLint integration)
npm run deploy:vercelThis will:
- Build the application
- Configure environment variables
- Deploy to Vercel
- Build the application:
npm run build-
Set environment variables on your hosting platform
-
Start the production server:
npm startAll required environment variables are documented in .env.example. Copy it to .env and configure with your values.
| Variable | Description | Example |
|---|---|---|
NEYNAR_API_KEY |
Neynar API key for Farcaster integration | Get from neynar.com |
NEYNAR_CLIENT_ID |
Neynar client ID from dashboard | ca507e6f-5287-... |
NEXTAUTH_URL |
Your app's public URL | https://your-app.vercel.app |
NEXTAUTH_SECRET |
JWT signing secret | Generate with openssl rand -base64 32 |
NEXT_PUBLIC_URL |
Public URL for the app | Same as NEXTAUTH_URL |
FLASHCASTR_API_KEY |
API key for Flashcastr backend | Contact team for access |
NEXT_PUBLIC_FLASHCASTR_API_URL |
Flashcastr API endpoint | http://localhost:4000 (dev) |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_IPFS_GATEWAY |
IPFS gateway for decentralized storage via Pinata | https://...mypinata.cloud/ipfs/ |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_FRAME_NAME |
App name displayed in frame | Flashcastr |
NEXT_PUBLIC_FRAME_DESCRIPTION |
Frame description | Broadcast your Space Invader flashes. |
NEXT_PUBLIC_FRAME_BUTTON_TEXT |
Frame button text | Enter |
| Variable | Description | Required |
|---|---|---|
REDIS_URL |
Redis connection for caching | Production only |
KV_REST_API_URL |
Vercel KV store URL | Optional |
KV_REST_API_TOKEN |
Vercel KV store token | Optional |
NEXT_PUBLIC_ADMIN_FID |
Admin Farcaster ID for special features | Optional |
USE_TUNNEL |
Enable localtunnel for development | Optional |
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Use functional components with hooks
- Maintain consistent naming conventions
- Add proper TypeScript types for all data structures
This project is licensed under the MIT License - see the LICENSE file for details.
- Neynar - Farcaster protocol integration
- Space Invaders Community - Game and flash photo inspiration
- IPFS/Pinata - Decentralized storage infrastructure
- Vercel - Hosting and deployment platform
- Issues: GitHub Issues
- Discord: Join the Space Invaders community
- Twitter: Follow @flashcastr for updates
Built with β€οΈ for the Space Invaders community