How harshaislive/ai_image_gen works
Project Type and Purpose
• This is a full-stack, monorepo web application for text-to-image and image-to-image generation using the OpenAI API.
• The frontend is a minimalist React + Tailwind UI; the backend is a Node.js proxy server that secures the OpenAI API key.
File-Structure Analysis
• Top level:
• backend/ – Node.js service (index.js, package.json, .env)
• frontend/ – React app (src/, Vite config, Tailwind config)
• package.json + scripts for monorepo install/dev
• Patterns: clear separation of UI and API layers; no direct API calls in the frontend.
• Key config: frontend/vite.config.js, tailwind.config.js, backend/.env.example.
README Insights
• Describes a proxy pattern: frontend → backend → OpenAI API.
• Local development ports: 5173 (frontend), 5000 (backend).
• Emphasizes security: API key never exposed.
Essential Architectural Elements to Capture
• Monorepo structure: shared root scripts (npm run dev, install-all).
• Build & serve steps for frontend and backend.
• Security boundary (backend holds secrets).
• UI components handling text prompts and mask uploads.
• Data flow from user input → AI service → rendered output.