Create the full Prisma schema for all models: User, Subscription, Generation, SavedThumbnail, UsageTracking, Template. Include relations, enums, and indexes. This is a prerequisite for all backend API tasks.
Configure Zustand stores for the application: user/session store, generation store (current generation, history), UI store (sidebar, modals, theme). Export typed hooks. Note: all studio and dashboard frontend sections depend on this global state layer.
Configure Tailwind CSS with the SRD color palette (primary #3A3D40, secondary #FF6F61, accent #FFD700, etc.). Set up shadcn/ui component library, global CSS variables for light/dark mode, Framer Motion global variants, and shared typography scales. All frontend pages depend on this.
Integrate Cloudinary SDK for image upload, transformation, and delivery: configure upload presets, signed uploads from server actions, CDN URL generation, and secure deletion. Used by thumbnail generation and the thumbnail editor export flow.
Design and implement structured internal prompt templates for all AI generation types: viral captions, high-CTR thumbnails, Instagram hooks, YouTube titles/descriptions, short-form reel titles, and hashtag packs. Templates should be language-aware (EN/HI/Hinglish/GU) and platform-aware. Store as typed constants or a template registry.
Run Prisma migrations to create all tables in PostgreSQL. Create seed scripts for plan tiers (Free, Pro), default templates, and sample data for local development.
Set up Clerk Auth for the Next.js 15 App Router: configure middleware.ts for protected routes, sync Clerk user webhooks to create/update User records in PostgreSQL, and expose user context via server actions. Supports social auth (Google, etc.). Note: frontend dashboard and studio pages depend on this task being complete.
Implement Next.js 15 App Router metadata API for static and dynamic SEO: page titles, descriptions, OG images, canonical URLs. Generate sitemap.xml and robots.txt. Create dynamic SEO pages for key landing sections. Supports the SRD SEO requirement.
Set up multi-language support for English, Hindi, Hinglish, and Gujarati using next-intl or i18next. Configure locale routing, translation files, RTL support if needed, and language switcher utility. All content-facing frontend pages depend on this.
Implement server-side or client-side PNG export for the thumbnail editor: use html2canvas or a canvas-based approach to flatten the editor canvas (text layers, uploaded images, fonts, resize elements) into a single PNG. Upload final export to Cloudinary and return download URL. Supports ThumbnailStudio Export flow.
Build the Next.js API route / server action for AI caption generation: accept topic, platform, tone, language inputs; apply structured prompt templates for viral captions, hooks, hashtags, CTA, emoji-rich versions; call OpenAI API; persist Generation record; enforce usage limits per subscription tier. Supports CaptionStudio frontend page.
Build the Next.js API route / server action for AI thumbnail generation: accept video title, niche, style, color theme; apply structured prompt templates for high-CTR thumbnails; call OpenAI Images API; upload generated images to Cloudinary; persist Generation + SavedThumbnail records; enforce usage limits. Supports ThumbnailStudio frontend page.
Build API routes / server actions for history management: list user generations (paginated), save generation, delete generation, toggle favorite. Filter by type (caption/thumbnail), platform, date range. Supports History and Dashboard frontend pages.
Build API routes / server actions for usage tracking: fetch daily generation counts per user, enforce free plan (5/day) vs Pro (unlimited) limits, return usage stats for dashboard display. Supports Dashboard and Billing frontend pages.
Integrate Stripe for subscription management: create products/prices for Free and Pro plans, build checkout session API, handle Stripe webhooks (subscription created/updated/deleted) to sync subscription status in DB, expose subscription status via server action. Supports Billing and Pricing frontend pages.
Build admin-only API routes for user account management: list users (paginated, with search/filter), view user details, update user roles/status, view subscription info per user. Restricted to admin role. Supports Admin Users page.
Build admin-only API routes for platform analytics: total users, active subscriptions, generation counts by type/day/platform, revenue metrics. Include CSV/JSON export endpoint. Supports Admin Analytics page.
Implement rate limiting on all public and authenticated API routes using a token-bucket or sliding-window approach (e.g., Upstash Redis or in-memory for Vercel Edge). Add input sanitization, Zod validation schemas for all API inputs, and security headers (CSP, HSTS). Enforce protected routes via Clerk middleware.
Configure Vercel project: set environment variables (Clerk, OpenAI, Stripe, Cloudinary, DATABASE_URL), configure vercel.json for API timeouts and regions, set up preview and production environments, and connect PostgreSQL via Vercel Postgres or external provider. Create .env.example file.
No comments yet. Be the first!