Text to Image Generator SAAS Application with integrated razor pay
4eacdaf1d70f9a0755ef6343dcfbbe5691f50468
A full-stack web application that generates high-quality images from text prompts using advanced AI models. Users can create accounts, purchase credits, and generate images based on their descriptions.
- Features
- Tech Stack
- Prerequisites
- Installation
- Environment Variables
- Usage
- Project Structure
- API Endpoints
- Contributing
- License
- Author
- Contact
- AI-Powered Image Generation: Convert text prompts into high-quality images using advanced AI models
- User Authentication: Secure login and registration system with JWT-based authentication
- Credit-Based System: Purchase credits to generate images with integrated Razorpay payment gateway
- Responsive Design: Modern, mobile-friendly UI built with React and TailwindCSS
- Image History: View and manage previously generated images
- Real-time Notifications: Toast notifications for user feedback and status updates
- Secure File Uploads: Handle image uploads and storage securely
- React 19.1.0: JavaScript library for building user interfaces
- Vite: Fast build tool and development server
- TailwindCSS 4.1.11: Utility-first CSS framework for styling
- React Router DOM: Declarative routing for React applications
- Axios: HTTP client for making API requests
- React Toastify: Toast notifications for user feedback
- Motion: Animation library for React components
- Node.js: JavaScript runtime for server-side development
- Express 5.1.0: Web application framework for Node.js
- MongoDB: NoSQL database for storing user data and image history
- Mongoose: ODM library for MongoDB
- JWT: JSON Web Tokens for authentication
- Bcrypt: Password hashing library
- Razorpay: Payment gateway integration
- CORS: Cross-Origin Resource Sharing middleware
- Nodemailer: Email sending functionality
- Dotenv: Environment variable management
Before running this application, make sure you have the following installed:
- Node.js (version 14 or higher) - Download here
- MongoDB (local installation or cloud instance like MongoDB Atlas)
- Git - Download here
git clone https://github.com/your-username/imagify.git
cd imagify-
Navigate to the server directory:
cd server -
Install dependencies:
npm install
-
Create a
.envfile in the server directory with the required environment variables (see Environment Variables section). -
Start the server:
npm start
The server will run on
http://localhost:4000.
-
Open a new terminal and navigate to the client directory:
cd ../client -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The client will run on
http://localhost:5173(default Vite port).
Create a .env file in the server directory with the following variables:
PORT=4000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secretPORT: Port number for the server (default: 4000)MONGODB_URI: MongoDB connection string (local or cloud)JWT_SECRET: Secret key for JWT token generationRAZORPAY_KEY_ID: Razorpay API key ID for paymentsRAZORPAY_KEY_SECRET: Razorpay API key secret for payments
- Open your browser and navigate to
http://localhost:5173 - Register a new account or log in with existing credentials
- Purchase credits using the integrated Razorpay payment system if needed
- Enter a descriptive text prompt to generate an image
- View your generated images on the result page
- Access your account settings and image history from the dashboard
imagify/
├── client/ # React frontend application
│ ├── public/ # Static assets (favicon, etc.)
│ ├── src/
│ │ ├── assets/ # Images, icons, and media files
│ │ ├── components/ # Reusable React components
│ │ │ ├── Header.jsx
│ │ │ ├── Navbar.jsx
│ │ │ ├── Footer.jsx
│ │ │ └── ...
│ │ ├── context/ # React context for state management
│ │ ├── pages/ # Main application pages
│ │ │ ├── Home.jsx
│ │ │ ├── Result.jsx
│ │ │ ├── History.jsx
│ │ │ └── ...
│ │ ├── App.jsx # Main application component
│ │ ├── main.jsx # Application entry point
│ │ └── index.css # Global styles
│ ├── package.json
│ ├── vite.config.js # Vite configuration
│ └── eslint.config.js # ESLint configuration
├── server/ # Node.js backend application
│ ├── config/ # Database and configuration files
│ │ └── mongodb.js # MongoDB connection setup
│ ├── controllers/ # Route controllers
│ │ ├── userControllers.js
│ │ │ └── imageController.js
│ ├── middlewares/ # Custom middleware functions
│ │ └── auth.js # Authentication middleware
│ ├── models/ # MongoDB data models
│ │ ├── userModel.js
│ │ ├── imageHistoryModel.js
│ │ └── transactionModel.js
│ ├── routes/ # API route definitions
│ │ ├── userRoutes.js
│ │ └── imageRoutes.js
│ ├── uploads/ # Uploaded image storage
│ ├── package.json
│ └── server.js # Server entry point
└── README.md # Project documentation
POST /register- Register a new user accountPOST /login- Authenticate user loginGET /credits- Retrieve user credit balancePOST /pay-razor- Initiate Razorpay payment for credit purchase
POST /generate-image- Generate image from text prompt (requires credits)GET /user-images- Retrieve user's generated image history
We welcome contributions to Imagify! To contribute:
- Fork the repository
- Create a new feature branch (
git checkout -b feature/amazing-feature) - Make your changes and ensure they are well-tested
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request with a clear description of your changes
- Follow the existing code style and structure
- Write clear, concise commit messages
- Test your changes thoroughly before submitting
- Update documentation as needed
This project is licensed under the ISC License - see the LICENSE file for details.
<<<<<<< HEAD Krish
- GitHub: your-username
- Email: your-email@example.com ======= Krish and Mark
4eacdaf1d70f9a0755ef6343dcfbbe5691f50468
For questions, bug reports, or feature requests, please open an issue on GitHub or contact the author directly.
4eacdaf1d70f9a0755ef6343dcfbbe5691f50468

