Transform your drawings into beautiful images with Gemini AI. A Next.js web application that uses AWS Lambda and Google Gemini to convert hand-drawn sketches into AI-generated images.
- Interactive Drawing Canvas - Draw sketches with customizable brush colors and sizes
- AI Image Generation - Convert sketches to realistic images using Google Gemini AI
- Multiple Art Styles - Choose from realistic, anime, watercolor, and more styles
- Eraser Tool - Correct mistakes while drawing
- Download Support - Save your drawings and generated images
- Responsive Design - Works on desktop and mobile devices
- Dark Theme - Modern dark UI with gradient accents
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Radix UI - Accessible UI components
- Lucide Icons - Beautiful icon library
- AWS Lambda - Serverless image generation
- AWS API Gateway - REST API endpoint
- AWS S3 - Image storage (optional)
- Google Gemini AI - Image generation model
- Node.js 18+
- pnpm (recommended) or npm
- AWS Account (for Lambda deployment)
- Google Gemini API Key
git clone https://github.com/Whiterose48/AWS.git
cd drawing-apppnpm installCreate a .env.local file in the root directory:
API_GATEWAY_URL=https://[your-api-id].execute-api.[region].amazonaws.com/prod/generateFollow the detailed instructions in AWS_SETUP.md to:
- Create the Lambda function
- Set up API Gateway
- Configure CORS
- Add your Gemini API key
pnpm devOpen http://localhost:3000 in your browser.
drawing-app/
├── app/
│ ├── api/
│ │ └── generate/ # API route for Lambda proxy
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/
│ ├── drawing-canvas.tsx # Main drawing component
│ ├── theme-provider.tsx # Dark theme provider
│ └── ui/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── lambda_function.py # AWS Lambda function code
└── AWS_SETUP.md # AWS deployment guide
- Draw - Create a sketch on the canvas using the drawing tools
- Select Style - Choose your preferred art style (realistic, anime, etc.)
- Generate - Click "Generate with AI" to send the sketch to AWS Lambda
- View Result - The AI generates an image based on your sketch
- Download - Save the generated image to your device
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌────────────┐
│ Next.js │────▶│ API Gateway │────▶│ Lambda │────▶│ Gemini AI │
│ Frontend │◀────│ (REST) │◀────│ Function │◀────│ API │
└─────────────┘ └──────────────┘ └─────────────┘ └────────────┘
│
▼
┌─────────────┐
│ S3 Bucket │
│ (Optional) │
└─────────────┘
| Variable | Description | Required |
|---|---|---|
API_GATEWAY_URL |
AWS API Gateway endpoint URL | Yes |
| Variable | Description |
|---|---|
GEMINI_API_KEY |
Google Gemini API key |
S3_BUCKET_NAME |
S3 bucket for image storage |
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
This project is part of CLOUD TECHNOLOGY INFRASTRUCTURE (1-2025)
School of Information Technology, KMITL
Natthawee Naewkampol Phachara Pornanothai Yodsakorn Chuwong Porntipa Phunsri Asia Onprom
Powered by Next.js, AWS Lambda, and Google Gemini AI