AI Image Generator - Backend A backend service that enables AI-powered image generation, user authentication, and image storage. Built using Node.js, Express.js, and MongoDB.
π Features
β
AI Image Generation β Generate images based on user prompts
β
User Authentication β Secure login and authentication using JWT TOKEN
β
Image Storage β Save and retrieve images from AWS bucket Storage
β
REST API β Well-documented API endpoints for frontend integration
π Tech Stack
Backend: Node.js, Express.js
Database: Mongo.DB & Mongoose
Authentication: JWT token stored in cookies
Storage: AWS storage S3
AI API: Replicate API
π Installation & Setup: Development
1οΈβ£ Clone the Repository
git clone https://github.com/Null-logic-0/ai-image-gen-backend-1.1.0-.git
cd ai-image-gen-backend-1.1.0-
2οΈβ£ Install Dependencies
npm install
3οΈβ£ Developent: Setup Environment Variables This project uses environment variables to connect to services like MongoDB, AWS, and Replicate. These should be stored in a .env file for local development. Create a .env file in the root directory and add:
DATABASE=your_mongo_URI
DATABASE_PASSWORD=your_password
JWT_SECRET=secret
JWT_EXPIRES_IN=30d
JWT_COOKIE_EXPIRES_IN=30
AWS_ACCESS_KEY_ID=your_AWS_access_key_id
AWS_SECRET_ACCESS_KEY=your_AWS_secret_access_key_id
AWS_REGION=your_AWS_secret_access_key_id
AWS_BUCKET_NAME=your_AWS_bucket_name
REPLICATE_API_TOKEN=your_replicate-ai-token
4οΈβ£ Run the Server
npm run dev
π .env files should never be committed to Git. Make sure .gitignore includes .env
π Installation & Setup: Production
In production, environment variables should be set using your hosting providerβs dashboard. You donβt need or use a .env file on the live server. Use the providerβs UI to add each key (e.g., AWS_BUCKET_NAME, DATABASE, etc.). These will be securely injected into the environment at runtime.
1οΈβ£ Clone the Repository
git clone https://github.com/Null-logic-0/ai-image-gen-backend-1.1.0-.git
cd ai-image-gen-backend-1.1.0-
2οΈβ£ Install Dependencies
npm install
3οΈβ£ Run the Server
npm start
Whatch video ----->
https://www.youtube.com/watch?v=J5digNPWANw
Front-End -------->
https://github.com/Null-logic-0/AI-image-generator-version-1.1.0-Front-end