A modern, responsive web application for creating, sharing, and exploring AI-generated content including images, audio, and text. Built with Next.js 15, TypeScript, and powered by Pollinations.AI.
- AI Image Generation: Create stunning images from text prompts using various AI models
- AI Audio Generation: Generate audio from text with multiple voice options
- Pinterest-style Grid: Beautiful masonry layout for displaying generated content
- Speech-to-Text: Use your microphone to convert speech to text for prompts
- Real-time Model Updates: Automatically fetches latest AI models from Pollinations.AI
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Interactive Modal System: Rich modals for image details and generation
- Audio Playback: Listen to generated audio directly in the interface
- Export & Share: Easy sharing of generated content
- Frontend: Next.js 15, React 18, TypeScript
- Styling: Tailwind CSS, Shadcn/ui components
- AI Integration: Pollinations.AI API
- Deployment: Firebase App Hosting
- Icons: Lucide React
- Forms: React Hook Form with Zod validation
- State Management: React hooks and context
Before you begin, ensure you have the following installed:
- Node.js 18+ and npm
- Firebase CLI (for deployment)
- Google Cloud account with billing enabled (for Gemini API)
git clone https://github.com/yourusername/PollenBoard.git
cd PollenBoardnpm installCreate a .env.local file in the root directory:
cp .env.example .env.localAdd your API keys to .env.local:
# Google AI API Key for Gemini (required for some features)
GOOGLE_API_KEY=your_google_api_key_here
# Alternative name that some configurations use
GEMINI_API_KEY=your_google_api_key_hereGetting your Google API Key:
- Go to Google AI Studio
- Create a new API key
- Restrict the key to specific domains if desired
Start the development server:
npm run devOpen http://localhost:3000 in your browser.
npm run buildnpm run start-
Install Firebase CLI:
npm install -g firebase-tools
-
Authenticate with Firebase:
firebase login
-
Initialize Firebase (if not already done):
firebase init hosting
-
Deploy to Firebase:
firebase deploy
-
Install Vercel CLI:
npm install -g vercel
-
Deploy:
vercel --prod
Create a Dockerfile:
FROM node:18-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
FROM node:18-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["npm", "start"]Build and run:
docker build -t pollenboard .
docker run -p 3000:3000 -e GOOGLE_API_KEY=your_key pollenboard| Variable | Description | Required | Default |
|---|---|---|---|
GOOGLE_API_KEY |
Google AI API key for Gemini | No | - |
GEMINI_API_KEY |
Alternative Google AI key name | No | - |
NEXT_PUBLIC_SITE_URL |
Site URL for metadata | No | http://localhost:3000 |
Edit tailwind.config.ts to customize the color scheme:
module.exports = {
theme: {
extend: {
colors: {
primary: "#33A19F", // Teal
accent: "#E37A71", // Salmon
background: "#F2F4F3", // Off-white
},
},
},
};The application automatically fetches available models from Pollinations.AI, but you can modify model preferences in src/lib/pollinations.ts.
- Click the "Generate Image" button
- Enter your text prompt
- Select an AI model (optional)
- Adjust image settings (size, quality, negative prompts)
- Click "Generate" and wait for your image
- Click the "Generate Audio" button
- Enter text for speech synthesis
- Choose a voice from the dropdown
- Click "Generate" to create audio
- Click the microphone icon in any text field
- Allow microphone access when prompted
- Speak your prompt clearly
- Click stop when finished - text will be transcribed automatically
- View Details: Click any pin to see full details
- Play Audio: Click play button on audio pins
- Refresh: Use refresh button to load latest content
- Responsive: Works on all device sizes
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run typecheck- Run TypeScript type checking
src/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β βββ explore/ # Explore page
β βββ globals.css # Global styles
β βββ page.tsx # Home page
βββ components/ # React components
β βββ forms/ # Generation dialogs
β βββ ui/ # Shadcn/ui components
βββ lib/ # Utilities and API clients
βββ types/ # TypeScript types
βββ hooks/ # Custom React hooks
-
New AI Model Support:
- Update
src/lib/pollinations.tsto handle new model endpoints - Add model configuration in relevant components
- Update
-
New Content Types:
- Extend
PinDatainterface insrc/types/index.ts - Create new generation dialog components
- Update the main grid component
- Extend
-
Custom API Endpoints:
- Add new route handlers in
src/app/api/ - Implement proper error handling and validation
- Add new route handlers in
Build fails with TypeScript errors
npm run typecheck
# Fix any type errors shownImages not loading
- Check
next.config.tsimage domains configuration - Ensure Pollinations.AI service is accessible
API rate limits
- The app uses Pollinations.AI free tier which has rate limits
- Consider implementing caching or upgrading to paid tier
Environment variables not working
- Ensure
.env.localis in the project root - Restart the development server after changes
- Variables must be prefixed with
NEXT_PUBLIC_to be available client-side
- Image Optimization: Direct image loading with fallback mechanisms and retry logic
- Lazy Loading: Implements React Suspense for progressive loading
- Bundle Splitting: Automatic code splitting with Next.js 15
- Caching: Static assets cached via Firebase CDN
Run the test suite:
# Type checking
npm run typecheck
# Linting
npm run lint
# Build test
npm run buildThis project is licensed under the MIT License - see the LICENSE file for details.
- 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
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@pollenboard.app
- Pollinations.AI for providing the AI generation APIs
- Shadcn/ui for the beautiful component library
- Next.js for the amazing React framework
- Vercel for deployment infrastructure
Made with β€οΈ by the PollenBoard team


