A mobile-first web application that allows users to transform photos using AI art styles and order custom printed products. Built with Next.js, TypeScript, Supabase, and Stripe.
- Upload & Style - Select an AI art style and upload a photo
- Generate - Our AI transforms the photo using the selected style
- Preview - Review the generated design with before/after comparison
- Products - Select products to print the design on (canvas, poster, mug, t-shirt, etc.)
- Checkout - Add items to cart and proceed to secure checkout via Stripe
- Order - Track order status and fulfillment progress
- Oil Painting, Watercolor, Pop Art, Vintage, B&W Editorial
- Cartoon, Pet Royal, Sketch, Line Art, Cinematic, Toy, Cutout
Canvas, Poster, Mug, T-Shirt, Hoodie, Sticker, Phone Case, Tote Bag, Digital Download
- Frontend: Next.js 14 with App Router, TypeScript, Tailwind CSS, React Hook Form
- Backend: Node.js API routes, Zod validation
- Database: Supabase (PostgreSQL) with Row-Level Security
- Storage: Supabase Storage for images, Cloudinary for transforms
- Authentication: Supabase Auth with JWT
- Payments: Stripe Checkout (scaffolded, ready for production)
- Fulfillment: Printify API (scaffolded, ready for production)
- AI: OpenAI DALL-E 3 (via abstraction layer, mock provider for dev)
- Node.js 18+ and npm
- A Supabase project
- (Optional) OpenAI API key for real image generation
- (Optional) Stripe account for payments
- (Optional) Printify account for fulfillment
- Clone and install:
git clone <repo>
cd printme-ai
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local with your actual values (see .env.example for required keys).
- Set up Supabase:
# Create tables and policies
psql -h <host> -U <user> -d <database> < database.sql
# Seed initial data (styles and products)
psql -h <host> -U <user> -d <database> < seed.sql-
Create admin user: Add your email to
ADMIN_EMAILSin.env.local. Sign up with that email to automatically grant admin access. -
Run development server:
npm run devOpen http://localhost:3000 in your browser.
app/
├── page.tsx # Landing page
├── layout.tsx # Root layout with navbar
├── auth/ # Authentication pages
│ ├── signup/
│ ├── signin/
│ ├── signout/
│ └── verify-email/
├── app/ # Protected app routes
│ ├── page.tsx # Dashboard
│ ├── create/ # Design creation flow
│ │ ├── style/ # Style selection
│ │ ├── upload/ # Image upload
│ │ ├── preview/ # Design preview
│ │ └── products/ # Product selection
│ ├── cart/ # Shopping cart
│ ├── orders/ # Order history
│ └── designs/ # Design management
├── admin/ # Admin dashboard (protected)
│ ├── layout.tsx # Admin layout with sidebar
│ ├── page.tsx # Dashboard overview
│ ├── orders/
│ ├── products/
│ ├── designs/
│ └── styles/
├── api/ # API routes
│ ├── generate-design/ # AI generation
│ ├── cart/ # Cart operations
│ ├── checkout/ # Stripe integration
│ ├── orders/ # Order endpoints
│ └── webhooks/ # Stripe and Printify webhooks
├── components/ # Reusable UI components
└── lib/ # Utilities and services
├── auth.ts # Auth functions
├── supabase.ts # Supabase client
├── validation.ts # Zod schemas
├── types.ts # TypeScript types
├── ai/ # AI provider abstraction
│ ├── image-provider.ts # Interface
│ ├── mock-image-provider.ts
│ └── openai-image-provider.ts
└── printify/ # Printify client
The lib/ai/image-provider.ts interface allows swapping between mock and real implementations:
- Mock (development): Returns placeholder images instantly
- OpenAI (production): Generates real images using DALL-E 3
Set AI_PROVIDER=openai in .env.local to use real generation.
All database queries use Supabase RLS policies for automatic user data isolation. Users can only access their own orders, designs, and cart.
Full TypeScript coverage with:
- Zod schemas for runtime validation
- Generated types from database schema via Supabase types
- Strict mode enabled
- Create folder in
app/(e.g.,app/new-feature/) - Add
page.tsxwith your component - Use existing components from
components/ - Query database via Supabase client in
lib/supabase.ts
- Create folder in
app/api/(e.g.,app/api/new-endpoint/) - Create
route.tswith POST/GET/etc handler - Use Supabase admin client for backend operations
- Validate input with Zod schemas from
lib/validation.ts - Return
NextResponse.json()
Use Tailwind CSS classes. Component variants are defined in components/. For global styles, edit app/layout.tsx.
npm install -g vercel
vercel login
vercelSet environment variables in Vercel project settings (copy from .env.local).
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]See TODO.md for a detailed checklist. Key items:
-
Connect Real APIs:
- OpenAI DALL-E for image generation
- Stripe for payments
- Printify for order fulfillment
-
Add Missing Pages:
- Order detail pages
- User account settings
- Admin management interfaces
-
Testing & Monitoring:
- End-to-end testing with Playwright
- Error tracking (Sentry)
- Analytics (PostHog)
- Email notifications
-
Compliance:
- Privacy policy
- Terms of service
- GDPR compliance (especially for EU users)
Generate AI design from uploaded image.
{
"uploadId": "uuid",
"styleId": "uuid",
"imageUrl": "https://..."
}Add items to user's cart.
{
"designId": "uuid",
"items": [
{
"productId": "uuid",
"variantId": "uuid",
"quantity": 1
}
]
}Create Stripe checkout session.
{
"cartId": "uuid"
}- Check
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEY - Verify email in Supabase auth confirmation
- Clear browser cookies and restart dev server
- Test Supabase connection:
psql -h <host> -U <user> -d <database> - Check RLS policies in Supabase dashboard
- Verify service role key in
.env.local
- Set
AI_PROVIDER=mockto test with mock provider - Check OpenAI API key and quota
- Monitor API errors in browser console
Private project - not for public distribution.
For issues or questions, contact the development team.