This MERN stack project leverages the capabilities of the OpenAI API to create an AI image generator. With MongoDB for database management, Express.js for backend development, React for the frontend, and Node.js for server-side scripting, this application provides an intuitive way to generate AI-enhanced images.
- Image Generation: Utilize the power of the OpenAI API to generate unique and creative images.
- MERN Stack: Benefit from the MongoDB, Express.js, React, and Node.js stack for a robust and scalable application.
- User Authentication: Secure user data with authentication features, ensuring a personalized experience.
- Responsive Design: Create a seamless user experience with a responsive and visually appealing design.
Before getting started, make sure you have the following installed:
- Node.js: Download and install Node.js
- npm: npm is the package manager for Node.js and comes bundled with the installation of Node.js.
- MongoDB: Install MongoDB
-
Clone the repository:
git clone https://github.com/minhajhameed/mern-ai-image-generator.git cd mern-ai-image-generator
-
Install dependencies:
npm install
-
Set up MongoDB:
- Create a MongoDB database.
- Copy the
.env.example
file to a new file named.env
and fill in your MongoDB connection URI:
MONGODB_URI=your_mongodb_connection_uri
-
Obtain an API key for the OpenAI API.
-
Copy the
.env.example
file to a new file named.env
and fill in your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
-
Start the development server:
npm run dev
-
Open your browser and visit http://localhost:3000 to see the application in action.
- Go to image generation page.
- Enter your instruction or use "random" button.
- Click the "Generate Image" button.
- The application will communicate with the OpenAI API and display the AI-generated image.
- share Your image with community.
Contributions are welcome! If you have ideas for improvements or find any issues, please submit a pull request or open an issue.
For any questions or feedback, feel free to reach out to us at [email protected].