A modern web application built with SvelteKit and Tailwind CSS that allows users to generate stunning images using OpenAI's image generation models.
Website: https://gpt-images.ayfri.com
- AI Image Generation: Leverages OpenAI's powerful models to create images from text prompts.
- API Key Management: Securely stores your OpenAI API key in the browser's IndexedDB.
- Image Gallery: Displays previously generated images.
- Regenerate Option: Easily regenerate an image with the same prompt.
- Usage Statistics: Tracks usage information (details depend on implementation).
- Responsive Design: Adapts beautifully to different screen sizes thanks to Tailwind CSS.
- Modern UI: Clean and intuitive user interface built with Svelte.
- SEO Optimized: Includes comprehensive meta tags and Open Graph properties for better search engine visibility and social sharing.
- Framework: SvelteKit
- Styling: Tailwind CSS
- Language: TypeScript
- AI: OpenAI API
- Icons: Lucide Svelte
- Client-side Storage: IndexedDB (via
idblibrary) - Package Manager: pnpm
- Build Tool: Vite
- Node.js (v18 or higher recommended)
- pnpm (Install using
npm install -g pnpm) - An OpenAI API Key (Get one from OpenAI Platform)
-
Clone the repository:
git clone https://github.com/Ayfri/gpt-images.git cd gpt-images -
Install dependencies:
pnpm install
-
Environment Variables (Optional): If the application requires environment variables (e.g., for a backend API key if implemented differently), create a
.envfile in the root directory based on.env.example(if provided).# Example .env file content OPENAI_API_KEY="your_secret_key_here" # Usually handled client-side in this setupNote: In the current setup, the API key seems to be managed client-side via the UI and stored in IndexedDB. Be mindful of security implications when handling API keys.
pnpm run devThis command starts a local development server. Open your browser and navigate to http://localhost:5173 (or the port specified in the output).
Enter your OpenAI API key in the application's UI to start generating images.
pnpm run buildThis command creates an optimized production build of your application in the build directory (or as configured in svelte.config.js).
pnpm run previewThis command starts a local server to preview the production build.
gpt-images/
├── .svelte-kit/ # SvelteKit build artifacts (generated)
├── node_modules/ # Project dependencies (managed by pnpm)
├── public/ # Static assets (favicon, images, etc.)
├── src/
│ ├── app.css # Global CSS styles
│ ├── app.html # HTML template shell
│ ├── assets/ # Static assets imported by modules
│ ├── lib/ # Application library (components, utils, etc.)
│ │ ├── components/ # Reusable Svelte components
│ │ ├── db/ # Database interaction (IndexedDB)
│ │ ├── services/ # API interactions (OpenAI)
│ │ ├── stores/ # Svelte stores
│ │ └── utils/ # Utility functions
│ ├── routes/ # Application pages and endpoints
│ │ ├── +layout.svelte # Root layout component
│ │ └── +page.svelte # Main page component
│ └── ... # Other SvelteKit files (hooks, service-worker)
├── .gitignore # Files/folders ignored by Git
├── package.json # Project metadata and dependencies
├── pnpm-lock.yaml # Exact dependency versions
├── pnpm-workspace.yaml # pnpm workspace configuration
├── postcss.config.js # PostCSS configuration
├── README.md # This file
├── svelte.config.js # SvelteKit configuration
├── tailwind.config.js# Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── tsconfig.node.json# TypeScript configuration for Node.js parts
└── vite.config.ts # Vite configuration
Contributions are welcome! Please follow standard fork-and-pull-request workflows.
This project is licensed under the MIT License - see the LICENSE file for details (if applicable).
