Skip to content

abcodeworks-team/Adobe-Stock-Factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Adobe Stock Factory

A production-ready web application for automating Adobe Stock asset creation using AI. Built with Next.js 15, TypeScript, and modern AI APIs.

Adobe Stock Factory TypeScript License

By AB Codeworks

✨ Features

Core Capabilities

  • 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

Technical Features

  • 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

πŸš€ Tech Stack

Frontend

  • Next.js 15 (App Router)
  • TypeScript (strict mode)
  • TailwindCSS
  • shadcn/ui components
  • Lucide Icons
  • React Query (data fetching)
  • Zustand (state management)
  • Recharts (dashboard charts)

Backend

  • Next.js Server Actions
  • Route Handlers (API routes)
  • Prisma ORM
  • Zod (validation)

AI & Processing

  • Google Gemini API (metadata, research, prompts)
  • Pollinations AI (image generation)
  • Sharp (image processing)
  • FFmpeg (video processing)

Database

  • SQLite
  • Prisma

πŸ“‹ Prerequisites

  • Node.js 18+ and npm
  • FFmpeg (for video processing)
  • Google Gemini API key
  • (Optional) Pollinations API access

πŸ› οΈ Installation

1. Clone and Install

cd adobe-stock-factory
npm install

Note: npm install akan otomatis menjalankan postinstall hook yang membuat semua folder uploads/ (images, videos, thumbnails, exports) dan generate Prisma Client. Jika folder belum terbuat, jalankan manual dengan npm run setup.

2. Environment 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:

  1. Visit Google AI Studio
  2. Create a new API key
  3. Copy and paste it into your .env file

3. Database Setup

# Generate Prisma Client
npm run db:generate

# Push schema to database
npm run db:push

# (Optional) Open Prisma Studio
npm run db:studio

4. Install FFmpeg (for video features)

Windows:

# Using Chocolatey
choco install ffmpeg

# Or download from https://ffmpeg.org/download.html

macOS:

brew install ffmpeg

Linux:

sudo apt-get install ffmpeg

🎯 Running the Application

Development Mode

npm run dev

Open http://localhost:3000 in your browser.

Available Scripts

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

Production Build

npm run build
npm start

πŸ“– Usage Guide

1. Create a Project

  1. Navigate to Projects in the sidebar
  2. Click New Project
  3. Enter project name and description
  4. Click Create Project

2. Research Niches

  1. Go to Research
  2. Enter niche, market, and topic
  3. Click Research Niche
  4. Review AI-generated opportunities

3. Generate Prompts

  1. Navigate to Prompts
  2. Fill in niche, style, quantity, and category
  3. Click Generate Prompts
  4. Copy prompts or save for later use

4. Generate Images

  1. Go to Images
  2. Select your project
  3. Set dimensions (default: 1920x1080)
  4. Enter your prompt
  5. Click Generate Image
  6. Download or view generated images

5. Generate Videos

  1. Navigate to Videos
  2. Select project and provider
  3. Set duration and dimensions
  4. Enter your prompt
  5. Click Generate Video

6. Generate Metadata

  1. Go to Metadata
  2. Select an asset from the list
  3. Click Generate with AI
  4. Edit title, description, keywords, category
  5. Click Save Metadata

7. Export Assets

  1. Navigate to Export
  2. Select assets with metadata
  3. Choose format (CSV or ZIP)
  4. Click Export
  5. Download the file

πŸ—‚οΈ Project Structure

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

πŸ”§ Configuration

Image Generation Settings

Edit src/lib/pollinations/client.ts to customize:

  • Default dimensions
  • Model selection
  • Enhancement options

Video Providers

The video system is extensible. To add a new provider:

  1. Create a new file in src/lib/video/
  2. Implement the VideoProvider interface
  3. 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
  }
}

Quality Check Thresholds

Edit src/server/services/quality-service.ts to adjust:

  • Minimum resolution requirements
  • File size limits
  • Aspect ratio standards

🚒 Deployment

Vercel (Recommended)

npm install -g vercel
vercel

Docker

Create 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-factory

Environment Variables for Production

Ensure all environment variables are set in your hosting platform:

  • DATABASE_URL
  • GOOGLE_GEMINI_API_KEY
  • POLLINATIONS_API_URL
  • POLLINATIONS_VIDEO_API_URL
  • UPLOAD_DIR
  • NEXT_PUBLIC_APP_URL

πŸ“Š Database Management

View Database

npm run db:studio

Reset Database

# Delete the database file
rm prisma/dev.db

# Recreate
npm run db:push

Backup Database

cp prisma/dev.db prisma/dev.db.backup

πŸ› Troubleshooting

Gemini API Errors

Issue: "Gemini API key not configured"

  • Verify GOOGLE_GEMINI_API_KEY in .env
  • Check API key is valid at Google AI Studio

Image Generation Fails

Issue: Images not generating

  • Check internet connection
  • Verify Pollinations API is accessible
  • Check browser console for errors

Video Generation Timeout

Issue: Video generation taking too long

  • Pollinations video API may have queue times
  • Increase timeout in video-service.ts
  • Check provider status

FFmpeg Not Found

Issue: Video thumbnails failing

  • Install FFmpeg (see Installation section)
  • Verify FFmpeg is in PATH: ffmpeg -version

Database Errors

Issue: Prisma client errors

npm run db:generate
npm run db:push

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ License

MIT License - feel free to use this project for personal or commercial purposes.

πŸ™ Acknowledgments

πŸ“ž Support

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

About

Production-ready Adobe Stock Factory built by AB Codeworks. AI niche research, prompt generation, image & video creation, metadata automation, and Adobe Stock export tools.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages