VisuTry:基于 Google Nano Banana 的 AI 虚拟眼镜试戴应用
franksunye/VisuTry
VisuTry 是一款 AI 虚拟眼镜试戴应用,用户上传照片和眼镜图片即可预览佩戴效果,试戴由 Google Nano Banana 驱动。项目采用 Next.js 14、React 18、TypeScript、PostgreSQL + Prisma 构建,集成 Auth0 登录与 Stripe 支付,支持免费试用和高级订阅,并部署在 Vercel 上,采用 MIT 许可证开源。
VisuTry is a cutting-edge AI-powered virtual glasses try-on application. It allows users to upload their photos and custom glasses images to preview how different eyewear looks on them using advanced AI technology.
✨ Features
- 🤖 AI Try-On Technology: Realistic virtual try-on powered by Google Nano Banana.
- 👤 User Authentication: Secure authentication with Auth0, supporting Google, Twitter, and more.
- 💳 Payment System: Integrated with Stripe for free trials and premium plans.
- 📱 Responsive Design: Optimized for both desktop and mobile devices.
- 🔗 Social Sharing: Generate shareable links for your try-on results.
- 📊 User Dashboard: Manage your try-on history, usage statistics, and account settings.
- 🖼️ Custom Uploads: Upload your own photos and glasses images.
- ⚡ Real-time Processing: Asynchronous AI processing with live status updates.
- ⚖️ Legal Compliance: Includes a privacy policy, terms of service, and refund policy.
🛠 Tech Stack
Frontend
- Framework: Next.js 14 (App Router)
- UI Library: React 18 + TypeScript
- Styling: Tailwind CSS + Lucide React Icons
- State Management: React Hooks
Backend
- API: Next.js API Routes
- Database: PostgreSQL + Prisma ORM
- Authentication: NextAuth.js + Auth0
- Payment: Stripe
- File Storage: Vercel Blob
- AI Service: Google Nano Banana
Deployment
- Platform: Vercel
- Database: Neon PostgreSQL
- CDN: Vercel Edge Network
- Version Control: Git with semantic versioning
📁 Project Structure
VisuTry/
├── src/
│ ├── app/ # Next.js App Router
│ ├── components/ # React components
│ ├── lib/ # Utility libraries
│ └── ...
├── prisma/ # Database schema and migrations
├── docs/ # Project documentation
└── ...
🚀 Quick Start
Demo Mode (Recommended)
Experience all features instantly without any API keys.
-
Clone the repository:
git clone https://github.com/franksunye/VisuTry.git cd VisuTry -
Install dependencies:
npm install
-
Start in demo mode:
# For Windows npm run test:start:windows # For Linux/Mac npm run test:start
Alternatively, you can manually start the demo mode by running
cp .env.test .env.local && npm run dev.
Visit http://localhost:3000 to start using the application.
Production & Development
For production deployment and local development with real API services, please refer to the Development Guide.
🔄 How It Works
- User Authentication: Sign in with your preferred OAuth provider.
- Upload Images: Upload your photo and a custom glasses image.
- AI Processing: The Gemini AI model processes the virtual try-on.
- Real-time Updates: Monitor the processing status with live updates.
- View & Share: View the AI-generated result and share it on social media.
🧪 Testing
This project includes a comprehensive test suite. For detailed instructions, see the Testing Guide.
# Run all tests npm test
📚 Documentation
🚀 Deployment
The application is deployed on Vercel. For a full list of required environment variables for production, see the Development Guide.
🤝 Contributing
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new feature branch.
- Commit your changes following the Conventional Commits specification.
- Open a Pull Request.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
来源:GitHub · github.com