This project is an AI-powered image generation application built using the MERN stack (MongoDB, Express.js, React.js, Node.js), Tailwind CSS, OpenAI API, and Cloudinary. It allows users to generate realistic images based on their inputs and showcase them in the community.
- User-friendly interface for generating AI-generated images
- Integration with OpenAI API for image generation
- Image storage and management using Cloudinary
- MongoDB database for storing user information and generated images
- Community page to showcase your work
- Responsive design powered by Tailwind CSS
Follow the instructions below to set up and run the project on your local machine:
- Clone the repository:
git clone https://github.com/nishaaannnt/openai-image-website
- Navigate to the project directory:
cd ai-image-generation
- Install the dependencies for the backend:
cd server
npm install
- Configure the environment variables:
-
Create a
.env
file in theserver
directory. -
Set up the necessary environment variables in the
.env
file. For example:PORT=5000 DATABASE_URL=<your-mongodb-url> 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>
-
You can obtain the API keys by heading to their respective websites
- Install the dependencies for the frontend:
cd ../client
npm install
- Build the frontend assets:
npm run build
- Start the server:
cd ../server
npm start
- Access the application on
http://localhost:5000
in your browser.
API used in the application is mine personal so if you cannot generate an image there is a possibility that API requests have reached their limit