A modern Next.js application for creating beautiful personalized birthday greetings with multiple templates.
- π¨ 3 Beautiful Templates: Classic Birthday Card, 3D Photo Carousel, Interactive Gift Card
- πΈ Custom Photo Upload: Add personal photos to greetings
- β±οΈ 2-Day Link Expiry: Greeting links automatically expire after 2 days
- π Shareable Links: Easy sharing via WhatsApp, Email, Twitter
- π Built with Next.js 15: Modern React framework with App Router
- π± Fully Responsive: Works perfectly on all devices
- β‘ Vercel Ready: Optimized for Vercel deployment
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Deployment: Vercel
- File Upload: Formidable
- UUID Generation: uuid
nextwish-app/
βββ app/
β βββ api/
β β βββ templates/route.ts # Get available templates
β β βββ generate/route.ts # Generate greeting
β β βββ greeting/[id]/route.ts # Greeting info/delete
β β βββ cleanup-expired/route.ts # Cleanup expired greetings
β β βββ route.ts # API info
β βββ greeting/[id]/page.tsx # View greeting page
β βββ page.tsx # Homepage
β βββ layout.tsx # Root layout
βββ lib/
β βββ config.ts # Configuration constants
β βββ utils.ts # Utility functions
βββ public/
β βββ templates/ # Template files
β β βββ birday_temp1/
β β βββ birday_temp2/
β β βββ birday_temp3/
β βββ generated/ # Generated greetings
β βββ uploads/ # Temporary uploads
β βββ app.js # Client-side JavaScript
β βββ style.css # Styles
βββ package.json
-
Install Dependencies:
npm install
-
Run Development Server:
npm run dev
-
Access the Application: Open http://localhost:3000
-
Install Vercel CLI:
npm i -g vercel
-
Login to Vercel:
vercel login
-
Deploy:
vercel
-
Deploy to Production:
vercel --prod
- Go to vercel.com
- Click "Add New..." β "Project"
- Import your Git repository
- Vercel will auto-detect Next.js and configure settings
- Click "Deploy"
No environment variables are required for basic operation. The app uses file-based storage in the public directory.
Get API information
Get available templates
Response:
{
"success": true,
"templates": [
{
"id": "template1",
"name": "Classic Birthday Card",
"description": "...",
"required_fields": ["name", "user_image", "message"],
"optional_fields": []
}
]
}Generate a new birthday greeting
Form Data:
template_id: Template ID (template1, template2, or template3)name: Recipient's namemessage: Birthday message (required for template1 and template3)user_image: Single photo (required for template1)images: 10 photos (required for template2)
Response:
{
"success": true,
"greeting_id": "uuid",
"greeting_url": "https://yourdomain.com/greeting/uuid",
"template_used": "template1",
"recipient_name": "John",
"uploaded_files": ["user_photo.jpg"],
"created_at": "2024-10-26T...",
"expires_at": "2024-10-28T...",
"valid_for_days": 2,
"expiry_notice": "This link will expire on October 28, 2024 at 10:00 PM"
}Get greeting information
Delete a greeting
Cleanup all expired greetings
- Requires: User photo, custom message
- Features: Animated balloons, cake, fireworks
- Perfect for: Personal birthday wishes
- Requires: Exactly 10 photos
- Features: Rotating 3D carousel with music
- Perfect for: Photo memories showcase
- Requires: Custom message
- Features: Interactive gift box animation
- Perfect for: Elegant birthday wishes
- All greeting links expire after 2 days
- Expired greetings are automatically deleted
- Users are notified of expiry date when creating greetings
- Manual cleanup available via
/api/cleanup-expiredendpoint
-
File Storage: Currently uses file-based storage. For production, consider:
- Cloud storage (AWS S3, Vercel Blob, Cloudinary)
- Database for metadata
- CDN for asset delivery
-
Security:
- File upload validation is implemented
- Directory traversal protection included
- Consider adding rate limiting
- Add CSRF protection for forms
-
Scaling:
- Implement background job for cleanup
- Use serverless functions efficiently
- Consider caching strategies
-
Monitoring:
- Add error tracking (Sentry, LogRocket)
- Monitor storage usage
- Track greeting creation metrics
MIT License - Feel free to use and modify for your projects!
For issues or questions, please open an issue on the repository.
This project was converted from Flask to Next.js for better Vercel deployment compatibility and modern React features. All original functionality has been preserved and enhanced with TypeScript type safety.