ImagineAI is a responsive full-stack AI image generation application. Users can describe an image, select a visual style and format, and generate downloadable artwork using Cloudflare Workers AI.
Open the deployed ImagineAI application
- Text-to-image generation
- Multiple visual styles
- Square, portrait, and landscape composition prompts
- Random “Surprise me” prompts
- Loading and error states
- Image download
- Full-image preview
- Responsive dark-themed interface
- Secure server-side API integration
- API rate limiting
- React
- JavaScript
- Vite
- HTML5
- CSS3
- Node.js
- Express
- Cloudflare Workers AI
- FLUX.1 Schnell
- Helmet
- Express Rate Limit
- Dotenv
- CORS
- The user submits an image prompt from the React frontend.
- React sends a POST request to the Express backend.
- The backend securely reads Cloudflare credentials from environment variables.
- The backend calls the Cloudflare Workers AI API.
- Cloudflare generates and returns a Base64 image.
- The backend returns the image to React for display and download.
- Node.js 18 or later
- npm
- Cloudflare account
- Workers AI API token
git clone YOUR_REPOSITORY_URL
cd ai-image-studioInstall the frontend:
cd client
npm installInstall the backend:
cd ../server
npm installCreate a .env file inside the server directory:
CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id
CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
PORT=3001Never commit the .env file.
cd server
npm run devThe backend runs at:
http://localhost:3001
Open another terminal:
cd client
npm run devThe frontend runs at:
http://localhost:5173
POST /api/generateExample request:
{
"prompt": "A futuristic city floating above the clouds",
"style": "Digital art",
"format": "Landscape"
}- API credentials are stored only in the backend
.envfile. - Credentials are never exposed to the React frontend.
- Helmet adds secure HTTP headers.
- Rate limiting restricts repeated image-generation requests.
- Request bodies are size-limited and validated.
- Generation history
- User authentication
- Cloud image storage
- Sharing generated artwork
- Additional AI models
- Automated tests
Lakshmi Swathi Ramineni