Skip to content

πŸŒ… Here's my MERN stack web app that generates beautiful images using the OpenAI API. Come explore the possibilities!

License

Notifications You must be signed in to change notification settings

bbkx226/ImageGenerationAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Image Generator Website

Welcome to the AI Image Generator website! This is a full-stack web application that utilizes the MERN (MongoDB, Express.js, React.js, Node.js) stack, Vite.js and the OpenAI API to generate realistic images. The website is accessible to everyone through this link.

Technologies Used

The following technologies were used to build this website:

  • MongoDB: A document-oriented NoSQL database used to store photo links generated by the OpenAI API.
  • Express.js: A back-end web application framework for Node.js used to create a RESTful API.
  • React.js: A front-end JavaScript library used to create the user interface and interact with the API.
  • Node.js: A JavaScript runtime environment used for the back-end server.
  • OpenAI API: An artificial intelligence API that generates high-quality images based on user inputs.
  • Cloudinary: An end-to-end image and video management platform that stores generated photos.
  • Vite.js: A build tool that serves the website in development and optimizes the website for production.

How it Works

The AI Image Generator website is designed to be simple and easy to use. Here's how it works:

  1. User clicks the "create" button
  2. User can choose to type anything or clicks the "surprise me" button to generate a random prompt
  3. User clicks the "Generate" button
  4. The website sends a request to the OpenAI API with the specified parameters
  5. The OpenAI API generates a high-quality image based on the parameters
  6. The website stores the generated image in Cloudinary and retrieves the image URL
  7. The website stores the image URL in MongoDB
  8. User can choose to share with the community by clicking the "share" button
  9. The website displays the generated image to the user at the Home page.

Installation

To run this website locally, follow these steps:

  1. Clone the repository: git clone https://github.com/bbkx226/ImageGenerationAI.git
  2. Install the dependencies for the server: cd server && npm install
  3. Install the dependencies for the client: cd ../client && npm install
  4. Create a file named .env in the server directory with the following content:
MONGODB_URL=<Your MongoDB connection string>
OPENAI_API_KEY=<Your OpenAI API key>
CLOUDINARY_CLOUD_NAME=<Your Cloudinary cloud name>
CLOUDINARY_API_KEY=<Your Cloudinary API key>
CLOUDINARY_API_SECRET=<Your Cloudinary API secret>
  1. Start the server: cd ../server && npm start
  2. Start the client: cd ../client && npm run dev
  3. Open http://localhost:5173 in your web browser to access the website.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

This project was created by Brandon Ban. If you have any questions or feedback, please don't hesitate to contact me at bbkx226@gmail.com.

About

πŸŒ… Here's my MERN stack web app that generates beautiful images using the OpenAI API. Come explore the possibilities!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published