Skip to content

Latest commit

ย 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽจ Art Genie

Turn your imagination into stunning AI-generated art!

Welcome to Art Genie, the ultimate web application where you can create breathtaking images from text prompts. Powered by cutting-edge AI and built with the MERN stack, Art Genie is your gateway to exploring the fusion of technology and creativity.


VercelReactJSTailwindCSSFramer MotionNodeJSExpressJSMongoDBRazorPayJWT


๐Ÿš€ Features

โœจ Text-to-Image Generation

  • Input any text prompt, and let Art Genie transform your words into stunning visuals using Google Gemini AI.

๐Ÿ’ณ Buy Credits Seamlessly

  • Purchase more credits to generate additional images using Razorpay's secure payment gateway.

๐Ÿ”’ Secure User Authentication

  • Your data is safe with us! Authentication is powered by JWT and bcrypt for maximum security.

๐Ÿ’ƒ Smooth Animations

  • Enjoy a visually engaging experience with seamless transitions and animations using Framer Motion.

๐Ÿ“ฑ Responsive Design

  • Access Art Genie on any device. Tailwind CSS ensures a stunning, user-friendly interface across all screen sizes.

๐Ÿ› ๏ธ Tech Stack

Frontend:

  • React.js
  • Tailwind CSS for responsive design and styling
  • Framer Motion for animations

Backend:

  • Node.js
  • Express.js
  • MongoDB + Mongoose

Other Tools:

  • Clipdrop API for AI-generated images
  • Razorpay for payments
  • JWT and bcrypt for authentication

๐Ÿ›’ How It Works

  1. Sign Up / Log In ๐Ÿ”‘
    Create an account or log in to access the features.

  2. Enter a Text Prompt โœ๏ธ
    Describe your idea or vision in words.

  3. Generate AI Art ๐ŸŽจ
    Click on "Generate" and watch your words turn into stunning artwork!

  4. Buy Credits ๐Ÿ’ณ
    Purchase more credits directly through Razorpay when needed.

  5. Download and Share ๐Ÿ–ผ๏ธ
    Save your masterpiece or share it with the world!


๐Ÿ“ธ Screenshots

Take a visual tour of Art Genie:

1. Signup Page

Users can create an account to access the platform.
Signup Page

2. Login Page

Returning users can log in securely.
Login Page

3. Main Page (Logged Out)

Explore the homepage when not logged in.
Main Page

4. Main Page (Logged In)

Once logged in, users can access features to generate AI images.
Main Page Logged In

5. Pricing Page

Buy credits easily to generate more AI images.
Pricing Page

6. Generate Image Page

Enter a text prompt to generate stunning AI art.
Generate Image Page

7. Loading Page

Enjoy smooth animations while your image is being created.
Loading Page

8. Result Page

View and download the AI-generated masterpiece.
Result Page

9. Generate Another Page

Create more art seamlessly with the โ€œGenerate Anotherโ€ option.
Generate Another Page


๐Ÿ“ฆ Installation

Project Structure

artgenie/
โ”œโ”€โ”€ client/
โ”‚   โ”œโ”€โ”€ .env
โ”‚   โ”œโ”€โ”€ .gitignore
โ”‚   โ”œโ”€โ”€ eslint.config.js
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ postcss.config.js
โ”‚   โ”œโ”€โ”€ tailwind.config.js
โ”‚   โ”œโ”€โ”€ vite.config.js
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ index.css
โ”‚   โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ assets.js
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Description.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Footer.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GenerateButton.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Header.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Login.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Steps.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Testimonial.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ AppContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BuyCredit.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Result.jsx
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ .env
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ server.js
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ mongodb.js
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ imageController.js
โ”‚   โ”‚   โ””โ”€โ”€ userController.js
โ”‚   โ”œโ”€โ”€ middlewares/
โ”‚   โ”‚   โ””โ”€โ”€ auth.js
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ transactionModel.js
โ”‚   โ”‚   โ””โ”€โ”€ userModel.js
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ imageRoutes.js
โ”‚   โ”‚   โ””โ”€โ”€ userRoutes.js
โ”‚   โ””โ”€โ”€ ...

Clone the repository and install dependencies:

git clone https://github.com/Aashay30/art-genie.git
cd art-genie

Backend Setup

cd server  
npm install  
npm start

Frontend Setup

cd client  
npm install  
npm start  

Key Features

API Integrations

  • Clipdrop API ๐ŸŽจ: Integrated for AI-powered image generation from text prompts.
  • Razorpay ๐Ÿ’ณ: Seamlessly handles secure credit purchases and payment transactions.

Authentication Flow

  • JWT-Based Token System ๐Ÿ”‘: Implements secure authentication using JWT for session management.
  • Password Security ๐Ÿ›ก๏ธ: Utilizes bcrypt for hashing and securing user passwords.

State Management

  • React Context API ๐Ÿ”„: Manages global state efficiently, ensuring smooth data flow across the application.

Database Structure

  • MongoDB Collections ๐Ÿ—ƒ๏ธ:
    • Users Collection ๐Ÿ‘ค: Stores user credentials and profile details.
    • Transactions Collection ๐Ÿ’ฐ: Logs payment history and credit purchases.
    • Art Generation Logs ๐Ÿ“: Maintains records of generated images and text prompts.

๐Ÿ—๏ธ System Architecture

  • Frontend: React.js โš›๏ธ, Tailwind CSS ๐ŸŽจ, Framer Motion โœจ
  • Backend: Node.js & Express.js ๐Ÿš€
  • Database: MongoDB ๐Ÿ—„๏ธ
  • Payment Gateway: Razorpay ๐Ÿ’ณ
  • Authentication: JWT and bcrypt ๐Ÿ”‘๐Ÿ›ก๏ธ
  • AI Integration: Clipdrop API for text-to-image generation ๐Ÿค–๐ŸŽจ

๐Ÿ“– API Documentation

User Routes

  • POST /api/v1/users/register โœ๏ธ: Register a new user.
  • POST /api/v1/users/login ๐Ÿ”‘: Authenticate a user and return a JWT.

Image Routes

  • POST /api/v1/images/generate ๐ŸŽจ: Generate an AI image from a text prompt.
  • GET /api/v1/images/:id ๐Ÿ“ท: Retrieve details of a generated image.

๐Ÿšง Challenges & Problems Faced During Art Genie Development (STAR Format)


๐Ÿ”‘ Secure Authentication & User Data Protection

  • Situation: Art Genie required robust authentication and secure user data handling for a public-facing AI art platform.
  • Task: Implement a secure authentication system and protect sensitive user data.
  • Action: Integrated JWT for stateless authentication, used bcrypt for password hashing, and enforced secure API endpoints with middleware.
  • Result: Achieved a secure login and registration flow, ensuring user data privacy and building user trust.

๐Ÿ’ณ Razorpay Payment Integration

  • Situation: Users needed a seamless way to purchase credits for generating more AI images.
  • Task: Integrate a reliable payment gateway and handle payment verification securely.
  • Action: Used Razorpayโ€™s Node.js SDK for payment processing, implemented server-side verification, and managed transaction logs in MongoDB.
  • Result: Enabled smooth, secure credit purchases with real-time feedback, increasing user engagement and monetization.

๐ŸŽจ Real-Time AI Image Generation

  • Situation: Users expected fast, high-quality image generation from text prompts.
  • Task: Integrate an AI image generation API and optimize the user experience during processing.
  • Action: Connected to the Clipdrop API for text-to-image, implemented async request handling, and added animated loading states with Framer Motion.
  • Result: Delivered a responsive, visually engaging experience with minimal wait times and clear feedback during image generation.

๐Ÿ›ก๏ธ API Security & Rate Limiting

  • Situation: Open AI endpoints could be abused, leading to excessive costs or service disruption.
  • Task: Protect AI generation endpoints from abuse and ensure fair usage.
  • Action: Added authentication checks, implemented credit deduction logic, and set up basic rate limiting on sensitive routes.
  • Result: Prevented unauthorized access and abuse, ensuring platform stability and cost control.

๐Ÿ“ฑ Responsive & Animated UI

  • Situation: The app needed to look great and work smoothly on all devices, with engaging transitions.
  • Task: Build a responsive, animated UI that delights users on desktop and mobile.
  • Action: Used Tailwind CSS for responsive layouts and Framer Motion for smooth animations and transitions.
  • Result: Achieved a modern, mobile-friendly interface with delightful user interactions and high engagement.

๐Ÿ—ƒ๏ธ Database Design & Scalability

  • Situation: Needed to store user data, transactions, and generated art efficiently for future growth.
  • Task: Design a scalable MongoDB schema for users, transactions, and art logs.
  • Action: Modeled collections for users, transactions, and image logs; used Mongoose for schema validation and relationships.
  • Result: Ensured reliable data storage, easy retrieval, and scalability for future features like user galleries and analytics.

๐Ÿ”„ State Management & Global Context

  • Situation: Multiple components needed access to user state, credits, and art generation status.
  • Task: Implement efficient global state management.
  • Action: Leveraged React Context API to manage authentication, credits, and image generation state across the app.
  • Result: Provided a seamless, consistent user experience with accurate state updates and minimal prop drilling.

๐Ÿงช Error Handling & User Feedback

  • Situation: Users needed clear feedback for errors (e.g., failed payments, invalid prompts, API issues).
  • Task: Handle errors gracefully and inform users without breaking the flow.
  • Action: Implemented try/catch blocks, displayed user-friendly error messages, and used animated loaders for async operations.
  • Result: Reduced user frustration and improved trust by providing clear, actionable feedback for all operations.

๐Ÿš€ Deployment & Environment Management

  • Situation: The app required smooth deployment and secure handling of environment variables for both frontend and backend.
  • Task: Set up reliable deployment pipelines and manage secrets securely.
  • Action: Used Vercel for frontend deployment, managed environment variables for API keys and secrets, and documented setup steps for contributors.
  • Result: Achieved fast, reliable deployments with no secret leaks and easy onboarding for new developers.

๐Ÿ“š Rapid Learning & API Integration

  • Situation: Needed to quickly learn and integrate new APIs (Clipdrop, Razorpay) with limited documentation.
  • Task: Master new tools and deliver features on a tight timeline.
  • Action: Studied API docs, explored community examples, and iteratively built/tested integrations.
  • Result: Successfully delivered advanced features and became proficient in new technologies, demonstrating adaptability and fast learning.

๐Ÿ“ Summary

Art Genieโ€™s development journey highlights expertise in full-stack engineering, secure authentication, payment integration, real-time AI API usage, responsive UI/UX, and robust error handling. Each challenge was met with a structured, results-driven approach, making these experiences ideal for behavioral interview discussions.


๐ŸŒŸ Key Takeaways from the Art Genie Project


1. Full-Stack Development Mastery โš›๏ธ๐Ÿ–ฅ๏ธ

  • Built a production-ready application using the MERN stack (MongoDB, Express, React, Node.js).
  • Designed and implemented both frontend and backend, ensuring seamless integration and data flow.

2. Secure Authentication & User Management ๐Ÿ”

  • Gained hands-on experience with JWT-based authentication and bcrypt for password security.
  • Developed middleware to protect sensitive routes and manage user sessions securely.

3. Payment Gateway Integration ๐Ÿ’ณ

  • Successfully integrated Razorpay for real-time, secure credit purchases.
  • Implemented server-side payment verification and transaction logging, ensuring financial integrity.

4. Real-Time AI API Integration ๐ŸŽจ๐Ÿค–

  • Integrated Clipdrop API for text-to-image generation, handling asynchronous workflows and error states.
  • Optimized user experience with animated loaders and progress indicators.

5. Responsive & Animated UI Design ๐Ÿ“ฑโœจ

  • Leveraged Tailwind CSS and Framer Motion to create a visually appealing, fully responsive, and interactive interface.
  • Ensured consistent UX across devices and screen sizes.

6. Robust State Management ๐Ÿ”„

  • Utilized React Context API for efficient global state management, reducing prop drilling and improving maintainability.
  • Ensured real-time updates for user credits, authentication, and generated images.

7. Database Design & Scalability ๐Ÿ—ƒ๏ธ๐Ÿš€

  • Modeled scalable MongoDB schemas for users, transactions, and art logs using Mongoose.
  • Prepared the application for future features like user galleries and analytics.

8. Error Handling & User Feedback ๐Ÿงชโœ…

  • Implemented comprehensive error handling and user-friendly feedback for all major workflows.
  • Used animated loaders and clear messages to keep users informed and engaged.

9. Deployment & Environment Management ๐Ÿš€๐Ÿ”’

  • Deployed the application on Vercel and managed environment variables securely for both frontend and backend.
  • Documented setup and deployment steps for easy onboarding and collaboration.

10. Rapid Learning & Adaptability ๐Ÿ“šโšก

  • Quickly learned and integrated new APIs (Clipdrop, Razorpay) with limited documentation.
  • Demonstrated adaptability and problem-solving in a fast-paced development environment.

11. Production-Ready Best Practices ๐Ÿ› ๏ธ

  • Maintained high code quality with ESLint, Prettier, and modular architecture.
  • Followed best practices for security, scalability, and maintainability throughout the project.

๐Ÿ“ Summary

The Art Genie project provided deep experience in building secure, scalable, and user-friendly full-stack applications. It highlights strengths in authentication, payment integration, real-time API usage, responsive UI/UX, and rapid problem-solvingโ€”making these takeaways valuable for future roles and interviews.


๐Ÿ”ฎ Future Enhancements

  • Add support for multiple languages in text prompts ๐ŸŒ.
  • Implement user profiles with saved artwork ๐Ÿ‘ค๐Ÿ–ผ๏ธ.
  • Introduce social sharing features for generated images ๐Ÿ“ฒ.

๐Ÿ› ๏ธ Skills Demonstrated

  • Full-stack development with the MERN stack โš›๏ธ๐ŸŒ.
  • API integration and payment gateway implementation ๐Ÿ”Œ๐Ÿ’ณ.
  • Responsive UI design with Tailwind CSS ๐Ÿ“ฑ๐ŸŽจ.
  • State management using React Context API ๐Ÿ”„.
  • Authentication and security with JWT and bcrypt ๐Ÿ”‘๐Ÿ›ก๏ธ.

About

ArtGenie is an AI art generator using MERN, JWT auth, Razorpay payments, and responsive UI with React, Tailwind, and Framer Motion. Link : https://pixelcanvas-frontend.onrender.com/

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages