A production-ready web application for automating Adobe Stock asset creation using AI. Built with Next.js 15, TypeScript, and modern AI APIs.
By AB Codeworks
- Niche Research - AI-powered market analysis using Gemini
- Prompt Generator - Create Adobe Stock optimized prompts
- Image Generation - Generate images with Pollinations AI
- Video Generation - Extensible provider architecture (Pollinations, future: Wan, Kling, ComfyUI)
- Metadata Generation - AI-generated titles, descriptions, keywords
- Quality Control - Automatic asset validation against Adobe Stock requirements
- Asset Library - Browse, search, and manage generated assets
- Export System - CSV and ZIP exports compatible with Adobe Stock
- Modern dashboard with real-time statistics
- Dark/light mode support
- Responsive design (mobile-friendly)
- SQLite database with Prisma ORM
- Server Actions for type-safe operations
- Repository and Service pattern architecture
- TypeScript strict mode
- SOLID principles implementation
- Next.js 15 (App Router)
- TypeScript (strict mode)
- TailwindCSS
- shadcn/ui components
- Lucide Icons
- React Query (data fetching)
- Zustand (state management)
- Recharts (dashboard charts)
- Next.js Server Actions
- Route Handlers (API routes)
- Prisma ORM
- Zod (validation)
- Google Gemini API (metadata, research, prompts)
- Pollinations AI (image generation)
- Sharp (image processing)
- FFmpeg (video processing)
- SQLite
- Prisma
- Node.js 18+ and npm
- FFmpeg (for video processing)
- Google Gemini API key
- (Optional) Pollinations API access
cd adobe-stock-factory
npm installNote:
npm installakan otomatis menjalankanpostinstallhook yang membuat semua folderuploads/(images, videos, thumbnails, exports) dan generate Prisma Client. Jika folder belum terbuat, jalankan manual dengannpm run setup.
Create a .env file in the root directory:
DATABASE_URL="file:./dev.db"
GOOGLE_GEMINI_API_KEY="your_gemini_api_key_here"
POLLINATIONS_API_URL="https://image.pollinations.ai"
POLLINATIONS_VIDEO_API_URL="https://video.pollinations.ai"
UPLOAD_DIR="./uploads"
NEXT_PUBLIC_APP_URL="http://localhost:3000"Get your Gemini API key:
- Visit Google AI Studio
- Create a new API key
- Copy and paste it into your
.envfile
# Generate Prisma Client
npm run db:generate
# Push schema to database
npm run db:push
# (Optional) Open Prisma Studio
npm run db:studioWindows:
# Using Chocolatey
choco install ffmpeg
# Or download from https://ffmpeg.org/download.htmlmacOS:
brew install ffmpegLinux:
sudo apt-get install ffmpegnpm run devOpen http://localhost:3000 in your browser.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Create production build |
npm start |
Start production server |
npm run setup |
Create all required uploads/ subdirectories |
npm run db:generate |
Generate Prisma Client |
npm run db:push |
Push schema to database |
npm run db:studio |
Open Prisma Studio |
npm run build
npm start- Navigate to Projects in the sidebar
- Click New Project
- Enter project name and description
- Click Create Project
- Go to Research
- Enter niche, market, and topic
- Click Research Niche
- Review AI-generated opportunities
- Navigate to Prompts
- Fill in niche, style, quantity, and category
- Click Generate Prompts
- Copy prompts or save for later use
- Go to Images
- Select your project
- Set dimensions (default: 1920x1080)
- Enter your prompt
- Click Generate Image
- Download or view generated images
- Navigate to Videos
- Select project and provider
- Set duration and dimensions
- Enter your prompt
- Click Generate Video
- Go to Metadata
- Select an asset from the list
- Click Generate with AI
- Edit title, description, keywords, category
- Click Save Metadata
- Navigate to Export
- Select assets with metadata
- Choose format (CSV or ZIP)
- Click Export
- Download the file
adobe-stock-factory/
βββ prisma/
β βββ schema.prisma # Database schema
βββ src/
β βββ app/ # Next.js app directory
β β βββ api/ # API routes
β β βββ dashboard/ # Dashboard page
β β βββ projects/ # Projects page
β β βββ research/ # Niche research
β β βββ generator/ # Image/Video/Prompt generators
β β βββ assets/ # Asset library
β β βββ metadata/ # Metadata editor
β β βββ export/ # Export functionality
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ layout/ # Layout components
β β βββ theme-provider.tsx
β β βββ providers.tsx
β βββ lib/
β β βββ gemini/ # Gemini AI client
β β βββ pollinations/ # Pollinations API client
β β βββ video/ # Video provider system
β β βββ sharp/ # Image processing
β β βββ ffmpeg/ # Video processing
β β βββ prisma.ts # Prisma client
β β βββ utils.ts # Utility functions
β βββ server/
β β βββ actions/ # Server actions
β β βββ services/ # Business logic
β β βββ repositories/ # Data access layer
β βββ store/
β β βββ app-store.ts # Zustand store
β βββ types/
β βββ index.ts # TypeScript types
βββ scripts/
β βββ setup.js # Setup script (auto-creates uploads dirs)
βββ uploads/ # Generated assets (auto-created by setup)
β βββ images/ # Generated images
β βββ videos/ # Generated videos
β βββ thumbnails/ # Auto-generated thumbnails
β βββ exports/ # CSV and ZIP exports
βββ .env # Environment variables
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json
Edit src/lib/pollinations/client.ts to customize:
- Default dimensions
- Model selection
- Enhancement options
The video system is extensible. To add a new provider:
- Create a new file in
src/lib/video/ - Implement the
VideoProviderinterface - Register it in
VideoProviderFactory
Example:
export class CustomProvider implements VideoProvider {
name = "custom";
async generate(options: VideoGenerationOptions) {
// Implementation
}
async getStatus(jobId: string) {
// Implementation
}
async download(jobId: string, destPath: string) {
// Implementation
}
}Edit src/server/services/quality-service.ts to adjust:
- Minimum resolution requirements
- File size limits
- Aspect ratio standards
npm install -g vercel
vercelCreate a Dockerfile:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]Build and run:
docker build -t adobe-stock-factory .
docker run -p 3000:3000 adobe-stock-factoryEnsure all environment variables are set in your hosting platform:
DATABASE_URLGOOGLE_GEMINI_API_KEYPOLLINATIONS_API_URLPOLLINATIONS_VIDEO_API_URLUPLOAD_DIRNEXT_PUBLIC_APP_URL
npm run db:studio# Delete the database file
rm prisma/dev.db
# Recreate
npm run db:pushcp prisma/dev.db prisma/dev.db.backupIssue: "Gemini API key not configured"
- Verify
GOOGLE_GEMINI_API_KEYin.env - Check API key is valid at Google AI Studio
Issue: Images not generating
- Check internet connection
- Verify Pollinations API is accessible
- Check browser console for errors
Issue: Video generation taking too long
- Pollinations video API may have queue times
- Increase timeout in
video-service.ts - Check provider status
Issue: Video thumbnails failing
- Install FFmpeg (see Installation section)
- Verify FFmpeg is in PATH:
ffmpeg -version
Issue: Prisma client errors
npm run db:generate
npm run db:pushContributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - feel free to use this project for personal or commercial purposes.
- Next.js - React framework
- shadcn/ui - UI components
- Google Gemini - AI capabilities
- Pollinations AI - Image generation
- Prisma - Database ORM
For issues and questions:
- Open an issue on GitHub
- Check the troubleshooting section
- Review the documentation
Built with β€οΈ by AB Codeworks for Adobe Stock creators